Services: add Deluge
This commit is contained in:
parent
4d2f4f6db8
commit
6c07c68c84
14
flake.lock
14
flake.lock
|
@ -234,11 +234,11 @@
|
|||
"nix-secrets": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1724432746,
|
||||
"narHash": "sha256-s7XsY4ZsS9jyzZWpXOJNVzc03SNQbALM+S28QKXc8co=",
|
||||
"lastModified": 1724691044,
|
||||
"narHash": "sha256-5edUptO3EjmsvJuaVGI+hdGWRjCo4pBpn96s0bTawAU=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "56ccf5bf3f4d8687dc22c390cdafe20c08a7e549",
|
||||
"revCount": 60,
|
||||
"rev": "32d3f186c66df00253f80712c2c525616f5d6f25",
|
||||
"revCount": 61,
|
||||
"type": "git",
|
||||
"url": "file:./nix-secrets"
|
||||
},
|
||||
|
@ -297,11 +297,11 @@
|
|||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1724224976,
|
||||
"narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=",
|
||||
"lastModified": 1724479785,
|
||||
"narHash": "sha256-pP3Azj5d6M5nmG68Fu4JqZmdGt4S4vqI5f8te+E/FTw=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "c374d94f1536013ca8e92341b540eba4c22f9c62",
|
||||
"rev": "d0e1602ddde669d5beb01aec49d71a51937ed7be",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -152,6 +152,13 @@ in
|
|||
user = config.users.users.aires.name;
|
||||
};
|
||||
boinc.enable = true;
|
||||
deluge = {
|
||||
enable = true;
|
||||
autostart = false;
|
||||
home = "${services-root}/deluge";
|
||||
domain = config.secrets.networking.primaryDomain;
|
||||
url = config.secrets.services.deluge.url;
|
||||
};
|
||||
duplicacy-web = {
|
||||
enable = true;
|
||||
autostart = false;
|
||||
|
|
56
modules/services/deluge.nix
Normal file
56
modules/services/deluge.nix
Normal file
|
@ -0,0 +1,56 @@
|
|||
# This is an example of a blank module.
|
||||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.aux.system.services.deluge;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
aux.system.services.deluge = {
|
||||
autostart = lib.mkEnableOption "Automatically starts Deluge at boot.";
|
||||
enable = lib.mkEnableOption "Enables Deluge.";
|
||||
home = lib.mkOption {
|
||||
default = "";
|
||||
type = lib.types.str;
|
||||
description = "Where to store Deluge's files";
|
||||
};
|
||||
domain = lib.mkOption {
|
||||
default = "";
|
||||
type = lib.types.str;
|
||||
description = "The root domain that Deluge will be hosted on.";
|
||||
example = "example.com";
|
||||
};
|
||||
url = lib.mkOption {
|
||||
default = "";
|
||||
type = lib.types.str;
|
||||
description = "The complete URL where Deluge is hosted.";
|
||||
example = "https://deluge.example.com";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services = {
|
||||
nginx.virtualHosts."${cfg.url}" = {
|
||||
useACMEHost = cfg.domain;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:8112";
|
||||
extraConfig = ''
|
||||
proxy_set_header X-Deluge-Base "/";
|
||||
add_header X-Frame-Options SAMEORIGIN;
|
||||
'';
|
||||
};
|
||||
};
|
||||
deluge = {
|
||||
enable = true;
|
||||
dataDir = cfg.home;
|
||||
web = {
|
||||
enable = true;
|
||||
openFirewall = false; # Not needed since we're using a reverse proxy
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1 +1 @@
|
|||
Subproject commit 56ccf5bf3f4d8687dc22c390cdafe20c08a7e549
|
||||
Subproject commit 32d3f186c66df00253f80712c2c525616f5d6f25
|
Loading…
Reference in a new issue