default: provide a way to check how we've been initialized
This commit is contained in:
parent
3abc719c76
commit
09f1929960
2 changed files with 10 additions and 2 deletions
11
default.nix
11
default.nix
|
@ -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)
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
inputs ? import inputsPath {},
|
inputs ? import inputsPath {},
|
||||||
selfPath ? {
|
selfPath ? {
|
||||||
outPath = builtins.toString ./.;
|
outPath = builtins.toString ./.;
|
||||||
|
selfMode = "impure";
|
||||||
},
|
},
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue