diff --git a/hosts/tilo/configuration.nix b/hosts/tilo/configuration.nix index 86059bb..8848644 100644 --- a/hosts/tilo/configuration.nix +++ b/hosts/tilo/configuration.nix @@ -38,6 +38,7 @@ trusted-users = ["root" "phundrak"]; }; services = { + calibre.enable = true; endlessh.enable = true; plex = { enable = true; diff --git a/system/services/calibre.nix b/system/services/calibre.nix new file mode 100644 index 0000000..e891915 --- /dev/null +++ b/system/services/calibre.nix @@ -0,0 +1,38 @@ +{ + config, + lib, + ... +}: +with lib; let + cfg = config.system.services.calibre; +in { + options.system.services.calibre = { + enable = mkEnableOption "Enable Calibre Web"; + user = mkOption { + type = types.string; + default = "phundrak"; + }; + group = mkOption { + type = types.string; + default = "users"; + }; + dataDir = mkOption { + type = types.string; + example = "/tank/calibre/conf"; + default = "/tank/calibre/conf"; + }; + library = mkOption { + type = types.string; + example = "/tank/calibre/library"; + default = "/tank/calibre/library"; + }; + }; + config.services.calibre-web = mkIf cfg.enable { + inherit (cfg) enable user group dataDir; + options = { + calibreLibrary = cfg.library; + enableBookConversion = true; + enableBookUploading = true; + }; + }; +} diff --git a/system/services/default.nix b/system/services/default.nix index 772d7bc..7db36a3 100644 --- a/system/services/default.nix +++ b/system/services/default.nix @@ -1,5 +1,6 @@ { imports = [ + ./calibre.nix ./endlessh.nix ./fwupd.nix ./plex.nix