From 09f1929960205a9b35862841fcd6be66101baac8 Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Sun, 4 May 2025 16:33:38 +0200 Subject: [PATCH] default: provide a way to check how we've been initialized --- default.nix | 11 +++++++++-- outputs.nix | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/default.nix b/default.nix index 4fad081..998d023 100644 --- a/default.nix +++ b/default.nix @@ -27,11 +27,18 @@ let && lib.runGitignoreFilter gitIgnoreFilters path type; in result; }; + selfMode = "path"; + }; + gitfullSelfInStore = builtins.fetchGit "file://${builtins.toString ./.}" // { + selfMode = "git"; }; - gitfullSelfInStore = builtins.fetchGit "file://${builtins.toString ./.}"; selfInStore' = builtins.tryEval gitfullSelfInStore; selfInStore = if selfInStore'.success then selfInStore'.value else gitlessSelfInStore; in -if !(evaluatingInStore) then { ... }@args: import selfInStore ({ selfPath = selfInStore; } // args ) +if !(evaluatingInStore) then { ... }@args: import selfInStore ({ + selfPath = selfInStore // { + selfMode = "store"; + }; +} // args ) else { ... }@args: import ./outputs.nix ({ selfPath = selfInStore; } // args) diff --git a/outputs.nix b/outputs.nix index 8cc85cc..b95e04b 100644 --- a/outputs.nix +++ b/outputs.nix @@ -3,6 +3,7 @@ inputs ? import inputsPath {}, selfPath ? { outPath = builtins.toString ./.; + selfMode = "impure"; }, }: