default: provide a way to check how we've been initialized

This commit is contained in:
Wroclaw 2025-05-04 16:33:38 +02:00
parent 3abc719c76
commit 09f1929960
2 changed files with 10 additions and 2 deletions

View file

@ -27,11 +27,18 @@ let
&& lib.runGitignoreFilter gitIgnoreFilters path type; && lib.runGitignoreFilter gitIgnoreFilters path type;
in result; in result;
}; };
selfMode = "path";
};
gitfullSelfInStore = builtins.fetchGit "file://${builtins.toString ./.}" // {
selfMode = "git";
}; };
gitfullSelfInStore = builtins.fetchGit "file://${builtins.toString ./.}";
selfInStore' = builtins.tryEval gitfullSelfInStore; selfInStore' = builtins.tryEval gitfullSelfInStore;
selfInStore = if selfInStore'.success then selfInStore'.value else gitlessSelfInStore; selfInStore = if selfInStore'.success then selfInStore'.value else gitlessSelfInStore;
in 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) else { ... }@args: import ./outputs.nix ({ selfPath = selfInStore; } // args)

View file

@ -3,6 +3,7 @@
inputs ? import inputsPath {}, inputs ? import inputsPath {},
selfPath ? { selfPath ? {
outPath = builtins.toString ./.; outPath = builtins.toString ./.;
selfMode = "impure";
}, },
}: }: