nixpkgs sourceInfo patching: move to nixpatches/
previously i was using the sourceInfo of the flake, which is kinda wrong: and it would force a _new_ nixpkgs for every time i commit to my own repo -- not just when i bump it
This commit is contained in:
parent
dfc768e2e6
commit
a8bc77d40c
25
flake.nix
25
flake.nix
|
@ -97,30 +97,7 @@
|
||||||
patchNixpkgs = variant: nixpkgs: (import ./nixpatches/flake.nix).outputs {
|
patchNixpkgs = variant: nixpkgs: (import ./nixpatches/flake.nix).outputs {
|
||||||
inherit variant nixpkgs;
|
inherit variant nixpkgs;
|
||||||
self = patchNixpkgs variant nixpkgs;
|
self = patchNixpkgs variant nixpkgs;
|
||||||
} // {
|
};
|
||||||
# sourceInfo includes fields (square brackets for the ones which are not always present):
|
|
||||||
# - [dirtyRev]
|
|
||||||
# - [dirtyShortRev]
|
|
||||||
# - lastModified
|
|
||||||
# - lastModifiedDate
|
|
||||||
# - narHash
|
|
||||||
# - outPath
|
|
||||||
# - [rev]
|
|
||||||
# - [revCount]
|
|
||||||
# - [shortRev]
|
|
||||||
# - submodules
|
|
||||||
#
|
|
||||||
# these values are used within nixpkgs:
|
|
||||||
# - to give a friendly name to the nixos system (`readlink /run/current-system` -> `...nixos-system-desko-24.05.20240227.dirty`)
|
|
||||||
# - to alias `import <nixpkgs>` so that nix uses the system's nixpkgs when called externally (supposedly).
|
|
||||||
#
|
|
||||||
# these values seem to exist both within the `sourceInfo` attrset and at the top-level.
|
|
||||||
# for a list of all implicit flake outputs (which is what these seem to be):
|
|
||||||
# $ nix-repl
|
|
||||||
# > lf .
|
|
||||||
# > <tab>
|
|
||||||
inherit (self) sourceInfo;
|
|
||||||
} // self.sourceInfo;
|
|
||||||
|
|
||||||
nixpkgs' = patchNixpkgs "master" nixpkgs-unpatched;
|
nixpkgs' = patchNixpkgs "master" nixpkgs-unpatched;
|
||||||
nixpkgsCompiledBy = system: nixpkgs'.legacyPackages."${system}";
|
nixpkgsCompiledBy = system: nixpkgs'.legacyPackages."${system}";
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
let
|
let
|
||||||
patchedPkgsFor = system: nixpkgs.legacyPackages.${system}.applyPatches {
|
patchedPkgsFor = system: nixpkgs.legacyPackages.${system}.applyPatches {
|
||||||
name = "nixpkgs-patched-uninsane";
|
name = "nixpkgs-patched-uninsane";
|
||||||
version = self.lastModifiedDate;
|
version = nixpkgs.sourceInfo.lastModifiedDate;
|
||||||
src = nixpkgs;
|
src = nixpkgs;
|
||||||
patches = builtins.filter (p: p != null) (
|
patches = builtins.filter (p: p != null) (
|
||||||
nixpkgs.legacyPackages."${system}".callPackage ./list.nix { } variant nixpkgs.lastModifiedDate
|
nixpkgs.legacyPackages."${system}".callPackage ./list.nix { } variant nixpkgs.lastModifiedDate
|
||||||
|
@ -45,5 +45,28 @@
|
||||||
).lib.nixosSystem args;
|
).lib.nixosSystem args;
|
||||||
|
|
||||||
legacyPackages = (self._forSystem null).legacyPackages;
|
legacyPackages = (self._forSystem null).legacyPackages;
|
||||||
};
|
|
||||||
|
# sourceInfo includes fields (square brackets for the ones which are not always present):
|
||||||
|
# - [dirtyRev]
|
||||||
|
# - [dirtyShortRev]
|
||||||
|
# - lastModified
|
||||||
|
# - lastModifiedDate
|
||||||
|
# - narHash
|
||||||
|
# - outPath
|
||||||
|
# - [rev]
|
||||||
|
# - [revCount]
|
||||||
|
# - [shortRev]
|
||||||
|
# - submodules
|
||||||
|
#
|
||||||
|
# these values are used within nixpkgs:
|
||||||
|
# - to give a friendly name to the nixos system (`readlink /run/current-system` -> `...nixos-system-desko-24.05.20240227.dirty`)
|
||||||
|
# - to alias `import <nixpkgs>` so that nix uses the system's nixpkgs when called externally (supposedly).
|
||||||
|
#
|
||||||
|
# these values seem to exist both within the `sourceInfo` attrset and at the top-level.
|
||||||
|
# for a list of all implicit flake outputs (which is what these seem to be):
|
||||||
|
# $ nix-repl
|
||||||
|
# > lf .
|
||||||
|
# > <tab>
|
||||||
|
inherit (nixpkgs) sourceInfo;
|
||||||
|
} // nixpkgs.sourceInfo;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue