diff --git a/hosts/mercury/configuration.nix b/hosts/mercury/configuration.nix index a9abd3d..acf00e2 100644 --- a/hosts/mercury/configuration.nix +++ b/hosts/mercury/configuration.nix @@ -46,6 +46,22 @@ virtualisation.oci-containers.containers.pihole.environmentFiles = [ config.sops.templates."pihole.env".path ]; + # ---- Closure trim ---- + # Every deploy rewrites the changed closure onto the SD card, so drop what the + # sd-image module pulls in for installer use (2.9G → 1.6G). + # base.nix = installer rescue tools + ZFS/xfs/btrfs support. + disabledModules = [ "profiles/base.nix" ]; + environment.systemPackages = [ pkgs.tcpdump ]; # kept from base.nix: DHCP debugging + # ~850M of linux-firmware; eth0 needs none and the Pi's GPU firmware lives on + # the FIRMWARE partition. Re-enable if WiFi/Bluetooth is ever used. + hardware.enableRedistributableFirmware = lib.mkForce false; + documentation.enable = false; + system.disableInstallerTools = true; # nixos-rebuild runs on the laptop, not here + # Pins nixpkgs' ~200M source into the closure; `nix shell nixpkgs#…` here + # falls back to the global registry instead. + nixpkgs.flake.setFlakeRegistry = false; + nixpkgs.flake.setNixPath = false; + # Do not modify after first flash. system.stateVersion = "26.05"; } diff --git a/scripts/deploy b/scripts/deploy index 000d9b4..5a868b0 100755 --- a/scripts/deploy +++ b/scripts/deploy @@ -672,9 +672,12 @@ case "$cmd" in echo ">> nixos-rebuild $cmd .#$config on darman@$host" # --ask-sudo-password, not the deprecated --use-remote-sudo: common.nix sets # wheelNeedsPassword = true, and --use-remote-sudo never actually prompts. + # --use-substitutes: the target pulls cache hits itself (compressed) instead + # of the laptop pushing uncompressed NARs over ssh; misses are still pushed. rebuild=(nix run nixpkgs#nixos-rebuild -- "$cmd" --flake ".#$config" --target-host "darman@$host" + --use-substitutes --ask-sudo-password) item="${HOMELAB_PASS_ITEM:-darman@$config}"