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": { "secrets": {
"flake": false, "flake": false,
"locked": { "locked": {
"dirtyRev": "9821d2162d2e2ee58ff65e12c986ef3a8f105058-dirty",
"dirtyShortRev": "9821d21-dirty",
"lastModified": 1725996724, "lastModified": 1725996724,
"narHash": "sha256-/qG2amIN/cMpkCXAM1/ThYeJgEt4Ik+gv/YOkyVa0kg=", "narHash": "sha256-xL7dP5DVkG56pbY9wSJ8v9gpCjtA7UfXC6MwttF8teE=",
"ref": "refs/heads/main",
"rev": "9821d2162d2e2ee58ff65e12c986ef3a8f105058",
"revCount": 71,
"type": "git", "type": "git",
"url": "file:./secrets" "url": "file:./secrets"
}, },

View file

@ -26,6 +26,7 @@ let
home-assistant.url home-assistant.url
jellyfin.url jellyfin.url
netdata.url netdata.url
transmission.url
]; ];
in in
{ {
@ -192,9 +193,13 @@ in
ports = [ config.secrets.hosts.dimaga.ssh.port ]; ports = [ config.secrets.hosts.dimaga.ssh.port ];
}; };
transmission = { transmission = {
enable = false; enable = true;
home = "${services-root}/transmission"; home = "${services-root}/transmission";
url = config.secrets.services.transmission.url; url = config.secrets.services.transmission.url;
auth = {
user = config.users.users.aires.name;
password = config.secrets.services.transmission.password;
};
}; };
virtualization.host = { virtualization.host = {
enable = true; 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 # 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 # ALSO: This causes a build failure on NixOS anyway. ee https://github.com/NixOS/nixpkgs/issues/303067
ipu6 = { ipu6 = {
enable = false; enable = true;
platform = "ipu6ep"; platform = "ipu6ep";
}; };
}; };

View file

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

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