Added package options to all modules

This commit is contained in:
rasmus-kirk
2024-09-19 22:49:35 +02:00
parent 0ef85b5345
commit c93ecf892e
18 changed files with 150 additions and 117 deletions
+7 -4
View File
@@ -1,7 +1,7 @@
# TODO: Dir creation and file permissions in nix
{
config,
lib,
pkgs,
...
}:
with lib; let
@@ -21,6 +21,8 @@ in {
'';
};
package = mkPackageOption pkgs "sonarr" { };
stateDir = mkOption {
type = types.path;
default = "${nixarr.stateDir}/sonarr";
@@ -80,6 +82,7 @@ in {
services.sonarr = {
enable = cfg.enable;
package = cfg.package;
user = "sonarr";
group = "media";
openFirewall = cfg.openFirewall;
@@ -87,13 +90,13 @@ in {
};
# Enable and specify VPN namespace to confine service in.
systemd.services.sonarr.vpnconfinement = mkIf cfg.vpn.enable {
systemd.services.sonarr.vpnConfinement = mkIf cfg.vpn.enable {
enable = true;
vpnnamespace = "wg";
vpnNamespace = "wg";
};
# Port mappings
vpnnamespaces.wg = mkIf cfg.vpn.enable {
vpnNamespaces.wg = mkIf cfg.vpn.enable {
portMappings = [
{
from = defaultPort;