server modules
This commit is contained in:
@@ -13,6 +13,12 @@
|
|||||||
homepage = {
|
homepage = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
prowlarr = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
lidarr = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
vaultwarden = {
|
vaultwarden = {
|
||||||
enable = true;
|
enable = true;
|
||||||
url = "vault.cnst.dev";
|
url = "vault.cnst.dev";
|
||||||
|
|||||||
@@ -124,6 +124,8 @@
|
|||||||
./server/fail2ban
|
./server/fail2ban
|
||||||
./server/homepage
|
./server/homepage
|
||||||
./server/vaultwarden
|
./server/vaultwarden
|
||||||
|
./server/prowlarr
|
||||||
|
./server/lidarr
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
settings = {
|
settings = {
|
||||||
|
|||||||
52
modules/server/lidarr/default.nix
Normal file
52
modules/server/lidarr/default.nix
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
unit = "lidarr";
|
||||||
|
srv = config.server;
|
||||||
|
cfg = config.server.${unit};
|
||||||
|
in {
|
||||||
|
options.server.${unit} = {
|
||||||
|
enable = lib.mkEnableOption {
|
||||||
|
description = "Enable ${unit}";
|
||||||
|
};
|
||||||
|
configDir = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "/var/lib/${unit}";
|
||||||
|
};
|
||||||
|
url = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "${unit}.${srv.domain}";
|
||||||
|
};
|
||||||
|
homepage.name = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "Lidarr";
|
||||||
|
};
|
||||||
|
homepage.description = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "Music collection manager";
|
||||||
|
};
|
||||||
|
homepage.icon = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "lidarr.svg";
|
||||||
|
};
|
||||||
|
homepage.category = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "Arr";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.${unit} = {
|
||||||
|
enable = true;
|
||||||
|
user = srv.user;
|
||||||
|
group = srv.group;
|
||||||
|
};
|
||||||
|
services.caddy.virtualHosts."${cfg.url}" = {
|
||||||
|
useACMEHost = srv.domain;
|
||||||
|
extraConfig = ''
|
||||||
|
reverse_proxy http://127.0.0.1:8686
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
50
modules/server/prowlarr/default.nix
Normal file
50
modules/server/prowlarr/default.nix
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
unit = "prowlarr";
|
||||||
|
srv = config.server;
|
||||||
|
cfg = config.server.${unit};
|
||||||
|
in {
|
||||||
|
options.server.${unit} = {
|
||||||
|
enable = lib.mkEnableOption {
|
||||||
|
description = "Enable ${unit}";
|
||||||
|
};
|
||||||
|
configDir = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "/var/lib/${unit}";
|
||||||
|
};
|
||||||
|
url = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "${unit}.${srv.domain}";
|
||||||
|
};
|
||||||
|
homepage.name = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "Prowlarr";
|
||||||
|
};
|
||||||
|
homepage.description = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "PVR indexer";
|
||||||
|
};
|
||||||
|
homepage.icon = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "prowlarr.svg";
|
||||||
|
};
|
||||||
|
homepage.category = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "Arr";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.${unit} = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
services.caddy.virtualHosts."${cfg.url}" = {
|
||||||
|
useACMEHost = srv.domain;
|
||||||
|
extraConfig = ''
|
||||||
|
reverse_proxy http://127.0.0.1:9696
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user