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
35 inherit (system.config) networking;
36 lib = system.pkgs.lib;
37 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}"