# NixOS configuration of losurdo.sourcephile.fr # # Show configuration options with, for example: # nix-instantiate servers/losurdo.nix --eval -A config.networking.hostName # Install/upgrade with: # nix run install -f servers/losurdo.nix let ipv4 = "80.67.180.251"; system = import { system = "x86_64-linux"; modules = [ ../nixos/defaults.nix ../nixos/profiles/services/unbound.nix losurdo/acme.nix losurdo/debug.nix losurdo/fail2ban.nix losurdo/fileSystems.nix losurdo/hardware.nix losurdo/networking.nix losurdo/postgresql.nix losurdo/sanoid.nix losurdo/syncoid.nix losurdo/system.nix losurdo/transmission.nix losurdo/users.nix ]; extraArgs = { name = "losurdo"; inherit ipv4; servers = import ../servers.nix; }; }; inherit (system.config) networking; lib = system.pkgs.lib; in with system; system // { inherit ipv4; 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.security.install.shellHook} ssh ${target} nix-env --profile "${profile}" --set "${nixos}" \ '&&' nix-env --profile "${profile}" --delete-generations "${generations}" \ '&&' "${profile}"/bin/switch-to-configuration "''${switch:-switch}" ''; }