1
0
Fork 0

Services: add Deluge

This commit is contained in:
Aires 2024-08-26 12:54:38 -04:00
parent 4d2f4f6db8
commit 6c07c68c84
4 changed files with 71 additions and 8 deletions

View file

@ -234,11 +234,11 @@
"nix-secrets": { "nix-secrets": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1724432746, "lastModified": 1724691044,
"narHash": "sha256-s7XsY4ZsS9jyzZWpXOJNVzc03SNQbALM+S28QKXc8co=", "narHash": "sha256-5edUptO3EjmsvJuaVGI+hdGWRjCo4pBpn96s0bTawAU=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "56ccf5bf3f4d8687dc22c390cdafe20c08a7e549", "rev": "32d3f186c66df00253f80712c2c525616f5d6f25",
"revCount": 60, "revCount": 61,
"type": "git", "type": "git",
"url": "file:./nix-secrets" "url": "file:./nix-secrets"
}, },
@ -297,11 +297,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1724224976, "lastModified": 1724479785,
"narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=", "narHash": "sha256-pP3Azj5d6M5nmG68Fu4JqZmdGt4S4vqI5f8te+E/FTw=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c374d94f1536013ca8e92341b540eba4c22f9c62", "rev": "d0e1602ddde669d5beb01aec49d71a51937ed7be",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -152,6 +152,13 @@ in
user = config.users.users.aires.name; user = config.users.users.aires.name;
}; };
boinc.enable = true; 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 = { duplicacy-web = {
enable = true; enable = true;
autostart = false; autostart = false;

View 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