Added package options to all modules
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user