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
25 losurdo/transmission.nix
31 servers = import ../servers.nix;
34 inherit (system.config) networking;
35 lib = system.pkgs.lib;
36 in with system; system // {
39 let target = "root@${networking.hostName}.${networking.domain}";
40 profile = "/nix/var/nix/profiles/system";
42 nixos = config.system.build.toplevel;
44 pkgs.writeShellScriptBin "bash" ''
45 PATH="$PATH:${with pkgs; lib.makeBinPath [nix openssh pass]}"
47 nix ''${TRACE:+-L} copy \
48 --to ssh://${target} --substitute-on-destination \
51 ${config.install.shellHook}
52 ssh ${target} nix-env --profile "${profile}" --set "${nixos}" \
53 '&&' nix-env --profile "${profile}" --delete-generations "${generations}" \
54 '&&' "${profile}"/bin/switch-to-configuration "''${switch:-switch}"