mirror of
https://github.com/nix-community/disko
synced 2024-11-10 06:14:14 +00:00
accept relative paths for flakes in disko/disko-install
builtins.getFlake wants absolute paths
This commit is contained in:
parent
5866ae41f7
commit
a949edef70
2 changed files with 8 additions and 0 deletions
3
disko
3
disko
|
@ -118,6 +118,9 @@ if [[ -n "${flake+x}" ]]; then
|
||||||
echo "For example, to use the output diskoConfigurations.foo from the flake.nix, append \"#foo\" to the flake-uri."
|
echo "For example, to use the output diskoConfigurations.foo from the flake.nix, append \"#foo\" to the flake-uri."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
if [[ -e "$flake" ]]; then
|
||||||
|
flake=$(realpath "$flake")
|
||||||
|
fi
|
||||||
nix_args+=("--arg" "flake" "\"$flake\"")
|
nix_args+=("--arg" "flake" "\"$flake\"")
|
||||||
nix_args+=("--argstr" "flakeAttr" "$flakeAttr")
|
nix_args+=("--argstr" "flakeAttr" "$flakeAttr")
|
||||||
nix_args+=(--extra-experimental-features flakes)
|
nix_args+=(--extra-experimental-features flakes)
|
||||||
|
|
|
@ -151,6 +151,11 @@ main() {
|
||||||
flake="${BASH_REMATCH[1]}"
|
flake="${BASH_REMATCH[1]}"
|
||||||
flakeAttr="${BASH_REMATCH[2]}"
|
flakeAttr="${BASH_REMATCH[2]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -e "$flake" ]]; then
|
||||||
|
flake=$(realpath "$flake")
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -z ${flakeAttr-} ]]; then
|
if [[ -z ${flakeAttr-} ]]; then
|
||||||
echo "Please specify the name of the NixOS configuration to be installed, as a URI fragment in the flake-uri." >&2
|
echo "Please specify the name of the NixOS configuration to be installed, as a URI fragment in the flake-uri." >&2
|
||||||
echo 'For example, to use the output nixosConfigurations.foo from the flake.nix, append "#foo" to the flake-uri.' >&2
|
echo 'For example, to use the output nixosConfigurations.foo from the flake.nix, append "#foo" to the flake-uri.' >&2
|
||||||
|
|
Loading…
Reference in a new issue