Kde/patches: refactor overlay function
This commit is contained in:
parent
b8a2c3c10d
commit
00cbe6876e
1 changed files with 12 additions and 7 deletions
|
|
@ -1,6 +1,7 @@
|
|||
{lib, ...}: let
|
||||
rootDirs = builtins.readDir ./.;
|
||||
removeFiles = lib.attrsets.filterAttrs (n: v: v == "directory") rootDirs;
|
||||
programsToPatch = builtins.attrNames removeFiles;
|
||||
|
||||
getPatches = name:
|
||||
builtins.map (value: ./${name}/${value}) (builtins.attrNames (
|
||||
|
|
@ -11,14 +12,18 @@
|
|||
));
|
||||
|
||||
bigOverlay = final: prev:
|
||||
builtins.mapAttrs (
|
||||
name: _value:
|
||||
prev."${name}".overrideAttrs {
|
||||
version = prev."${name}".version + "-patched";
|
||||
patches = prev."${name}".patches ++ getPatches name;
|
||||
lib.attrsets.mergeAttrsList (
|
||||
lib.lists.forEach programsToPatch (
|
||||
program: let
|
||||
unpatchedProgram = prev."${program}";
|
||||
in {
|
||||
"${program}" = unpatchedProgram.overrideAttrs {
|
||||
version = "${unpatchedProgram.version}-patched";
|
||||
patches = unpatchedProgram.patches ++ getPatches program;
|
||||
};
|
||||
}
|
||||
)
|
||||
removeFiles;
|
||||
)
|
||||
);
|
||||
in {
|
||||
nixpkgs.overlays = [
|
||||
(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue