# NixOS configuration of mermet.sourcephile.fr # # Show configuration options with, for example: # nix-instantiate servers/mermet.nix --eval -A config.networking.hostName # Install/upgrade with: # nix run install -f servers/mermet.nix let system = import { system = "x86_64-linux"; modules = [ ../nixos/defaults.nix ../nixos/base/install.nix ../nixos/base/unbound.nix mermet/debug.nix mermet/dovecot.nix mermet/fileSystems.nix mermet/gitolite.nix mermet/hardware.nix mermet/knot.nix #mermet/mlmmj.nix mermet/networking.nix mermet/nginx.nix mermet/openldap.nix mermet/postfix.nix mermet/public-inbox.nix mermet/redis.nix mermet/rspamd.nix mermet/sanoid.nix mermet/shorewall.nix mermet/system.nix mermet/users.nix ]; extraArgs = { name = "mermet"; }; }; inherit (system.config) networking; lib = system.pkgs.lib; in with system; system // { install = let target = "root@${networking.hostName}.${networking.domain}"; profile = "/nix/var/nix/profiles/system"; generations = "+10"; nixos = config.system.build.toplevel; in pkgs.writeShellScriptBin "bash" '' PATH="$PATH:${with pkgs; lib.makeBinPath [nix openssh pass]}" set -eux nix ''${TRACE:+-L} copy \ --to ssh://${target} --substitute-on-destination \ ${nixos} target="${target}" ${config.install.shellHook} ssh ${target} nix-env --profile "${profile}" --set "${nixos}" \ '&&' nix-env --profile "${profile}" --delete-generations "${generations}" \ '&&' "${profile}"/bin/switch-to-configuration "''${switch:-switch}" ''; }