Add deluge and deluge web services
This commit is contained in:
parent
f2a0710bee
commit
a6f0d984fe
|
@ -75,6 +75,7 @@ in
|
||||||
wwwrun = 54;
|
wwwrun = 54;
|
||||||
spamd = 56;
|
spamd = 56;
|
||||||
nslcd = 58;
|
nslcd = 58;
|
||||||
|
deluge = 60;
|
||||||
|
|
||||||
# When adding a uid, make sure it doesn't match an existing gid.
|
# When adding a uid, make sure it doesn't match an existing gid.
|
||||||
|
|
||||||
|
@ -132,6 +133,7 @@ in
|
||||||
networkmanager = 57;
|
networkmanager = 57;
|
||||||
nslcd = 58;
|
nslcd = 58;
|
||||||
scanner = 59;
|
scanner = 59;
|
||||||
|
deluge = 60;
|
||||||
|
|
||||||
# When adding a gid, make sure it doesn't match an existing uid.
|
# When adding a gid, make sure it doesn't match an existing uid.
|
||||||
|
|
||||||
|
|
|
@ -172,6 +172,7 @@
|
||||||
./services/system/kerberos.nix
|
./services/system/kerberos.nix
|
||||||
./services/system/nscd.nix
|
./services/system/nscd.nix
|
||||||
./services/system/uptimed.nix
|
./services/system/uptimed.nix
|
||||||
|
./services/torrent/deluge.nix
|
||||||
./services/ttys/gpm.nix
|
./services/ttys/gpm.nix
|
||||||
./services/ttys/agetty.nix
|
./services/ttys/agetty.nix
|
||||||
./services/web-servers/apache-httpd/default.nix
|
./services/web-servers/apache-httpd/default.nix
|
||||||
|
|
62
modules/services/torrent/deluge.nix
Normal file
62
modules/services/torrent/deluge.nix
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
with pkgs.lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
uid = config.ids.uids.deluge;
|
||||||
|
gid = config.ids.gids.deluge;
|
||||||
|
cfg = config.services.deluge;
|
||||||
|
cfg_web = config.services.deluge.web;
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
services.deluge = {
|
||||||
|
enable = mkOption {
|
||||||
|
default = false;
|
||||||
|
example = "true";
|
||||||
|
description = ''
|
||||||
|
Start Deluge daemon.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.deluge.web = {
|
||||||
|
enable = mkOption {
|
||||||
|
default = false;
|
||||||
|
example = "true";
|
||||||
|
description = ''
|
||||||
|
Start Deluge Web daemon.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
|
systemd.services.deluged = {
|
||||||
|
after = [ "network.target" ];
|
||||||
|
description = "Deluge Daemon";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
path = [ pkgs.pythonPackages.deluge ];
|
||||||
|
script = "deluged -d";
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.delugeweb = mkIf cfg_web.enable {
|
||||||
|
after = [ "network.target" "deluged.service" ];
|
||||||
|
description = "Deluge Web";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
wants = [ "deluged.service" ];
|
||||||
|
path = [ pkgs.pythonPackages.deluge ];
|
||||||
|
script = "deluge --ui web";
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = [ pkgs.pythonPackages.deluge ];
|
||||||
|
|
||||||
|
users.extraUsers.deluge = {
|
||||||
|
inherit uid;
|
||||||
|
group = "deluge";
|
||||||
|
description = "Deluge Daemon user";
|
||||||
|
};
|
||||||
|
|
||||||
|
users.extraGroups.deluge.gid = gid;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue