nibylandia/modules/common.nix

159 lines
3.1 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
let secrets = import ../secrets.nix;
in {
boot.binfmt.emulatedSystems =
lib.lists.remove pkgs.system [ "x86_64-linux" "aarch64-linux" ];
programs.command-not-found.enable = false;
system.stateVersion = "23.11";
services.openssh = {
enable = true;
openFirewall = true;
settings.PasswordAuthentication = false;
};
programs = {
mtr.enable = true;
neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
};
zsh = {
enable = true;
enableBashCompletion = true;
autosuggestions.enable = true;
syntaxHighlighting.enable = true;
ohMyZsh.enable = true;
};
tmux = {
enable = true;
terminal = "screen256-color";
clock24 = true;
};
bash.enableCompletion = true;
mosh.enable = true;
};
nix = {
package = pkgs.nixUnstable;
extraOptions = ''
experimental-features = nix-command flakes
'';
2023-10-14 21:24:33 +00:00
settings.trusted-users = [ "ar" ];
};
nixpkgs.config.allowUnfree = true;
nixpkgs.config.allowBroken = true;
environment.systemPackages = with pkgs; [
deploy-rs
2023-10-14 21:24:33 +00:00
mastodon-update-script
file
git
go
libarchive
lm_sensors
lshw
lsof
pciutils
pry
pv
strace
usbutils
wget
zip
config.boot.kernelPackages.perf
age
sshfs
dig
dstat
htop
iperf
whois
xxd
tcpdump
traceroute
age
cfssl
gomuks
bind
nmap
];
documentation = {
man.enable = true;
doc.enable = true;
dev.enable = true;
info.enable = true;
nixos.enable = true;
};
users.users.root.openssh.authorizedKeys.keys = secrets.ar;
users.mutableUsers = false;
users.defaultUserShell = pkgs.zsh;
users.groups.ar = { gid = 1000; };
users.users.ar = {
isNormalUser = true;
uid = 1000;
group = "ar";
extraGroups = [
"users"
"wheel"
"systemd-journal"
"docker"
"vboxusers"
"podman"
"tss"
"nitrokey"
"tss"
"plugdev"
"video"
"dialout"
"networkmanager"
];
hashedPassword = lib.mkDefault null;
openssh.authorizedKeys.keys = secrets.ar;
};
console.keyMap = "us";
i18n = {
defaultLocale = "en_CA.UTF-8";
supportedLocales = [
"en_CA.UTF-8/UTF-8"
"en_US.UTF-8/UTF-8"
"en_DK.UTF-8/UTF-8"
"pl_PL.UTF-8/UTF-8"
];
};
time.timeZone = "Europe/Warsaw";
2023-10-14 21:24:33 +00:00
systemd.network = {
enable = true;
netdevs.virbr0.netdevConfig = {
Kind = "bridge";
Name = "virbr0";
};
networks.virbr0 = {
matchConfig.Name = "virbr0";
# Hand out IP addresses to MicroVMs.
# Use `networkctl status virbr0` to see leases.
networkConfig = {
DHCPServer = true;
IPv6SendRA = true;
};
addresses = [
{ addressConfig.Address = "10.0.0.1/24"; }
{ addressConfig.Address = "fd12:3456:789a::1/64"; }
];
ipv6Prefixes = [{ ipv6PrefixConfig.Prefix = "fd12:3456:789a::/64"; }];
};
networks.microvm-eth0 = {
matchConfig.Name = "vm-*";
networkConfig.Bridge = "virbr0";
};
};
}