summaryrefslogtreecommitdiff
path: root/custom/uucp-notifyclient.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2018-06-02 18:40:43 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2018-06-02 18:40:43 +0200
commit656f65c78eb6b2e72711acc35e2b936f4279238f (patch)
tree0693c39484d8e080ca8c2326aadf4d4edff46c84 /custom/uucp-notifyclient.nix
parentcd12041e267ff1a2c1d7cd0fabea1364bc587ec4 (diff)
downloadnixos-656f65c78eb6b2e72711acc35e2b936f4279238f.tar
nixos-656f65c78eb6b2e72711acc35e2b936f4279238f.tar.gz
nixos-656f65c78eb6b2e72711acc35e2b936f4279238f.tar.bz2
nixos-656f65c78eb6b2e72711acc35e2b936f4279238f.tar.xz
nixos-656f65c78eb6b2e72711acc35e2b936f4279238f.zip
uucp-notifyclient
Diffstat (limited to 'custom/uucp-notifyclient.nix')
-rw-r--r--custom/uucp-notifyclient.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/custom/uucp-notifyclient.nix b/custom/uucp-notifyclient.nix
new file mode 100644
index 00000000..373c0553
--- /dev/null
+++ b/custom/uucp-notifyclient.nix
@@ -0,0 +1,37 @@
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6 cfg = config.services.uucp.notify-client;
7
8 nodeConfig = {
9 options = {
10 allowedUsers = mkOption {
11 type = with types; uniq (listOf str);
12 default = services.notify-users.allowedUsers;
13 };
14 };
15 };
16in {
17 options = {
18 services.uucp.notify-client = mkOption {
19 remoteNodes = mkOption {
20 type = with types; attrsOf (submodule nodeConfig);
21 default = [];
22 description = ''
23 Servers to receive notifications from
24 '';
25 };
26 };
27 };
28
29 imports = [ ./notify-users.nix ];
30
31 config = mkIf (cfg.nodes != {}) {
32 services.notify-users = concatMap ({ allowedUsers }: allowedUsers) cfg.remoteNodes;
33
34 services.uucp.remoteNodes = mapAttrs (name: { allowedUsers }: { commands = map (user: "notify-${user}") allowedUsers; }) cfg.remoteNodes;
35 services.uucp.commandPath = [ config.security.wrapperDir ];
36 };
37}