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/profiles/services/unbound.nix
21 mermet/fileSystems.nix
30 mermet/public-inbox.nix
41 servers = import ../servers.nix;
44 inherit (system.config) networking;
45 lib = system.pkgs.lib;
46 in with system; system // {
49 let target = "root@${networking.hostName}.${networking.domain}";
50 profile = "/nix/var/nix/profiles/system";
52 nixos = config.system.build.toplevel;
54 pkgs.writeShellScriptBin "bash" ''
55 PATH="$PATH:${with pkgs; lib.makeBinPath [nix openssh pass]}"
57 nix ''${TRACE:+-L} copy \
58 --to ssh://${target} --substitute-on-destination \
61 ${config.security.install.shellHook}
62 ssh ${target} nix-env --profile "${profile}" --set "${nixos}" \
63 '&&' nix-env --profile "${profile}" --delete-generations "${generations}" \
64 '&&' "${profile}"/bin/switch-to-configuration "''${switch:-switch}"