aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/device/default.nix41
-rw-r--r--modules/firmware/default.nix12
-rw-r--r--modules/kobo/default.nix5
3 files changed, 50 insertions, 8 deletions
diff --git a/modules/device/default.nix b/modules/device/default.nix
new file mode 100644
index 0000000..22cf180
--- /dev/null
+++ b/modules/device/default.nix
@@ -0,0 +1,41 @@
+{ config, pkgs, lib, ... }:
+with builtins // lib;
+let
+ devices = import ../../data/devices.nix;
+
+ hardware = mkOption {
+ type = types.strMatching ''^kobo\d+$'';
+ };
+ deviceID = mkOption {
+ type = types.strMatching ''00000000-0000-0000-0000-000000000\d\d\d'';
+ };
+
+ deviceInfo = types.submodule {
+ options = {
+ inherit hardware deviceID;
+ };
+ };
+in {
+ options = {
+ _allDevices = mkOption {
+ default = devices;
+ readOnly = true;
+ internal = true;
+ type = types.attrsOf deviceInfo;
+ };
+
+ device = {
+ name = mkOption {
+ type = types.enum (attrNames devices);
+ };
+
+ hardware = hardware // {
+ default = config._allDevices.${config.device.name}.hardware;
+ };
+
+ deviceID = deviceID // {
+ default = config._allDevices.${config.device.name}.deviceID;
+ };
+ };
+ };
+}
diff --git a/modules/firmware/default.nix b/modules/firmware/default.nix
index 609212a..30a0779 100644
--- a/modules/firmware/default.nix
+++ b/modules/firmware/default.nix
@@ -4,23 +4,21 @@ let
cfg = config.firmware;
in {
options.firmware = {
- hardware = mkOption {
- type = types.str;
- };
date = mkOption {
type = types.str;
};
version = mkOption {
type = types.str;
};
- hash = mkOption {
- type = types.str;
- };
+ # hash = mkOption {
+ # type = types.str;
+ # };
package = mkOption {
type = types.package;
default = pkgs.kobo-firmware {
- inherit (cfg) hardware date version hash;
+ inherit (config.device) hardware;
+ inherit (cfg) date version;
};
};
};
diff --git a/modules/kobo/default.nix b/modules/kobo/default.nix
index 29ed213..47dfe91 100644
--- a/modules/kobo/default.nix
+++ b/modules/kobo/default.nix
@@ -44,7 +44,10 @@ in {
kobo = {
conf = {
FeatureSettings.ExcludeSyncFolders = ''(\.(?!kobo|adobe).+|([^.][^/]*/)+\..+)'';
- ApplicationPreferences.QuickTourShown = true;
+ ApplicationPreferences = {
+ SideloadedMode = true;
+ QuickTourShown = true;
+ };
};
file = mkIf (cfg.conf != {}) {