Compare commits

...

2 commits

Author SHA1 Message Date
d5b5519f4f outputs: allow string interpolation 2024-07-07 08:34:47 +02:00
ccae4f8ef4 outputs: inherit self 2024-07-07 08:20:40 +02:00
2 changed files with 10 additions and 6 deletions

View file

@ -47,5 +47,5 @@ let
type != "unknown" && builtins.baseNameOf path != ".git" && !matchesGitIgnore path type != "unknown" && builtins.baseNameOf path != ".git" && !matchesGitIgnore path
) ./.; ) ./.;
in in
if !(evaluatingInStore) then import selfInStore if !(evaluatingInStore) then { ... }@args: import selfInStore ({ selfPath = selfInStore; } // args )
else import ./outputs.nix else { ... }@args: import ./outputs.nix ({ selfPath = selfInStore; } // args)

View file

@ -1,11 +1,15 @@
{ inputs ? import ./inputs.nix {} }: {
inputs ? import ./inputs.nix {},
selfPath ? ./.
}:
let let
lib = (import "${inputs.nixpkgs}/lib").extend (import ./lib/overlays/version-info-fixup.nix { inherit inputs; }); lib = (import "${inputs.nixpkgs}/lib").extend (import ./lib/overlays/version-info-fixup.nix { inherit inputs; });
self = { self = {
inherit lib inputs; inherit inputs lib self;
__toString = _: selfPath;
modifiedNixpkgs = import ./pkgs/top-level/impure.nix; modifiedNixpkgs = import ./pkgs/top-level/impure.nix;
modifiedNixpkgsPure = import ./pkgs/top-level/default.nix; modifiedNixpkgsPure = import ./pkgs/top-level/default.nix;
overlays = { overlays = {
@ -40,8 +44,8 @@ self = {
./hosts/${name} ./hosts/${name}
{ {
config.nixpkgs.overlays = [ config.nixpkgs.overlays = [
( import ./pkgs/overlays/selfExpr.nix { nixpkgsPath = "${builtins.toString ./.}/pkgs/top-level/impure.nix"; } ) ( import ./pkgs/overlays/selfExpr.nix { nixpkgsPath = "${self}/pkgs/top-level/impure.nix"; } )
( import "${inputs.nixpkgs}/pkgs/top-level/by-name-overlay.nix" "${builtins.toString ./.}/pkgs/by-name" ) ( import "${inputs.nixpkgs}/pkgs/top-level/by-name-overlay.nix" "${self}/pkgs/by-name" )
self.overlays.versionInfoFixup self.overlays.versionInfoFixup
]; ];
} }