fix perm qbit

This commit is contained in:
Adrian Gunnar Lauterer 2024-04-18 16:20:47 +02:00
parent ca1e345862
commit d5ed56f39a
1 changed files with 9 additions and 2 deletions

View File

@ -93,11 +93,16 @@ in
networking.firewall.allowedUDPPorts = [ port torrentPort]; networking.firewall.allowedUDPPorts = [ port torrentPort];
sops.secrets."qbittorrent/interfaceAddress" = { sops.secrets."qbittorrent/interfaceAddress" = {
restartUnits = [ "qbittorrent-nox.service" ];
mode = "0755";
}; };
sops.templates."qbittorrent/configuration" = { sops.templates."qbittorrent/configuration" = {
content = configurationFile; content = configurationFile;
path = "${path}/.config/qBittorrent/qBittorrent.conf"; #path = "${path}/.config/qBittorrent/qBittorrent.conf";
owner = "qbittorrent";
mode = "0755";
}; };
@ -105,6 +110,7 @@ in
isNormalUser = true; #make this a normal user to be able to make files isNormalUser = true; #make this a normal user to be able to make files
home = path; home = path;
group = "media"; group = "media";
}; };
users.groups.qbittorrent = {}; users.groups.qbittorrent = {};
@ -114,6 +120,7 @@ in
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
serviceConfig = { serviceConfig = {
ExecStartPre = "${pkgs.bash}/bin/bash -c '${pkgs.coreutils}/bin/mkdir -p ${path} && ${pkgs.coreutils}/bin/chmod -R 755 ${path} && ${pkgs.coreutils}/bin/cp ${config.sops.templates."qbittorrent/configuration".path} ${path}/.config/qBittorrent/qBittorrent.conf'";
ExecStart = "${pkgs.qbittorrent-nox}/bin/qbittorrent-nox"; ExecStart = "${pkgs.qbittorrent-nox}/bin/qbittorrent-nox";
User = "qbittorrent"; User = "qbittorrent";
Group = "media"; Group = "media";