From 5cb16c34a8c5b803ec723934c1dc828c0e8e3bad Mon Sep 17 00:00:00 2001 From: Chris Wells Date: Tue, 10 Sep 2024 11:52:55 -0500 Subject: Trying to get everything to actually work --- flake.lock | 12 ++--- flake.nix | 17 ++++-- kobo/clara/default.nix | 69 ++++++++++++++++++++++++ kobo/clara/screensaver.png | Bin 0 -> 2718976 bytes modules/build/default.nix | 5 ++ modules/build/firmware.nix | 60 +++++++++++++++++++++ modules/default.nix | 22 +++++--- modules/device/default.nix | 5 ++ modules/kfmon/default.nix | 43 ++++++++++----- modules/kobo/default.nix | 40 +++++++++----- modules/koboroot/default.nix | 34 ++++++++++++ modules/koreader/default.nix | 20 +++++-- modules/lib/file-type.nix | 22 ++++++-- modules/nickel/default.nix | 46 ++++++++++------ modules/plato/default.nix | 126 +++++++++++++++++++++++++++++++++---------- pkgs/firmware/default.nix | 6 +-- pkgs/kfmon/default.nix | 3 +- pkgs/koreader/default.nix | 3 +- pkgs/misc/install.nix | 10 ++++ pkgs/plato/default.nix | 3 +- 20 files changed, 436 insertions(+), 110 deletions(-) create mode 100644 kobo/clara/default.nix create mode 100644 kobo/clara/screensaver.png create mode 100644 modules/build/default.nix create mode 100644 modules/build/firmware.nix create mode 100644 modules/koboroot/default.nix create mode 100644 pkgs/misc/install.nix diff --git a/flake.lock b/flake.lock index 0a95ed0..2f70e5a 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1705608299, - "narHash": "sha256-Y//xAKx/uzpKXx8qSQfiur7rB386QJ7TVD3f0ByqJyM=", + "lastModified": 1725912799, + "narHash": "sha256-0rXs7Xs3BztGJ2WF710KPPJgqM2K7isGaw1XeH5hIKc=", "owner": "nixos", "repo": "nixpkgs", - "rev": "68d14ba2a5c54ed931222079380f96de82489895", + "rev": "0d475907c557543f9e5d36fb0cafaaedda202d2a", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 8978740..2b0e39b 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,7 @@ outputs = inputs@{ self, nixpkgs, flake-utils, ... }: { lib = import ./lib { inherit (nixpkgs) lib; }; + overlays.default = import ./overlays; } // flake-utils.lib.eachDefaultSystem (system: @@ -17,12 +18,19 @@ inherit system; overlays = builtins.attrValues self.overlays; }; - myKobo = self.lib.koboConfiguration { - inherit pkgs; - modules = [ ./config ]; - }; + # myKobo = self.lib.koboConfiguration { + # inherit pkgs; + # modules = [ ./config ]; + # }; in { + koboConfigurations = { + clara = self.lib.koboConfiguration { + inherit pkgs; + modules = [ ./kobo/clara ]; + }; + }; + packages = { inherit (pkgs) kepubify @@ -33,7 +41,6 @@ nickel-menu plato ; - default = myKobo.config.build.src; firmware-test = pkgs.kobo-firmware { hardware = "kobo7"; date = "Jun2024"; diff --git a/kobo/clara/default.nix b/kobo/clara/default.nix new file mode 100644 index 0000000..f2d026b --- /dev/null +++ b/kobo/clara/default.nix @@ -0,0 +1,69 @@ +{ config, pkgs, lib, ... }: +with builtins // lib; +{ + device = { + name = "Kobo Clara HD"; + }; + + firmware = { + version = "4.38.23038"; + date = "Jun2024"; + }; + + kobo = { + enable = true; + file = { + "screensaver/main.png".source = ./screensaver.png; + }; + }; + + plato = { + enable = true; + fonts = with pkgs; [ + fira-math + ]; + dictionaries = with pkgs.dictdDBs; [ + wordnet + wiktionary + ]; + + settings = { + keyobard-layout = "English"; + frontlight = true; + sleep-cover = true; + auto-suspend = 15.0; + auto-power-off = 4.0; + time-format = "%I:%M%P"; + reader = { + font-size = 10.0; + font-family = "Fira Math"; + }; + dictionary = { + font-size = 10.0; + }; + intermissions = rec { + suspend = "cover:"; + power-off = "${config.kobo.devicePath}/screensaver/main.png"; + share = power-off; + }; + }; + }; + + nickel = { + enable = true; + + menu.item = { + settings = [ + { + location = "main"; + label = "IP Address"; + action = "cmd_output"; + arg = [ + "500" + "/sbin/ifconfig | /usr/bin/awk '/inet addr/{print substr($2,6)}'" + ]; + } + ]; + }; + }; +} diff --git a/kobo/clara/screensaver.png b/kobo/clara/screensaver.png new file mode 100644 index 0000000..c26ab78 Binary files /dev/null and b/kobo/clara/screensaver.png differ diff --git a/modules/build/default.nix b/modules/build/default.nix new file mode 100644 index 0000000..be3f3b0 --- /dev/null +++ b/modules/build/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./firmware.nix + ]; +} diff --git a/modules/build/firmware.nix b/modules/build/firmware.nix new file mode 100644 index 0000000..673c379 --- /dev/null +++ b/modules/build/firmware.nix @@ -0,0 +1,60 @@ +{ config, pkgs, lib, ... }: +with builtins // lib; +let + cfg = config.build; +in { + options.build = { + firmware = { + checkDevice = mkOption { + internal = true; + readOnly = true; + type = types.package; + default = pkgs.writeShellApplication { + name = "check-firmware"; + runtimeInputs = with pkgs; [ + kobo-utils + ]; + text = '' + echo "hi" + ''; + }; + }; + + bundle = + let + b = pkgs.runCommandLocal "package-firmware" {} '' + cp -r "${config.firmware.package.out}" $out + tar czvf $out/KoboRoot.tgz --directory="${config.firmware.package.KoboRoot}" + ''; + in pkgs.runCommandLocal "bundle-firmware" {} '' + tar czvf $out --directory "${b}" + ''; + + + deploy = pkgs.writeShellApplication { + name = "deploy-firmware"; + runtimeInputs = with pkgs; [ + gnutar + kobo-utils + ]; + text = '' + echo "Looking for kobo" + KOBOPATH="$(kobo-find -f -w)" + + if [ -z "$KOBOPATH" ]; then + >&2 echo "Cannot locate kobo device" + exit 1 + fi + + echo "Found kobo device at $KOBOPATH" + + echo "Placing firmware on device" + + tar xzvf "${cfg.fimware.bundle}" --directory="$KOBOPATH/.kobo/" + + echo "Successfully installed kobo firmware. Please eject your device so it can install." + ''; + }; + }; + }; +} diff --git a/modules/default.nix b/modules/default.nix index 856ece0..a5c0395 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,12 +1,20 @@ { imports = [ + ./build + ./device + ./firmware + ./kfmon + ./kobo + ./koboroot + ./nickel + ./plato # ./installer.nix - ./build.nix - ./file.nix - ./manifest.nix - ./kfmon.nix - ./kobo.nix - ./koreader.nix - ./plato.nix + # ./build.nix + # ./file.nix + # ./manifest.nix + # ./kfmon.nix + # ./kobo.nix + # ./koreader.nix + # ./plato.nix ]; } diff --git a/modules/device/default.nix b/modules/device/default.nix index 22cf180..a1f80ef 100644 --- a/modules/device/default.nix +++ b/modules/device/default.nix @@ -29,6 +29,11 @@ in { type = types.enum (attrNames devices); }; + affiliate = mkOption { + type = types.enum (import ../../data/affiliates.nix); + default = "kobo"; + }; + hardware = hardware // { default = config._allDevices.${config.device.name}.hardware; }; diff --git a/modules/kfmon/default.nix b/modules/kfmon/default.nix index 8557a3e..ac20b86 100644 --- a/modules/kfmon/default.nix +++ b/modules/kfmon/default.nix @@ -26,13 +26,17 @@ in { file = mkOption { default = {}; type = types.attrsOf (types.submodule (pkgs.callPackage ../lib/file-type.nix {})); + apply = filterAttrs (_: v: v.enable); }; _allFiles = mkOption { type = types.package; internal = true; readOnly = true; - default = (pkgs.callPackage ../lib/merge-files.nix {}) (attrValues file); + default = pkgs.symlinkJoin { + name = "kfmon-files"; + paths = mapAttrsToList (v: v._package) cfg.file; + }; }; configs = mkOption { @@ -44,16 +48,27 @@ in { }; }; - config = { - kfmon.file = mapAttrs' (n: v: { - name = "kfmon-config-${n}"; - value = { - text = generators.toINI {} v; - target = - let - fixedN = if isSuffix ".ini" n then n else "${n}.ini"; - in "config/${fixedN}"; - }; - }); - }; -}; + config = mkMerge [ + { + kfmon.file = mapAttrs' (n: v: { + name = "kfmon-config-${n}"; + value = { + text = generators.toINI {} v; + target = + let + fixedN = if isSuffix ".ini" n then n else "${n}.ini"; + in "config/${fixedN}"; + }; + }); + } + (mkIf cfg.enable { + koboroot.include = [ + (pkgs.linkFarm [{ + name = cfg.devicePath; + path = cfg._allFiles; + }]) + cfg.package.KoboRoot + ]; + }) + ]; +} diff --git a/modules/kobo/default.nix b/modules/kobo/default.nix index 47dfe91..cdf9728 100644 --- a/modules/kobo/default.nix +++ b/modules/kobo/default.nix @@ -18,19 +18,23 @@ in { type = types.str; readOnly = true; internal = true; - deafault = "/mnt/onboard/${cfg.path}"; + default = "/mnt/onboard/${cfg.path}"; }; 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.callPackage ../lib/merge-files.nix {}) (attrValues cfg.file); + default = pkgs.symlinkJoin { + name = "kobo-files"; + paths = mapAttrsToList (v: v._package) cfg.file; + }; }; conf = mkOption { @@ -40,19 +44,27 @@ in { }; }; - config = { - kobo = { - conf = { - FeatureSettings.ExcludeSyncFolders = ''(\.(?!kobo|adobe).+|([^.][^/]*/)+\..+)''; - ApplicationPreferences = { - SideloadedMode = true; - QuickTourShown = true; + config = mkMerge [ + { + kobo = { + conf = { + FeatureSettings.ExcludeSyncFolders = ''(\.(?!kobo|adobe).+|([^.][^/]*/)+\..+)''; + ApplicationPreferences = { + SideloadedMode = true; + QuickTourShown = true; + }; }; - }; - file = mkIf (cfg.conf != {}) { - "Kobo eReader.conf".text = generators.toINI {} cfg.conf; + file = mkIf (cfg.conf != {}) { + "Kobo eReader.conf".text = generators.toINI {} cfg.conf; + }; }; - }; - }; + } + (mkIf cfg.enable { + koboroot.include = singleton (pkgs.linkFarm [{ + name = cfg.devicePath; + path = cfg._allFiles; + }]); + }) + ]; } diff --git a/modules/koboroot/default.nix b/modules/koboroot/default.nix new file mode 100644 index 0000000..308ac6b --- /dev/null +++ b/modules/koboroot/default.nix @@ -0,0 +1,34 @@ +{ config, pkgs, lib, ... }: +with builtins // lib; +let + cfg = config.koboroot; +in { + options.koboroot = { + file = mkOption { + default = {}; + type = types.attrsOf (types.submodule (pkgs.callPackage ../lib/file-type.nix {})); + apply = filterAttrs (_: v: v.enable); + }; + + include = mkOption { + default = []; + type = with types; listOf path; + }; + + _allFiles = mkOption { + type = types.package; + readOnly = true; + internal = true; + default = pkgs.buildEnv { + name = "koboroot-files"; + paths = cfg.include; + }; + }; + }; + + config = { + koboroot = { + include = mkBefore (mapAttrsToList (_: v: v._package)); + }; + }; +} diff --git a/modules/koreader/default.nix b/modules/koreader/default.nix index db12219..3cc5281 100644 --- a/modules/koreader/default.nix +++ b/modules/koreader/default.nix @@ -12,9 +12,10 @@ in { type = types.package; readOnly = true; internal = true; - default = (pkgs.callPackage ../lib/merge-files.nix {}) ([ - cfg.package - ] ++ attrValues cfg.file); + default = pkgs.symlinkJoin { + name = "koreader-files"; + paths = mapAttrsToList (_: v: v._package) cfg.file ++ [ cfg.package ]; + }; }; path = mkOption { @@ -34,6 +35,7 @@ in { file = mkOption { default = {}; type = types.attrsOf (types.submodule (pkgs.callPackage ../lib/file-type.nix {})); + apply = filterAttrs (_: v: v.enable); }; nickel = { @@ -41,8 +43,16 @@ in { }; }; - config = { - nickel.menu.item = mkIf (cfg.enable && cfg.nickel.enable) { + config = mkIf cfg.enable { + koboroot.include = [ + (pkgs.linkFarm [{ + name = cfg.devicePath; + path = cfg._allFiles; + }) + cfg.package.KoboRoot + ]; + + nickel.menu.item = mkIf cfg.nickel.enable { koreader = singleton { location = "main"; label = "KOReader"; diff --git a/modules/lib/file-type.nix b/modules/lib/file-type.nix index c95c0d4..f02daa1 100644 --- a/modules/lib/file-type.nix +++ b/modules/lib/file-type.nix @@ -1,4 +1,4 @@ -{ writeTextFile, lib, ... }: +{ writeTextFile, linkFarm, lib, ... }: { name, config, ... }: with builtins // lib; let @@ -6,7 +6,7 @@ let let safeChars = [ "+" "." "_" "?" "=" ] ++ lowerChars ++ upperChars ++ stringToCharacters "0123456789"; empties = l: genList (_: "") (length l); - unsafeInName = stringToCharacters (replaceStrings safeChars (empties safeChars) p; + unsafeInName = stringToCharacters (replaceStrings safeChars (empties safeChars) p); in "kobo_" + replaceStrings unsafeInName (empties unsafeInName) p; in { options = { @@ -17,7 +17,7 @@ in { target = mkOption { type = types.str; default = name; - apply = x: if isPrefix "/" x then x else "/${x}"; + apply = x: if hasPrefix "/" x then x else "/${x}"; }; executable = mkOption { type = with types; nullOr bool; @@ -30,12 +30,24 @@ in { source = mkOption { type = types.path; }; + _package = mkOption { + type = types.path; + readOnly = true; + internal = true; + default = linkFarm (sanitize name) [{ + name = removePrefix "/" config.target; + # let + # t = config.target; + # in if + path = config.source; + }]; + }; }; config = { - source = mkIf (cfg.text != null) (mkDefault (writeTextFile { + source = mkIf (config.text != null) (mkDefault (writeTextFile { inherit (config) text; - name = sanitieze name; + name = sanitize name; executable = config.executable == true; })); }; diff --git a/modules/nickel/default.nix b/modules/nickel/default.nix index c5736f0..30b40d4 100644 --- a/modules/nickel/default.nix +++ b/modules/nickel/default.nix @@ -57,7 +57,10 @@ in { type = types.package; readOnly = true; internal = true; - default = (pkgs.callPackage ../lib/merge-files.nix {}) (atrValues cfg.file); + default = symlinkJoin { + name = "nickel-files"; + paths = mapAttrsToList (v: v._package) cfg.file; + }; }; path = mkOption { @@ -77,7 +80,8 @@ in { file = mkOption { default = {}; - type = types.attrsOf (types.submodule (pkgs.callPackage ../lib/file-type.nix {}); + type = types.attrsOf (types.submodule (pkgs.callPackage ../lib/file-type.nix {})); + apply = filterAttrs (_: v: v.enable); }; menu = { @@ -133,21 +137,29 @@ in { }; }; - config = { - nickel = { - file = mkMerge [ - (mapAttrs (_: v: { - text = concatMapStringsSep "\n" createGenerator v; - }) cfg.menu.generator) + config = mkMerge [ + { + nickel = { + file = mkMerge [ + (mapAttrs (_: v: { + text = concatMapStringsSep "\n" createGenerator v; + }) cfg.menu.generator) - (mapAttrs (_: v: { - text = concatStringsSep "\n" (mapAttrsToList createExperimental v); - }) cfg.menu.experimental) + (mapAttrs (_: v: { + text = concatStringsSep "\n" (mapAttrsToList createExperimental v); + }) cfg.menu.experimental) - (mapAttrs (_: v: { - text = concatMapStringsSep "\n" createMenuItem v; - }) cfg.menu.item) - ]; - }; - }; + (mapAttrs (_: v: { + text = concatMapStringsSep "\n" createMenuItem v; + }) cfg.menu.item) + ]; + }; + } + (mkIf cfg.enable { + koboroot.include = singleton (pkgs.linkFarm [{ + name = cfg.devicePath; + path = cfg._allFiles; + }]); + }) + ]; } diff --git a/modules/plato/default.nix b/modules/plato/default.nix index 1886662..ac0c5d7 100644 --- a/modules/plato/default.nix +++ b/modules/plato/default.nix @@ -10,6 +10,26 @@ in { package = mkPackageOption pkgs "plato" {}; + # _unpackage = mkOption { + # type = types.package; + # readOnly = true; + # internal = true; + # default = pkgs.buildEnv { + # name = "plato-unpackage"; + # paths = [ + # (pkgs.runCommandLocal "plato-files" {} '' + # mkdir -p "$out${cfg.devicePath}" + # cp -r "${cfg.package.out}/" $out${cfg.devicePath} + # '') + # # (pkgs.linkFarm "plato-files" [{ + # # name = removePrefix "/" cfg.devicePath; + # # path = cfg.package.out; + # # }]) + # cfg.package.KoboRoot + # ]; + # }; + # }; + path = mkOption { type = types.str; readOnly = true; @@ -24,18 +44,52 @@ in { default = "/mnt/onboard/${cfg.path}"; }; + _createdFiles = mkOption { + type = types.package; + internal = true; + readOnly = true; + default = pkgs.buildEnv { + name = "plato-files-created"; + paths = mapAttrsToList (_: v: v._package) cfg.file; + extraPrefix = cfg.devicePath; + }; + }; + + _finalPackage = mkOption { + type = types.package; + internal = true; + readOnly = true; + default = pkgs.symlinkJoin { + name = "plato-package"; + paths = [ + cfg._createdFiles + # (pkgs.linkFarm "plato-files" [{ + # name = removePrefix "/" cfg.devicePath; + # path = cfg.package.out; + # }]) + (pkgs.runCommandLocal "plato-files" {} '' + mkdir -p "$(dirname "$out${cfg.devicePath}")" + cp -r "${cfg.package.out}" "$out${cfg.devicePath}" + '') + cfg.package.KoboRoot + ]; + }; + }; + _allFiles = mkOption { type = types.package; readOnly = true; internal = true; - default = (pkgs.callPackage ../lib/merge-files.nix {}) ([ - cfg.package - ] ++ attrValues cfg.file); + default = pkgs.symlinkJoin { + name = "plato-files"; + paths = mapAttrsToList (_: v: v._package) cfg.file ++ [ cfg.package ]; + }; }; file = mkOption { default = {}; type = types.attrsOf (types.submodule (pkgs.callPackage ../lib/file-type.nix {})); + apply = filterAttrs (_: v: v.enable); }; nickel = { @@ -51,15 +105,23 @@ in { ''; }; - config = { - hyphenation = mkEnableOption "hyphenation" // { default = true; }; - convertDictionaries = mkEnableOption "convert StartDict" // { default = true; }; - setFramebufferDepth = mkEnableOption "set framebuffer's depth" // { default = true; }; - extra = mkOption { - type = types.lines; - default = ""; - }; + config = mkOption { + type = types.lines; + default = ""; + description = '' + Contents of config.sh + ''; }; + + # config = { + # hyphenation = mkEnableOption "hyphenation" // { default = true; }; + # convertDictionaries = mkEnableOption "convert StartDict" // { default = true; }; + # setFramebufferDepth = mkEnableOption "set framebuffer's depth" // { default = true; }; + # extra = mkOption { + # type = types.lines; + # default = ""; + # }; + # }; # mkOption { # type = types.lines; # default = ""; @@ -100,9 +162,9 @@ in { default = let copyFonts = pkg: '' - find ${pkg}/share/fonts/truetype/ -type f -regex '.*\.\(ttf\|otf\)' -exec cp -v {} $out/ \; + find ${pkg}/share/fonts/ -type f -regex '.*\.\(ttf\|otf\)' -exec cp -v {} $out/ \; ''; - in pkgs.runCommandLocal {} '' + in pkgs.runCommandLocal "plato-fonts" {} '' mkdir $out ${concatMapStringsSep "\n" copyFonts cfg.fonts} ''; @@ -116,17 +178,21 @@ in { source = toml.generate "Settings.toml" cfg.settings; }; - "config.sh" = - let - c = optional (!cfg.config.convertDictionaries) "unset PLATO_CONVERT_DICTIONARIES" - ++ optional (!cfg.config.setFramebufferDepth) "unset PLATO_SET_FRAMEBUFFER_DEPTH" - ++ optional (!cfg.config.hyphenation) "[ -d hyphenation-patters ] && rm -rf hyphenation-patterns" - ++ optional (cfg.config.extra != "") cfg.config.extra - ; - in mkIf (c != []) { - text = concatStringsSep "\n\n" c; + "config.sh" = mkIf (cfg.config != "") { + text = cfg.config; }; + # "config.sh" = + # let + # c = optional (!cfg.config.convertDictionaries) "unset PLATO_CONVERT_DICTIONARIES" + # ++ optional (!cfg.config.setFramebufferDepth) "unset PLATO_SET_FRAMEBUFFER_DEPTH" + # ++ optional (!cfg.config.hyphenation) "[ -d hyphenation-patters ] && rm -rf hyphenation-patterns" + # ++ optional (cfg.config.extra != "") cfg.config.extra + # ; + # in mkIf (c != []) { + # text = concatStringsSep "\n\n" c; + # }; + "_dictionaries" = { target = "dictionaries"; source = cfg._dictionariesCombined; @@ -137,8 +203,15 @@ in { source = cfg._fontsCombined; }; }; - - nickel.menu.item = mkIf (cfg.enable && cfg.nickel.enable) { + } + (mkIf cfg.enable { + koboroot.include = singleton cfg._finalPackage; + # singleton (pkgs.linkFarm [{ + # name = cfg.devicePath; + # path = cfg._allFiles; + # }]); + + nickel.menu.item = mkIf cfg.nickel.enable { plato = singleton { location = "main"; label = "Plato"; @@ -149,10 +222,7 @@ in { ]; }; }; - } - # (mkIf (cfg.enable && cfg.nickelEntry.enable { - # nickel.menu.item = - # }) + }) ]; } diff --git a/pkgs/firmware/default.nix b/pkgs/firmware/default.nix index 9c70eb1..8403abb 100644 --- a/pkgs/firmware/default.nix +++ b/pkgs/firmware/default.nix @@ -39,10 +39,10 @@ stdenvNoCC.mkDerivation (finalAttrs: { installPhase = '' runHook preInstall - mkdir $out - cp -r $src/{manifest.md5sum,upgrade} $out/ + cp -r $src $out + rm $out/KoboRoot.tgz - mkdir $KoboRoot + mkdir $KoboROot tar xvzf $src/KoboRoot.tgz --directory=$KoboRoot runHook postInstall diff --git a/pkgs/kfmon/default.nix b/pkgs/kfmon/default.nix index 371c90f..20addac 100644 --- a/pkgs/kfmon/default.nix +++ b/pkgs/kfmon/default.nix @@ -12,7 +12,6 @@ stdenvNoCC.mkDerivation (finalAttrs: { outputs = [ "out" "KoboRoot" - "png" ]; phases = "installPhase"; @@ -26,7 +25,7 @@ stdenvNoCC.mkDerivation (finalAttrs: { mkdir $KoboRoot tar xvzf $src/.kobo/KoboRoot.tgz --directory=$KoboRoot - cp $src/kfmon.png $png + install -D -t $KoboRoot/mnt/onboard $src/kfmon.png runHook postInstall ''; diff --git a/pkgs/koreader/default.nix b/pkgs/koreader/default.nix index 3f185b7..9427fe1 100644 --- a/pkgs/koreader/default.nix +++ b/pkgs/koreader/default.nix @@ -12,7 +12,6 @@ stdenvNoCC.mkDerivation (finalAttrs: { outputs = [ "out" "KoboRoot" - "png" ]; phases = "installPhase"; @@ -24,7 +23,7 @@ stdenvNoCC.mkDerivation (finalAttrs: { mkdir $KoboRoot - cp $src/koreader.png $png + install -D -t $KoboRoot/mnt/onboard $src/koreader.png runHook postInstall ''; diff --git a/pkgs/misc/install.nix b/pkgs/misc/install.nix new file mode 100644 index 0000000..ef5dd86 --- /dev/null +++ b/pkgs/misc/install.nix @@ -0,0 +1,10 @@ +{ writeShellApplication, kobo-utils, ... }: +writeShellApplication { + name = "kobo-install"; + runtimeInputs = [ + kobo-utils + ]; + text = '' + echo "hi" + ''; +} diff --git a/pkgs/plato/default.nix b/pkgs/plato/default.nix index 548363b..6246f2b 100644 --- a/pkgs/plato/default.nix +++ b/pkgs/plato/default.nix @@ -22,7 +22,6 @@ stdenvNoCC.mkDerivation (finalAttrs: { outputs = [ "out" "KoboRoot" - "png" ]; phases = "installPhase"; @@ -34,7 +33,7 @@ stdenvNoCC.mkDerivation (finalAttrs: { mkdir $KoboRoot - cp $picSrc/artworks/plato.png $png + install -D -t $KoboRoot/mnt/onboard $picSrc/artworks/plato.png runHook postInstall ''; -- cgit v1.2.3