1 # NixOS configuration of losurdo.sourcephile.fr
3 # Show configuration options with, for example:
4 # nix-instantiate servers/losurdo.nix --eval -A config.networking.hostName
5 # Install/upgrade with:
6 # nix run install -f servers/losurdo.nix
8 ipv4 = "80.67.180.251";
9 system = import <nixpkgs/nixos/lib/eval-config.nix> {
10 system = "x86_64-linux";
13 ../nixos/base/install.nix
14 ../nixos/base/unbound.nix
17 losurdo/fileSystems.nix
19 losurdo/networking.nix
20 losurdo/postgresql.nix
24 losurdo/transmission.nix
30 servers = import ../servers.nix;
33 inherit (system.config) networking;
34 lib = system.pkgs.lib;
35 in with system; system // {
38 let target = "root@${networking.hostName}.${networking.domain}";
39 profile = "/nix/var/nix/profiles/system";
41 nixos = config.system.build.toplevel;
43 pkgs.writeShellScriptBin "bash" ''
44 PATH="$PATH:${with pkgs; lib.makeBinPath [nix openssh pass]}"
46 nix ''${TRACE:+-L} copy \
47 --to ssh://${target} --substitute-on-destination \
50 ${config.install.shellHook}
51 ssh ${target} nix-env --profile "${profile}" --set "${nixos}" \
52 '&&' nix-env --profile "${profile}" --delete-generations "${generations}" \
53 '&&' "${profile}"/bin/switch-to-configuration "''${switch:-switch}"