{ systemConfig ? null, lib, writeShellScriptBin, coreutils, openssh, nix, }: if systemConfig != null then writeShellScriptBin "deploySystem-${systemConfig.networking.hostName}" '' set -euo pipefail export PATH=${ lib.makeBinPath [ coreutils openssh nix ] } export NIX_SSHOPTS="''${NIX_SSHOPTS:=""} -p${toString (lib.head systemConfig.services.openssh.ports)}" if [[ `uname -n` != '${systemConfig.networking.hostName}' ]]; then nix copy --no-check-sigs --to 'ssh-ng://root@${systemConfig.networking.fqdn}?compress=1' ${systemConfig.system.build.toplevel} fi ssh -t $NIX_SSHOPTS root@${systemConfig.networking.fqdn} "nix-env -p /nix/var/nix/profiles/system -i ${systemConfig.system.build.toplevel}" ssh -t $NIX_SSHOPTS root@${systemConfig.networking.fqdn} "/nix/var/nix/profiles/system/bin/switch-to-configuration ''${1:-"switch"}" '' else writeShellScriptBin "deploySystem-none" "echo 'No system config given!'"