1
0
Fork 0

Services: add UI password for Transmission

This commit is contained in:
Aires 2024-09-10 18:45:36 -04:00
parent c05a8d1ebc
commit c6506685ba
5 changed files with 27 additions and 7 deletions

View file

@ -378,11 +378,10 @@
"secrets": {
"flake": false,
"locked": {
"dirtyRev": "9821d2162d2e2ee58ff65e12c986ef3a8f105058-dirty",
"dirtyShortRev": "9821d21-dirty",
"lastModified": 1725996724,
"narHash": "sha256-/qG2amIN/cMpkCXAM1/ThYeJgEt4Ik+gv/YOkyVa0kg=",
"ref": "refs/heads/main",
"rev": "9821d2162d2e2ee58ff65e12c986ef3a8f105058",
"revCount": 71,
"narHash": "sha256-xL7dP5DVkG56pbY9wSJ8v9gpCjtA7UfXC6MwttF8teE=",
"type": "git",
"url": "file:./secrets"
},

View file

@ -26,6 +26,7 @@ let
home-assistant.url
jellyfin.url
netdata.url
transmission.url
];
in
{
@ -192,9 +193,13 @@ in
ports = [ config.secrets.hosts.dimaga.ssh.port ];
};
transmission = {
enable = false;
enable = true;
home = "${services-root}/transmission";
url = config.secrets.services.transmission.url;
auth = {
user = config.users.users.aires.name;
password = config.secrets.services.transmission.password;
};
};
virtualization.host = {
enable = true;

View file

@ -105,7 +105,7 @@ in
# NOTE: Results in a kernel panic on 6.10 kernels. See https://github.com/linux-surface/linux-surface/issues/1516
# ALSO: This causes a build failure on NixOS anyway. ee https://github.com/NixOS/nixpkgs/issues/303067
ipu6 = {
enable = false;
enable = true;
platform = "ipu6ep";
};
};

View file

@ -17,6 +17,18 @@ in
type = lib.types.str;
description = "Where to store Transmission's files";
};
auth = {
user = lib.mkOption {
default = "transmission";
type = lib.types.str;
description = "Username for basic auth.";
};
password = lib.mkOption {
default = "transmission";
type = lib.types.str;
description = "Password for basic auth.";
};
};
url = lib.mkOption {
default = "";
type = lib.types.str;
@ -32,6 +44,9 @@ in
nginx.virtualHosts."${cfg.url}" = {
useACMEHost = pkgs.util.getDomainFromURL cfg.url;
forceSSL = true;
basicAuth = {
"${cfg.auth.user}" = cfg.auth.password;
};
locations."/" = {
proxyPass = "http://127.0.0.1:9091";
extraConfig = ''
@ -48,6 +63,7 @@ in
transmission = {
enable = true;
home = cfg.home;
downloadDirPermissions = "770"; # Required. See https://github.com/NixOS/nixpkgs/issues/183429#issuecomment-1648371683
};
};

@ -1 +1 @@
Subproject commit 9821d2162d2e2ee58ff65e12c986ef3a8f105058
Subproject commit b086ea560a8c5e2266b70710c6c2478a010f4c59