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 -3
View File
@@ -1,6 +1,7 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
@@ -20,6 +21,8 @@ in {
'';
};
package = mkPackageOption pkgs "readarr" { };
stateDir = mkOption {
type = types.path;
default = "${nixarr.stateDir}/readarr";
@@ -79,6 +82,7 @@ in {
services.readarr = {
enable = cfg.enable;
package = cfg.package;
user = "readarr";
group = "media";
openFirewall = cfg.openFirewall;
@@ -86,13 +90,13 @@ in {
};
# Enable and specify VPN namespace to confine service in.
systemd.services.readarr.vpnconfinement = mkIf cfg.vpn.enable {
systemd.services.readarr.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;