1 # NixOS configuration of mermet.sourcephile.fr
3 # Show configuration options with, for example:
4 # nix-instantiate servers/mermet.nix --eval -A config.networking.hostName
6 # nix eval servers.mermet.config.networking.hostName
7 # Install/upgrade with:
8 # nix run install -f servers/mermet.nix
10 # nix run servers.mermet.install
12 ipv4 = "80.67.180.129";
13 system = import <nixpkgs/nixos/lib/eval-config.nix> {
14 system = "x86_64-linux";
17 ../nixos/base/install.nix
18 ../nixos/base/unbound.nix
22 mermet/fileSystems.nix
31 mermet/public-inbox.nix
42 servers = import ../servers.nix;
45 inherit (system.config) networking;
46 lib = system.pkgs.lib;
47 in with system; system // {
50 let target = "root@${networking.hostName}.${networking.domain}";
51 profile = "/nix/var/nix/profiles/system";
53 nixos = config.system.build.toplevel;
55 pkgs.writeShellScriptBin "bash" ''
56 PATH="$PATH:${with pkgs; lib.makeBinPath [nix openssh pass]}"
58 nix ''${TRACE:+-L} copy \
59 --to ssh://${target} --substitute-on-destination \
62 ${config.install.shellHook}
63 ssh ${target} nix-env --profile "${profile}" --set "${nixos}" \
64 '&&' nix-env --profile "${profile}" --delete-generations "${generations}" \
65 '&&' "${profile}"/bin/switch-to-configuration "''${switch:-switch}"