diff options
| author | Chris Wells <chris@mathematicaster.org> | 2024-09-10 14:51:28 -0500 |
|---|---|---|
| committer | Chris Wells <chris@mathematicaster.org> | 2024-09-10 14:51:28 -0500 |
| commit | 4f471484b3a1e16230979a8406503a220b9101f4 (patch) | |
| tree | dc3f5256f275f34d3bcc9573462ed34c7fd97f77 /modules/kobo/default.nix | |
| parent | 5cb16c34a8c5b803ec723934c1dc828c0e8e3bad (diff) | |
| download | kobo-manager-4f471484b3a1e16230979a8406503a220b9101f4.tar kobo-manager-4f471484b3a1e16230979a8406503a220b9101f4.tar.gz kobo-manager-4f471484b3a1e16230979a8406503a220b9101f4.tar.bz2 kobo-manager-4f471484b3a1e16230979a8406503a220b9101f4.tar.lz kobo-manager-4f471484b3a1e16230979a8406503a220b9101f4.tar.xz kobo-manager-4f471484b3a1e16230979a8406503a220b9101f4.tar.zst kobo-manager-4f471484b3a1e16230979a8406503a220b9101f4.zip | |
I think this is almost working!
Diffstat (limited to 'modules/kobo/default.nix')
| -rw-r--r-- | modules/kobo/default.nix | 52 |
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; }) ]; } |
