summaryrefslogtreecommitdiff
path: root/custom/uucp-mediaclient.nix
diff options
context:
space:
mode:
Diffstat (limited to 'custom/uucp-mediaclient.nix')
-rw-r--r--custom/uucp-mediaclient.nix15
1 files changed, 15 insertions, 0 deletions
diff --git a/custom/uucp-mediaclient.nix b/custom/uucp-mediaclient.nix
index 42fa0246..1b79d4a5 100644
--- a/custom/uucp-mediaclient.nix
+++ b/custom/uucp-mediaclient.nix
@@ -76,6 +76,11 @@ in {
76 default = "/var/media"; 76 default = "/var/media";
77 description = "Media directory"; 77 description = "Media directory";
78 }; 78 };
79
80 mediaGroup = mkOption {
81 type = types.str;
82 default = "media";
83 };
79 }; 84 };
80 }; 85 };
81 86
@@ -86,6 +91,16 @@ in {
86 services.uucp.remoteNodes = genAttrs cfg.remoteNodes (name: { commands = ["recv-media"]; } ); 91 services.uucp.remoteNodes = genAttrs cfg.remoteNodes (name: { commands = ["recv-media"]; } );
87 92
88 assertions = map (user: { assertion = elem user config.services.notify-users; message = "Notification must be allowed for ${user}!"; }) (unique cfg.notify.users); 93 assertions = map (user: { assertion = elem user config.services.notify-users; message = "Notification must be allowed for ${user}!"; }) (unique cfg.notify.users);
94
95 users.groups."${cfg.mediaGroup}" = {
96 members = [ "uucp" ];
97 };
98
99 system.activationScripts = ''
100 mkdir -m 0755 -pv ${cfg.mediaDir}
101 chown :${cfg.mediaGroup} ${cfg.mediaDir}
102 chmod -c "g+rwx" ${cfg.mediaDir}
103 '';
89 }; 104 };
90} 105}
91 106