Skip to content

Commit

Permalink
Fixed prowlarr/cross-seed groups
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmus-kirk committed Mar 1, 2024
1 parent d396bd3 commit a3ddf00
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
2 changes: 0 additions & 2 deletions nixarr/prowlarr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ in {
"d '${cfg.stateDir}' 0700 prowlarr root - -"
];

users.groups.prowlarr = {};

util-nixarr.services.prowlarr = {
enable = true;
dataDir = cfg.stateDir;
Expand Down
4 changes: 3 additions & 1 deletion nixarr/prowlarr/prowlarr-module/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ in {
};
};

users.groups = mkIf (cfg.group == "prowlarr") {};
users.groups = mkIf (cfg.group == "prowlarr") {
prowlarr = { };
};
};
}
25 changes: 14 additions & 11 deletions nixarr/transmission/cross-seed/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
}:
with lib; let
cfg = config.util-nixarr.services.cross-seed;
settingsFormat = pkgs.formats.json {};
settingsFile = settingsFormat.generate "settings.json" cfg.settings;
cross-seedPkg = import ../../../pkgs/cross-seed { inherit (pkgs) stdenv lib fetchFromGitHub; };
#settingsFormat = pkgs.formats.json {};
#settingsFile = settingsFormat.generate "settings.json" cfg.settings;
#cross-seedPkg = import ../../../pkgs/cross-seed { inherit (pkgs) stdenv lib fetchFromGitHub; };
in {
options = {
util-nixarr.services.cross-seed = {
Expand Down Expand Up @@ -61,19 +61,20 @@ in {
after = ["network.target"];
wantedBy = ["multi-user.target"];

environment.CONFIG_DIR = cfg.dataDir;
#environment.CONFIG_DIR = cfg.dataDir;

serviceConfig = {
# Run as root in case that the cfg.credentialsFile is not readable by cross-seed
ExecStartPre = [("+" + pkgs.writeShellScript "transmission-prestart" ''
${pkgs.jq}/bin/jq --slurp add ${settingsFile} '${cfg.credentialsFile}' |
install -D -m 600 -o '${cfg.user}' /dev/stdin '${cfg.dataDir}/config.json'
''
)];
#ExecStartPre = [("+" + pkgs.writeShellScript "transmission-prestart" ''
# ${pkgs.jq}/bin/jq --slurp add ${settingsFile} '${cfg.credentialsFile}' |
# install -D -m 600 -o '${cfg.user}' /dev/stdin '${cfg.dataDir}/config.json'
#''
#)];
Type = "simple";
User = cfg.user;
Group = cfg.group;
ExecStart = "${getExe cross-seedPkg} daemon";
#ExecStart = "${cross-seedPkg}/bin/cross-seed daemon";
ExecStart = "${pkgs.cowsay}/bin/cowsay";
Restart = "on-failure";
};
};
Expand All @@ -85,6 +86,8 @@ in {
};
};

users.groups = mkIf (cfg.group == "cross-seed") {};
users.groups = mkIf (cfg.group == "cross-seed") {
cross-seed = { };
};
};
}
6 changes: 4 additions & 2 deletions nixarr/transmission/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ with lib; let
nixarr = config.nixarr;
cfg-cross-seed = config.nixarr.transmission.privateTrackers.cross-seed;
transmissionCrossSeedScript = with builtins; pkgs.writeShellApplication {
name = "mk-cross-seed-credentials";
name = "transmission-cross-seed-script";

runtimeInputs = with pkgs; [ curl ];

Expand Down Expand Up @@ -270,7 +270,9 @@ in {
anti-brute-force-threshold = 10;

script-torrent-done-enabled = cfg-cross-seed.enable;
script-torrent-done-filename = if cfg-cross-seed.enable then transmissionCrossSeedScript else null;
script-torrent-done-filename = if cfg-cross-seed.enable then
"${transmissionCrossSeedScript}/bin/transmission-cross-seed-script"
else null;

message-level =
if cfg.messageLevel == "none"
Expand Down

0 comments on commit a3ddf00

Please sign in to comment.