From b87ced9a95fd0de4e3631e67cc5a7a929adee464 Mon Sep 17 00:00:00 2001 From: Chris Wells Date: Wed, 28 Oct 2026 11:49:51 -0400 Subject: Working concept with an instance for my pocketbook --- modules/main.nix | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'modules/main.nix') diff --git a/modules/main.nix b/modules/main.nix index b568efa..974f599 100644 --- a/modules/main.nix +++ b/modules/main.nix @@ -17,32 +17,49 @@ with builtins // lib; with types; nullOr <| enum [ + "raw" "kobo" "pocketbook" ]; default = null; }; basePackage = mkOption { - type = types.package; + type = types.path; }; koreaderPath = mkOption { type = types.str; }; + finalPackage = mkOption { + type = types.package; + readOnly = true; + default = pkgs.runCommandLocal "merge" { nativeBuildInputs = [ pkgs.rsync ]; } '' + RSYNC="rsync -a --copy-links -v" + + $RSYNC "${config.koreader.basePackage}/" "$out/" + $RSYNC "${config._files}/" "$out/${config.koreaderPath}/" + ''; + }; }; }; config = mkMerge [ (mkIf (config.koreader.flavor == "kobo") { koreader = { - basePackage = mkOptionDefault pkgs.koreader-kobo; + basePackage = mkOptionDefault <| pkgs.callPackage ../pkgs/kobo.nix { }; koreaderPath = mkOptionDefault ".adds/koreader"; }; }) (mkIf (config.koreader.flavor == "pocketbook") { koreader = { - basePackage = mkOptionDefault pkgs.koreader-pocketbook; + basePackage = mkOptionDefault <| pkgs.callPackage ../pkgs/pocketbook.nix { }; koreaderPath = mkOptionDefault "applications/koreader"; }; }) + (mkIf (config.koreader.flavor == "raw") { + koreader = { + basePackage = mkOptionDefault <| pkgs.runCommandLocal "raw" { } "mkdir $out"; + koreaderPath = mkOptionDefault ""; + }; + }) ]; } -- cgit v1.3.1