aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-11 18:54:45 +0000
committertv <tv@krebsco.de>2026-11-11 18:54:45 +0000
commit8343006ff1154be2dd9ebf862afe5caed02044c7 (patch)
tree0916e9a98dc41e1a55ee37614e8aeb3e41b2a0c8
parent2451dceb0cf2b0b4e5b1815dd28fb480ba1d5956 (diff)
krops writeDeploy: deploy generated flakes
The flake parameter names a source. If the source draws inputs from other sources, its generated flake gets deployed.
-rw-r--r--pkgs/krops/default.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/pkgs/krops/default.nix b/pkgs/krops/default.nix
index 93f9d0e..75a4d14 100644
--- a/pkgs/krops/default.nix
+++ b/pkgs/krops/default.nix
@@ -108,6 +108,17 @@ in
then target'
else lib.mkTarget buildTarget;
target' = lib.mkTarget target;
+ # The source's generated flake, if it draws inputs from other sources.
+ flake' = let
+ name = lib.head (lib.splitString "#" flake);
+ in
+ if flake == null then null
+ else if !(source ? ${name}) then
+ throw "krops: flake ${name} is not a source"
+ else if lib.flakeFollows source.${name} != [] then
+ ".populate/flakes/${flake}"
+ else
+ flake;
in
lib.traceIf (fast != null) "writeDeploy: it's now always fast, setting the `fast` attribute is deprecated and will be removed in future" (
writers.writeDash name ''
@@ -115,7 +126,7 @@ in
${lib.optionalString (buildTarget' != target')
(populate { inherit backup force source; target = buildTarget'; })}
${populate { inherit backup force source; target = target'; }}
- ${rebuild { inherit flake useNixOutputMonitor; } ([
+ ${rebuild { flake = flake'; inherit useNixOutputMonitor; } ([
operation
] ++ lib.optionals crossDeploy [
"--no-build-nix"