diff options
author | Felix Buehler | 2024-08-24 22:05:45 +0200 |
---|---|---|
committer | Felix Buehler | 2024-08-30 23:00:51 +0200 |
commit | 2fbd3330750d052b9a8643e4e3567bd5c1e79bee (patch) | |
tree | 8c7081a0a49a2f3c8e125e97c09de21e26fce264 /nixos | |
parent | a442c73bff962d2468f79d14324eb581e19cd26e (diff) |
nixos/services.jackett: remove `with lib;`
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/misc/jackett.nix | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/nixos/modules/services/misc/jackett.nix b/nixos/modules/services/misc/jackett.nix index a843f400b031..cbac537a58b5 100644 --- a/nixos/modules/services/misc/jackett.nix +++ b/nixos/modules/services/misc/jackett.nix @@ -1,7 +1,4 @@ { config, pkgs, lib, ... }: - -with lib; - let cfg = config.services.jackett; @@ -9,45 +6,45 @@ in { options = { services.jackett = { - enable = mkEnableOption "Jackett, API support for your favorite torrent trackers"; + enable = lib.mkEnableOption "Jackett, API support for your favorite torrent trackers"; - port = mkOption { + port = lib.mkOption { default = 9117; - type = types.port; + type = lib.types.port; description = '' Port serving the web interface ''; }; - dataDir = mkOption { - type = types.str; + dataDir = lib.mkOption { + type = lib.types.str; default = "/var/lib/jackett/.config/Jackett"; description = "The directory where Jackett stores its data files."; }; - openFirewall = mkOption { - type = types.bool; + openFirewall = lib.mkOption { + type = lib.types.bool; default = false; description = "Open ports in the firewall for the Jackett web interface."; }; - user = mkOption { - type = types.str; + user = lib.mkOption { + type = lib.types.str; default = "jackett"; description = "User account under which Jackett runs."; }; - group = mkOption { - type = types.str; + group = lib.mkOption { + type = lib.types.str; default = "jackett"; description = "Group under which Jackett runs."; }; - package = mkPackageOption pkgs "jackett" { }; + package = lib.mkPackageOption pkgs "jackett" { }; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { systemd.tmpfiles.rules = [ "d '${cfg.dataDir}' 0700 ${cfg.user} ${cfg.group} - -" ]; @@ -66,11 +63,11 @@ in }; }; - networking.firewall = mkIf cfg.openFirewall { + networking.firewall = lib.mkIf cfg.openFirewall { allowedTCPPorts = [ cfg.port ]; }; - users.users = mkIf (cfg.user == "jackett") { + users.users = lib.mkIf (cfg.user == "jackett") { jackett = { group = cfg.group; home = cfg.dataDir; @@ -78,7 +75,7 @@ in }; }; - users.groups = mkIf (cfg.group == "jackett") { + users.groups = lib.mkIf (cfg.group == "jackett") { jackett.gid = config.ids.gids.jackett; }; }; |