summary refs log tree commit diff
path: root/nixos/modules/services/networking
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2018-09-16 22:06:59 +0100
committerGitHub <noreply@github.com>2018-09-16 22:06:59 +0100
commitfc41ea8c8e3f737e69d32025fc0dc3ef204431b5 (patch)
tree946a3fe56b99b4310866f89c8e81d0e935e5bf44 /nixos/modules/services/networking
parent536b49f46c08d2556d5778923b131f1c8eaf8984 (diff)
parent32a2d08b232fb132189ffc90806ad3270612493a (diff)
downloadnixlib-fc41ea8c8e3f737e69d32025fc0dc3ef204431b5.tar
nixlib-fc41ea8c8e3f737e69d32025fc0dc3ef204431b5.tar.gz
nixlib-fc41ea8c8e3f737e69d32025fc0dc3ef204431b5.tar.bz2
nixlib-fc41ea8c8e3f737e69d32025fc0dc3ef204431b5.tar.lz
nixlib-fc41ea8c8e3f737e69d32025fc0dc3ef204431b5.tar.xz
nixlib-fc41ea8c8e3f737e69d32025fc0dc3ef204431b5.tar.zst
nixlib-fc41ea8c8e3f737e69d32025fc0dc3ef204431b5.zip
Merge pull request #46144 from dasJ/nullidentdmod-module
nixos/nullidentdmod: Init
Diffstat (limited to 'nixos/modules/services/networking')
-rw-r--r--nixos/modules/services/networking/nullidentdmod.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/nullidentdmod.nix b/nixos/modules/services/networking/nullidentdmod.nix
new file mode 100644
index 000000000000..786b5227dbad
--- /dev/null
+++ b/nixos/modules/services/networking/nullidentdmod.nix
@@ -0,0 +1,34 @@
+{ config, lib, pkgs, ... }: with lib; let
+  cfg = config.services.nullidentdmod;
+
+in {
+  options.services.nullidentdmod = with types; {
+    enable = mkEnableOption "Enable the nullidentdmod identd daemon";
+
+    userid = mkOption {
+      type = nullOr str;
+      description = "User ID to return. Set to null to return a random string each time.";
+      default = null;
+      example = "alice";
+    };
+  };
+
+  config = mkIf cfg.enable {
+    systemd.sockets.nullidentdmod = {
+      description = "Socket for identd (NullidentdMod)";
+      listenStreams = [ "113" ];
+      socketConfig.Accept = true;
+      wantedBy = [ "sockets.target" ];
+    };
+
+    systemd.services."nullidentdmod@" = {
+      description = "NullidentdMod service";
+      serviceConfig = {
+        DynamicUser = true;
+        ExecStart = "${pkgs.nullidentdmod}/bin/nullidentdmod${optionalString (cfg.userid != null) " ${cfg.userid}"}";
+        StandardInput = "socket";
+        StandardOutput = "socket";
+      };
+    };
+  };
+}