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
5 # Install/upgrade with:
6 # nix run install -f servers/mermet.nix
8 system = import <nixpkgs/nixos/lib/eval-config.nix> {
9 system = "x86_64-linux";
12 ../nixos/base/install.nix
13 ../nixos/base/unbound.nix
16 mermet/fileSystems.nix
25 mermet/public-inbox.nix
37 inherit (system.config) networking;
38 lib = system.pkgs.lib;
39 in with system; system // {
41 let target = "root@${networking.hostName}.${networking.domain}";
42 profile = "/nix/var/nix/profiles/system";
44 nixos = config.system.build.toplevel;
46 pkgs.writeShellScriptBin "bash" ''
47 PATH="$PATH:${with pkgs; lib.makeBinPath [nix openssh pass]}"
49 nix ''${TRACE:+-L} copy \
50 --to ssh://${target} --substitute-on-destination \
53 ${config.install.shellHook}
54 ssh ${target} nix-env --profile "${profile}" --set "${nixos}" \
55 '&&' nix-env --profile "${profile}" --delete-generations "${generations}" \
56 '&&' "${profile}"/bin/switch-to-configuration "''${switch:-switch}"