summaryrefslogtreecommitdiff
path: root/modules/files.nix
diff options
context:
space:
mode:
authorChris Wells <chris@mathematicaster.org>2026-10-28 11:49:51 -0400
committerChris Wells <chris@mathematicaster.org>2026-10-28 11:49:51 -0400
commitb87ced9a95fd0de4e3631e67cc5a7a929adee464 (patch)
tree3f02b2679ba3397fbbc5b172cfa613b2f6c93134 /modules/files.nix
parentf9bdbf51aa61503d77e387095e7a4e1f34acdde3 (diff)
downloadko-manager-b87ced9a95fd0de4e3631e67cc5a7a929adee464.tar
ko-manager-b87ced9a95fd0de4e3631e67cc5a7a929adee464.tar.gz
ko-manager-b87ced9a95fd0de4e3631e67cc5a7a929adee464.tar.bz2
ko-manager-b87ced9a95fd0de4e3631e67cc5a7a929adee464.tar.lz
ko-manager-b87ced9a95fd0de4e3631e67cc5a7a929adee464.tar.xz
ko-manager-b87ced9a95fd0de4e3631e67cc5a7a929adee464.tar.zst
ko-manager-b87ced9a95fd0de4e3631e67cc5a7a929adee464.zip
Working concept with an instance for my pocketbook
Diffstat (limited to 'modules/files.nix')
-rw-r--r--modules/files.nix41
1 files changed, 31 insertions, 10 deletions
diff --git a/modules/files.nix b/modules/files.nix
index dbd9c6b..14b5319 100644
--- a/modules/files.nix
+++ b/modules/files.nix
@@ -49,12 +49,13 @@ with builtins // lib;
internal = true;
default =
pkgs.linkFarm "files"
- <| flip mapAttrsToList config.files (
+ <| mapAttrsToList (
_: { destination, source, ... }: {
name = destination;
path = source;
}
- );
+ )
+ <| filterAttrs (_: v: v.enable) config.files;
};
dictionaries = mkOption {
@@ -76,6 +77,10 @@ with builtins // lib;
default = { };
type = with types; attrsOf path;
};
+
+ patchDirectories = mkOption {
+ type = with types; listOf path;
+ };
};
config = {
@@ -107,15 +112,31 @@ with builtins // lib;
};
}
))
- (flip mapAttrs' config.patches (
- name: source: {
- name = "patch::${name}";
- value = {
- destination = "patches/${name}";
- inherit source;
+ (mkIf (config.patchDirectories != [ ]) {
+ "patches" = {
+ source = pkgs.symlinkJoin {
+ name = "patches";
+ paths = config.patchDirectories;
};
- }
- ))
+ };
+ })
+ # (flip mapAttrs' config.patches (
+ # name: source: {
+ # name = "patch::${name}";
+ # value = {
+ # destination = "patches/${name}";
+ # inherit source;
+ # };
+ # }
+ # ))
];
+
+ patchDirectories = mkIf (config.patches != { }) [
+ (
+ pkgs.linkFarm "individual-patches"
+ <| mapAttrsToList (name: path: { inherit name path; }) config.patches
+ )
+ ];
+
};
}