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";
16 mermet/fileSystems.nix
24 mermet/public-inbox.nix
36 inherit (system.config) networking;
37 lib = system.pkgs.lib;
38 in with system; system // {
40 let target = "root@${networking.hostName}.${networking.domain}";
41 profile = "/nix/var/nix/profiles/system";
43 nixos = config.system.build.toplevel;
45 pkgs.writeShellScriptBin "bash" ''
46 PATH="$PATH:${with pkgs; lib.makeBinPath [nix openssh pass]}"
48 nix ''${TRACE:+-L} copy \
49 --to ssh://${target} --substitute-on-destination \
52 ${config.install.shellHook}
53 ssh ${target} nix-env --profile "${profile}" --set "${nixos}" \
54 '&&' nix-env --profile "${profile}" --delete-generations "${generations}" \
55 '&&' "${profile}"/bin/switch-to-configuration "''${switch:-switch}"