forked from DGNum/infrastructure
chore(nix-patches): Add helper function
This commit is contained in:
parent
bfe4957926
commit
9bc651db42
2 changed files with 6 additions and 11 deletions
6
hive.nix
6
hive.nix
|
@ -2,10 +2,8 @@ let
|
||||||
sources' = import ./npins;
|
sources' = import ./npins;
|
||||||
|
|
||||||
# Patch sources directly
|
# Patch sources directly
|
||||||
sources = builtins.mapAttrs (
|
sources = builtins.mapAttrs (patch.base { pkgs = import sources'.nixos-unstable { }; })
|
||||||
name: src:
|
.applyPatches' sources';
|
||||||
(patch.base { pkgs = import sources'.nixos-unstable { }; }).applyPatches { inherit name src; }
|
|
||||||
) sources';
|
|
||||||
|
|
||||||
lib = import (sources.nix-lib + "/src/trivial.nix");
|
lib = import (sources.nix-lib + "/src/trivial.nix");
|
||||||
|
|
||||||
|
|
|
@ -37,20 +37,15 @@
|
||||||
rec {
|
rec {
|
||||||
base =
|
base =
|
||||||
{ pkgs }:
|
{ pkgs }:
|
||||||
|
|
||||||
let
|
|
||||||
inherit (pkgs.lib) fakeHash optionalAttrs;
|
|
||||||
in
|
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
mkUrlPatch =
|
mkUrlPatch =
|
||||||
attrs:
|
attrs:
|
||||||
pkgs.fetchpatch (
|
pkgs.fetchpatch (
|
||||||
{
|
{
|
||||||
hash = fakeHash;
|
hash = pkgs.lib.fakeHash;
|
||||||
}
|
}
|
||||||
// attrs
|
// attrs
|
||||||
// (optionalAttrs (excludeGitHubManual && !(builtins.hasAttr "includes" attrs)) {
|
// (pkgs.lib.optionalAttrs (excludeGitHubManual && !(builtins.hasAttr "includes" attrs)) {
|
||||||
excludes = (attrs.excludes or [ ]) ++ [ "nixos/doc/manual/*" ];
|
excludes = (attrs.excludes or [ ]) ++ [ "nixos/doc/manual/*" ];
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
@ -107,6 +102,8 @@ rec {
|
||||||
|
|
||||||
name = "${name}-patched";
|
name = "${name}-patched";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
applyPatches' = name: src: applyPatches { inherit name src; };
|
||||||
};
|
};
|
||||||
|
|
||||||
mkNixpkgsSrc = { src, name }: (base { pkgs = import src { }; }).applyPatches { inherit src name; };
|
mkNixpkgsSrc = { src, name }: (base { pkgs = import src { }; }).applyPatches { inherit src name; };
|
||||||
|
|
Loading…
Reference in a new issue