aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-12 17:20:53 +0000
committertv <tv@krebsco.de>2026-11-12 17:20:53 +0000
commit9359951b4470542049ceb63ad04b7526a4c6c9e8 (patch)
tree8c0429be48b970ac038717021a05b45b218f4ed3 /pkgs
parent1ecf303545d70da9b861b08874b71fd259ac4d3f (diff)
populate flake, flake-input: take the flake reference as url
Flake and flake-input sources take the flake reference as attribute url, like git sources take their repository, and like inputs in flake.nix: something.flake = "github:owner/something"; otherthing.flake = { url = "github:owner/otherthing"; inputs.nixpkgs.follows = "nixpkgs"; };
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/populate/default.nix16
1 files changed, 8 insertions, 8 deletions
diff --git a/pkgs/populate/default.nix b/pkgs/populate/default.nix
index 6362f92..905e6e4 100644
--- a/pkgs/populate/default.nix
+++ b/pkgs/populate/default.nix
@@ -277,7 +277,7 @@ let
# several sources use the same flake.
cached = kind: command: /* sh */ ''
cache=$TMPDIR/flake-${kind}.$(
- printf %s ${quote source.flake} |
+ printf %s ${quote source.url} |
${coreutils}/bin/sha256sum |
${coreutils}/bin/cut -c-32
).json
@@ -289,7 +289,7 @@ let
'';
noInput = /* sh */ ''
>&2 printf 'error: flake %s has no input %s\n' \
- ${quote source.flake} ${quote (toString source.name)}
+ ${quote source.url} ${quote (toString source.name)}
exit 1
'';
# Shell function printing the store path $1, followed by the inputs its
@@ -409,7 +409,7 @@ let
${removeUpload}
if test "$added" != "$self"; then
>&2 printf 'error: flake %s arrived as %s instead of %s\n' \
- ${quote source.flake} "$added" "$self"
+ ${quote source.url} "$added" "$self"
exit 1
fi
fi
@@ -417,7 +417,7 @@ let
# referring to local paths can only be fetched if the target has them
# as well.
fetched=$(
- FLAKE=${quote source.flake} SELECTED=$selected SELF=$self \
+ FLAKE=${quote source.url} SELECTED=$selected SELF=$self \
nix eval --impure --raw --expr '
let
selected = builtins.fromJSON (builtins.getEnv "SELECTED");
@@ -460,8 +460,8 @@ let
archiveAndLink = /* sh */ ''
set -efu
${requireFlakes "fetching flakes on the target"}
- metadata=$(nix flake metadata --json --no-update-lock-file ${quote source.flake})
- archive=$(nix flake archive --json --no-update-lock-file ${quote source.flake})
+ metadata=$(nix flake metadata --json --no-update-lock-file ${quote source.url})
+ archive=$(nix flake archive --json --no-update-lock-file ${quote source.url})
lines=$(
METADATA=$metadata ARCHIVE=$archive \
nix eval --impure --raw --expr '
@@ -494,13 +494,13 @@ let
in
if !fetchOnTarget && !isLocalTarget target && target.sudo then
throw "krops: source ${target.path}: copying flakes to targets with sudo is not supported"
- else if fetchOnTarget && source.name == null && isRemoteRef source.flake then
+ else if fetchOnTarget && source.name == null && isRemoteRef source.url then
runShell target archiveAndLink
else /* sh */ ''
set -efu
${cached "metadata" /* sh */ ''
- ${nix'} flake metadata --json --no-update-lock-file ${quote source.flake}
+ ${nix'} flake metadata --json --no-update-lock-file ${quote source.url}
''}
if ! selected=$(