From 2ddbb18906c19d351274b68e182839f1801f4ce9 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 14 Nov 2026 04:18:14 +0000 Subject: krops: leave targets to populate, also in pure evaluation writeDeploy, writeCommand, and writeTest pass target strings to pkgs.populate as they are, so populate fills in what they leave out, and decides whether the target is local, when it runs. runShell runs populate shell, which decides that for running nixos-rebuild and writeCommand's commands, so rebuild's unbuffer for local targets with allocateTTY depends on $1, and runShell returns shell code, also for remote targets. Target attribute sets get mkTarget's defaults and whether they're local during evaluation, as before, unless that's pure: then mkTarget leaves the user and the host null, instead of reading /etc/hostname, which pure evaluation pretends doesn't exist, and pkgs.populate and populate shell leave them, and whether the target is local, to populate, which also refuses copying flakes to targets using sudo then. writeTest checks that its target is local during evaluation, unless that's pure, and with populate shell --local-only before populating. writeDeploy needs a target's host for a separate buildTarget in pure evaluation. pkgs/krops/target.nix has what pkgs.populate and pkgs.krops need of targets. pkgs.populate's derivations stay the same, for strings and attribute sets. The deploy scenarios get target strings too, for the local and the remote target, and so does the allocateTTY scenario. --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 0b06ec5..b0fc25a 100644 --- a/flake.nix +++ b/flake.nix @@ -19,7 +19,7 @@ lib = forAllSystems (system: let pkgs = nixpkgs.legacyPackages.${system}; - krops = pkgs.callPackage ./pkgs/krops { inherit populate; }; + krops = pkgs.callPackage ./pkgs/krops { inherit populate populate-unwrapped; }; populate = pkgs.callPackage ./pkgs/krops/populate.nix { inherit populate-unwrapped; }; populate-unwrapped = pkgs.callPackage ./pkgs/populate {}; in { -- cgit v1.3.1