outputs: remove selfPath, but use that method in selfExpr default

by stringifying ./. then appending path, nix adds selfPath (nix-store path) to gcroot of selfPath derivation
This commit is contained in:
Wroclaw 2024-06-20 19:33:16 +02:00
parent 9e59fd06af
commit 19c4cb4c2f
2 changed files with 4 additions and 6 deletions

View file

@ -1,13 +1,11 @@
{ inputs ? import ./inputs.nix {} { inputs ? import ./inputs.nix {} }:
, selfPath ? builtins.toString ./.
}:
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; inherit lib inputs;
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 = {
@ -39,7 +37,7 @@ self = {
./hosts/${name} ./hosts/${name}
{ {
config.nixpkgs.overlays = [ config.nixpkgs.overlays = [
( import ./pkgs/overlays/selfExpr.nix { nixpkgsPath = ./pkgs/top-level/impure.nix; } ) ( import ./pkgs/overlays/selfExpr.nix { nixpkgsPath = "${builtins.toString ./.}/pkgs/top-level/impure.nix"; } )
self.overlays.versionInfoFixup self.overlays.versionInfoFixup
]; ];
} }

View file

@ -25,7 +25,7 @@ self: super: {
in '' in ''
{ ... } @ args: { ... } @ args:
import ${builtins.toString nixpkgsPath} { import ${nixpkgsPath} {
${self.lib.optionalString useConfig configText} ${self.lib.optionalString useConfig configText}
} // builtins.removeAttrs args (builtins.fromJSON ''' } // builtins.removeAttrs args (builtins.fromJSON '''
${removedAttrNamesText} ${removedAttrNamesText}