4 boot.kernelPackages = pkgs.linuxPackages_latest;
5 myEnv = import "${privateFiles}/environment.nix" // { inherit privateFiles; };
8 firewall.enable = false;
9 interfaces."eth0".ipv4.addresses = pkgs.lib.attrsets.mapAttrsToList
10 (n: ips: { address = ips.ip4; prefixLength = 32; })
11 (pkgs.lib.attrsets.filterAttrs (n: v: n != "main") config.hostEnv.ips);
12 interfaces."eth0".ipv6.addresses = pkgs.lib.flatten (pkgs.lib.attrsets.mapAttrsToList
13 (n: ips: map (ip: { address = ip; prefixLength = (if n == "main" && ip == pkgs.lib.head ips.ip6 then 64 else 128); }) (ips.ip6 or []))
17 myServices.ssh.modules = [ config.myServices.ssh.predefinedModules.regular ];
18 imports = builtins.attrValues (import ../..);
21 targetEnv = "hetzner";
23 robotUser = config.myEnv.hetzner.user;
24 robotPass = config.myEnv.hetzner.pass;
25 mainIPv4 = config.hostEnv.ips.main.ip4;
27 clearpart --all --initlabel --drives=sda,sdb,sdc,sdd
29 part swap --recommended --label=swap --fstype=swap --ondisk=sda
31 part raid.1 --grow --ondisk=sdc
32 part raid.2 --grow --ondisk=sdd
34 raid / --level=1 --device=md0 --fstype=ext4 --label=root raid.1 raid.2
36 part /nix --grow --label=nix --ondisk=sda
37 part /data --grow --label=data --ondisk=sdb
42 programs.zsh.enable = true;
44 users.users.backup = {
45 home = "/var/lib/backup";
49 shell = pkgs.bashInteractive;
50 openssh.authorizedKeys.keys = let
52 ["command=\"${pkgs.rrsync_sudo}/bin/rrsync /var/lib/backup/eldiron/\" ${config.myEnv.rsync_backup.ssh_key.public}"];
54 security.sudo.extraRules = pkgs.lib.mkAfter [
57 { command = "${pkgs.rsync}/bin/rsync"; options = [ "NOPASSWD" ]; }
64 { command = "/home/immae/.nix-profile/root_scripts/*"; options = [ "NOPASSWD" ]; }
71 boot.kernel.sysctl."vm.nr_hugepages" = 256; # for xmr-stak
72 system.activationScripts.backup_home = ''
73 chown root:root /var/lib/backup
74 install -m 0750 -o backup -g root -d /var/lib/backup/eldiron
77 virtualisation.docker.enable = true;
78 virtualisation.libvirtd.enable = true;
79 users.extraUsers.immae.extraGroups = [ "libvirtd" "docker" ];
80 systemd.services.libvirtd.postStart = ''
81 install -m 0770 -g libvirtd -d /var/lib/libvirt/images
84 time.timeZone = "Europe/Paris";
86 useSandbox = "relaxed";
89 keep-derivations = true
91 allow-import-from-derivation = true
95 security.pki.certificateFiles = [
97 url = "http://downloads.e.eriomem.net/eriomemca.pem";
98 sha256 = "1ixx4c6j3m26j8dp9a3dkvxc80v1nr5aqgmawwgs06bskasqkvvh";
102 # This is equivalent to setting environment.sessionVariables.NIX_PATH
104 "home-manager=https://github.com/rycee/home-manager/archive/master.tar.gz"
105 "nixpkgs=https://nixos.org/channels/nixos-unstable/nixexprs.tar.xz"
107 nix.binaryCaches = [ "https://hydra.iohk.io" "https://cache.nixos.org" ];
108 nix.binaryCachePublicKeys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ];
110 # This value determines the NixOS release with which your system is
111 # to be compatible, in order to avoid breaking some software such as
112 # database servers. You should change this only after NixOS release
113 # notes say you should.
114 # https://nixos.org/nixos/manual/release-notes.html
115 system.stateVersion = "20.03"; # Did you read the comment?