modules: move 'services' into subfolder
This commit is contained in:
parent
31f8ec6e98
commit
d2704b17fe
27 changed files with 1 additions and 2 deletions
28
modules/services/sabnzbd.nix
Normal file
28
modules/services/sabnzbd.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# Usenet binary client.
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.services.sabnzbd;
|
||||
|
||||
domain = config.networking.domain;
|
||||
sabnzbdDomain = "sabnzbd.${domain}";
|
||||
port = 9090; # NOTE: not declaratively set...
|
||||
in
|
||||
{
|
||||
options.my.services.sabnzbd = with lib; {
|
||||
enable = mkEnableOption "SABnzbd binary news reader";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.sabnzbd = {
|
||||
enable = true;
|
||||
group = "media";
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."${sabnzbdDomain}" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = domain;
|
||||
|
||||
locations."/".proxyPass = "http://127.0.0.1:${toString port}";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue