From ed456c999dd1b5bdd7626edff2d11c252e7c8b4d Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 15 Sep 2021 15:57:23 +0200 Subject: [PATCH] modules: system: remove 'media' It was not the idiomatic way to do this. --- modules/services/calibre-web.nix | 3 +++ modules/services/jellyfin.nix | 3 +++ modules/services/paperless.nix | 3 +++ modules/services/pirate.nix | 2 ++ modules/services/sabnzbd.nix | 3 +++ modules/services/transmission.nix | 3 +++ modules/system/default.nix | 1 - modules/system/media.nix | 17 ----------------- 8 files changed, 17 insertions(+), 18 deletions(-) delete mode 100644 modules/system/media.nix diff --git a/modules/services/calibre-web.nix b/modules/services/calibre-web.nix index a62b74c..d4beff9 100644 --- a/modules/services/calibre-web.nix +++ b/modules/services/calibre-web.nix @@ -37,6 +37,9 @@ in }; }; + # Set-up media group + users.groups.media = { }; + my.services.nginx.virtualHosts = [ { subdomain = "library"; diff --git a/modules/services/jellyfin.nix b/modules/services/jellyfin.nix index 771f2c5..2fcf51e 100644 --- a/modules/services/jellyfin.nix +++ b/modules/services/jellyfin.nix @@ -14,6 +14,9 @@ in group = "media"; }; + # Set-up media group + users.groups.media = { }; + my.services.nginx.virtualHosts = [ { subdomain = "jellyfin"; diff --git a/modules/services/paperless.nix b/modules/services/paperless.nix index b22628f..b4e1f44 100644 --- a/modules/services/paperless.nix +++ b/modules/services/paperless.nix @@ -93,6 +93,9 @@ in ]; }; + # Set-up media group + users.groups.media = { }; + systemd.services.paperless-ng-server = { # Make sure the DB is available after = [ "postgresql.service" ]; diff --git a/modules/services/pirate.nix b/modules/services/pirate.nix index a2c62ca..89dba55 100644 --- a/modules/services/pirate.nix +++ b/modules/services/pirate.nix @@ -32,5 +32,7 @@ in config = lib.mkIf cfg.enable { services = managers; my.services.nginx.virtualHosts = redirections; + # Set-up media group + users.groups.media = { }; }; } diff --git a/modules/services/sabnzbd.nix b/modules/services/sabnzbd.nix index 653f853..b9b99cf 100644 --- a/modules/services/sabnzbd.nix +++ b/modules/services/sabnzbd.nix @@ -15,6 +15,9 @@ in group = "media"; }; + # Set-up media group + users.groups.media = { }; + my.services.nginx.virtualHosts = [ { subdomain = "sabnzbd"; diff --git a/modules/services/transmission.nix b/modules/services/transmission.nix index 2f27990..807fc0a 100644 --- a/modules/services/transmission.nix +++ b/modules/services/transmission.nix @@ -72,6 +72,9 @@ in }; }; + # Set-up media group + users.groups.media = { }; + # Default transmission webui, I prefer combustion but its development # seems to have stalled my.services.nginx.virtualHosts = [ diff --git a/modules/system/default.nix b/modules/system/default.nix index a9b251b..2b2bf97 100644 --- a/modules/system/default.nix +++ b/modules/system/default.nix @@ -6,7 +6,6 @@ ./boot.nix ./documentation.nix ./language.nix - ./media.nix ./nix.nix ./packages.nix ./users.nix diff --git a/modules/system/media.nix b/modules/system/media.nix deleted file mode 100644 index 630a351..0000000 --- a/modules/system/media.nix +++ /dev/null @@ -1,17 +0,0 @@ -# Abstracting away the need for a common 'media' group - -{ config, lib, ... }: -let - mediaServices = with config.my.services; [ - calibre-web - jellyfin - paperless - pirate - sabnzbd - transmission - ]; - needed = builtins.any (service: service.enable) mediaServices; -in -{ - config.users.groups.media = lib.mkIf needed { }; -}