summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorElis Hirwing <elis@hirwing.se>2019-10-20 21:20:53 +0200
committerElis Hirwing <elis@hirwing.se>2019-10-20 21:20:53 +0200
commit9319dd17d8037d7d56922617ff952ef9b2d4d61c (patch)
treea7853619ed5e651ab373f4df3a7cdef0c3122871 /nixos
parentbd42bcd2404245f926089069a07268e594ff50af (diff)
downloadnixpkgs-9319dd17d8037d7d56922617ff952ef9b2d4d61c.tar
nixpkgs-9319dd17d8037d7d56922617ff952ef9b2d4d61c.tar.gz
nixpkgs-9319dd17d8037d7d56922617ff952ef9b2d4d61c.tar.bz2
nixpkgs-9319dd17d8037d7d56922617ff952ef9b2d4d61c.tar.lz
nixpkgs-9319dd17d8037d7d56922617ff952ef9b2d4d61c.tar.xz
nixpkgs-9319dd17d8037d7d56922617ff952ef9b2d4d61c.tar.zst
nixpkgs-9319dd17d8037d7d56922617ff952ef9b2d4d61c.zip
nixos/lidarr: Add dataDir option
This will bring this module to a state to be consistent with how the
other forks (sonarr & radarr) works.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/misc/lidarr.nix15
1 files changed, 11 insertions, 4 deletions
diff --git a/nixos/modules/services/misc/lidarr.nix b/nixos/modules/services/misc/lidarr.nix
index 40755c16217..8ff1adadcf2 100644
--- a/nixos/modules/services/misc/lidarr.nix
+++ b/nixos/modules/services/misc/lidarr.nix
@@ -10,6 +10,12 @@ in
     services.lidarr = {
       enable = mkEnableOption "Lidarr";
 
+      dataDir = mkOption {
+        type = types.str;
+        default = "/var/lib/lidarr/.config/Lidarr";
+        description = "The directory where Lidarr stores its data files.";
+      };
+
       package = mkOption {
         type = types.package;
         default = pkgs.lidarr;
@@ -44,6 +50,10 @@ in
   };
 
   config = mkIf cfg.enable {
+    systemd.tmpfiles.rules = [
+      "d '${cfg.dataDir}' 0700 ${cfg.user} ${cfg.group} - -"
+    ];
+
     systemd.services.lidarr = {
       description = "Lidarr";
       after = [ "network.target" ];
@@ -53,11 +63,8 @@ in
         Type = "simple";
         User = cfg.user;
         Group = cfg.group;
-        ExecStart = "${cfg.package}/bin/Lidarr";
+        ExecStart = "${cfg.package}/bin/Lidarr -nobrowser -data='${cfg.dataDir}'";
         Restart = "on-failure";
-
-        StateDirectory = "lidarr";
-        StateDirectoryMode = "0770";
       };
     };