From b31026260a93c136e6ce24e87ae8c8e22808fdc1 Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Wed, 2 Apr 2025 17:46:47 -0400 Subject: [PATCH 1/3] accept flake config by default --- flupdt/flake_build.py | 2 +- flupdt/flake_eval.py | 2 +- flupdt/flake_show.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/flupdt/flake_build.py b/flupdt/flake_build.py index 1a57d55..003af05 100644 --- a/flupdt/flake_build.py +++ b/flupdt/flake_build.py @@ -23,7 +23,7 @@ def build_output(path: str, output: str) -> str | None: """ logger.info(f"build {output}") logger.debug(f"outputting to {OUTPUT_DIR}/{output}.nixoutput") - out = bash_wrapper(f"nix build {path}#{output} -o {OUTPUT_DIR}/{output}.nixoutput") + out = bash_wrapper(f"nix build {path}#{output} -o {OUTPUT_DIR}/{output}.nixoutput --accept-flake-config") logger.debug("output") logger.debug(out[0]) logger.debug("error") diff --git a/flupdt/flake_eval.py b/flupdt/flake_eval.py index e88d03c..2a5d8c7 100644 --- a/flupdt/flake_eval.py +++ b/flupdt/flake_eval.py @@ -21,7 +21,7 @@ def evaluate_output(path: str, output: str) -> str | None: :raises RuntimeError: evaluation succeeds but no derivation is found """ logger.info(f"evaluating {output}") - out = bash_wrapper(f"nix eval {path}#{output}") + out = bash_wrapper(f"nix eval {path}#{output} --accept-flake-config") logger.debug(out[0]) logger.debug(out[1]) logger.debug(out[2]) diff --git a/flupdt/flake_show.py b/flupdt/flake_show.py index 9704f3c..655b8f9 100644 --- a/flupdt/flake_show.py +++ b/flupdt/flake_show.py @@ -53,7 +53,7 @@ def get_derivations_from_check(nix_path: str, path_to_flake: str) -> list[str]: :param path_to_flake: path to flake to be checked :returns a list of all valid derivations in the flake """ - flake_check = bash_wrapper(f"{nix_path} flake check --verbose --keep-going", path=path_to_flake) + flake_check = bash_wrapper(f"{nix_path} flake check --verbose --keep-going --accept-flake-config", path=path_to_flake) if flake_check[2] != 0: logger.warning( "nix flake check returned non-zero exit code, collecting all available outputs" @@ -83,7 +83,7 @@ def get_derivations(path_to_flake: str) -> list[str]: if nix_path is None: status_msg = "nix is not available in the PATH, please verify that it is installed" raise RuntimeError(status_msg) - flake_show = bash_wrapper(f"{nix_path} flake show --json", path=path_to_flake) + flake_show = bash_wrapper(f"{nix_path} flake show --json --accept-flake-path", path=path_to_flake) if flake_show[2] != 0: logger.error("flake show returned non-zero exit code") logger.warning("falling back to full evaluation via nix flake check") -- 2.48.1 From 24cb8609e88ee166f63f6ded6c4db7458000c5f3 Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Thu, 3 Apr 2025 08:20:20 -0400 Subject: [PATCH 2/3] enable fallback --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index 6c48bf4..61236f3 100644 --- a/flake.nix +++ b/flake.nix @@ -17,6 +17,7 @@ "nix-cache:trR+y5nwpQHR4hystoogubFmp97cewkjWeqqbygRQRs=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; + fallback = true; }; inputs = { -- 2.48.1 From 90deb23e94222a8bd67b06da5ddc234e11e111ed Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Sun, 6 Apr 2025 22:55:35 -0400 Subject: [PATCH 3/3] temp remove attic cache --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 61236f3..4470e0b 100644 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,7 @@ nixConfig = { substituters = [ "https://cache.nixos.org/?priority=1&want-mass-query=true" - "https://attic.nayeonie.com/nix-cache" + #"https://attic.nayeonie.com/nix-cache" "https://nix-community.cachix.org/?priority=10&want-mass-query=true" ]; trusted-substituters = [ -- 2.48.1