aboutsummaryrefslogtreecommitdiff
path: root/modules/kobo
diff options
context:
space:
mode:
Diffstat (limited to 'modules/kobo')
-rw-r--r--modules/kobo/default.nix52
1 files changed, 37 insertions, 15 deletions
diff --git a/modules/kobo/default.nix b/modules/kobo/default.nix
index cdf9728..48bca11 100644
--- a/modules/kobo/default.nix
+++ b/modules/kobo/default.nix
@@ -21,22 +21,45 @@ in {
default = "/mnt/onboard/${cfg.path}";
};
- file = mkOption {
- default = {};
- type = types.attrsOf (types.submodule (pkgs.callPackage ../lib/file-type.nix {}));
- apply = filterAttrs (_: v: v.enable);
+ _createdFiles = mkOption {
+ type = types.package;
+ internal = true;
+ readOnly = true;
+ default = pkgs.buildEnv {
+ name = "kobo-files-created";
+ paths = mapAttrsToList (_: v: v._package) cfg.file;
+ extraPrefix = cfg.devicePath;
+ };
};
- _allFiles = mkOption {
+ finalPackage = mkOption {
type = types.package;
- readOnly = true;
internal = true;
- default = pkgs.symlinkJoin {
- name = "kobo-files";
- paths = mapAttrsToList (v: v._package) cfg.file;
+ readOnly = true;
+ default = pkgs.mergePaths {
+ name = "kobo-package";
+ paths = [
+ cfg._createdFiles
+ ];
};
};
+ file = mkOption {
+ default = {};
+ type = types.attrsOf (types.submodule (pkgs.callPackage ../lib/file-type.nix {}));
+ apply = filterAttrs (_: v: v.enable);
+ };
+
+ # _allFiles = mkOption {
+ # type = types.package;
+ # readOnly = true;
+ # internal = true;
+ # default = pkgs.symlinkJoin {
+ # name = "kobo-files";
+ # paths = mapAttrsToList (v: v._package) cfg.file;
+ # };
+ # };
+
conf = mkOption {
type = ini.type;
default = {};
@@ -55,16 +78,15 @@ in {
};
};
- file = mkIf (cfg.conf != {}) {
- "Kobo eReader.conf".text = generators.toINI {} cfg.conf;
+ file = {
+ "Kobo eReader.conf" = mkIf (cfg.conf != {}) {
+ text = generators.toINI {} cfg.conf;
+ };
};
};
}
(mkIf cfg.enable {
- koboroot.include = singleton (pkgs.linkFarm [{
- name = cfg.devicePath;
- path = cfg._allFiles;
- }]);
+ koboroot.include = singleton cfg.finalPackage;
})
];
}