diff options
Diffstat (limited to 'pkgs')
| -rw-r--r-- | pkgs/krops/default.nix | 6 | ||||
| -rw-r--r-- | pkgs/populate/default.nix | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/pkgs/krops/default.nix b/pkgs/krops/default.nix index e4f72cd..46ca66f 100644 --- a/pkgs/krops/default.nix +++ b/pkgs/krops/default.nix @@ -15,7 +15,11 @@ in (lib.shell.requireFlakes "deploying a flake")} NIX_PATH=${lib.escapeShellArg target.path} \ nixos-rebuild ${lib.escapeShellArgs (args ++ lib.optionals (flake != null) [ - "--flake" "${target.path}/${flake}" + "--flake" + # Generated flakes as path:, not just their paths, which Nix takes + # for the enclosing Git work tree, if any. + (lib.optionalString (lib.hasPrefix ".populate/flakes/" flake) "path:" + + "${target.path}/${flake}") ])} ${lib.optionalString (flake == null) # nixos-rebuild deploys /etc/nixos/flake.nix if it exists. Any # nixos-rebuild doing so supports --no-flake. diff --git a/pkgs/populate/default.nix b/pkgs/populate/default.nix index 08a624b..0992b0c 100644 --- a/pkgs/populate/default.nix +++ b/pkgs/populate/default.nix @@ -120,7 +120,8 @@ let printf ' outputs = inputs: inputs.%s;\n' ${quote (toJSON name)} echo '}' } > flake.nix - nix flake lock >&2 + # Not just ., which Nix takes for the enclosing Git work tree, if any. + nix flake lock ${quote "path:${flakesDir}/${name}"} >&2 ) ''; in |
