modules: services: put modules into folders
This commit is contained in:
parent
836b54b8eb
commit
ac90c5b11a
29 changed files with 28 additions and 28 deletions
38
modules/services/pirate/default.nix
Normal file
38
modules/services/pirate/default.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# The total autonomous media delivery system.
|
||||
# Relevant link [1].
|
||||
#
|
||||
# [1]: https://youtu.be/I26Ql-uX6AM
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.services.pirate;
|
||||
|
||||
ports = {
|
||||
sonarr = 8989;
|
||||
radarr = 7878;
|
||||
bazarr = 6767;
|
||||
lidarr = 8686;
|
||||
};
|
||||
|
||||
managers = with lib.attrsets;
|
||||
(mapAttrs
|
||||
(_: _: {
|
||||
enable = true;
|
||||
group = "media";
|
||||
})
|
||||
ports);
|
||||
|
||||
redirections = lib.flip lib.mapAttrsToList ports
|
||||
(subdomain: port: { inherit subdomain port; });
|
||||
in
|
||||
{
|
||||
options.my.services.pirate = {
|
||||
enable = lib.mkEnableOption "Media automation";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services = managers;
|
||||
my.services.nginx.virtualHosts = redirections;
|
||||
# Set-up media group
|
||||
users.groups.media = { };
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue