From a949edef702fa70b90af6df315a9da21c8781a4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 11 Mar 2024 13:59:00 +0100 Subject: [PATCH] accept relative paths for flakes in disko/disko-install builtins.getFlake wants absolute paths --- disko | 3 +++ disko-install | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/disko b/disko index 845b204..94ca2fe 100755 --- a/disko +++ b/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." exit 1 fi + if [[ -e "$flake" ]]; then + flake=$(realpath "$flake") + fi nix_args+=("--arg" "flake" "\"$flake\"") nix_args+=("--argstr" "flakeAttr" "$flakeAttr") nix_args+=(--extra-experimental-features flakes) diff --git a/disko-install b/disko-install index 330f896..fde0598 100755 --- a/disko-install +++ b/disko-install @@ -151,6 +151,11 @@ main() { flake="${BASH_REMATCH[1]}" flakeAttr="${BASH_REMATCH[2]}" fi + + if [[ -e "$flake" ]]; then + flake=$(realpath "$flake") + fi + 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 'For example, to use the output nixosConfigurations.foo from the flake.nix, append "#foo" to the flake-uri.' >&2