1{ config, lib, pkgs, ... }:
2
3with lib;
4
5{
6
7 ###### interface
8
9 options = {
10
11 services.oidentd.enable = mkOption {
12 default = false;
13 type = types.bool;
14 description = lib.mdDoc ''
15 Whether to enable ‘oidentd’, an implementation of the Ident
16 protocol (RFC 1413). It allows remote systems to identify the
17 name of the user associated with a TCP connection.
18 '';
19 };
20
21 };
22
23
24 ###### implementation
25
26 config = mkIf config.services.oidentd.enable {
27 systemd.services.oidentd = {
28 after = [ "network.target" ];
29 wantedBy = [ "multi-user.target" ];
30 serviceConfig.Type = "forking";
31 script = "${pkgs.oidentd}/sbin/oidentd -u oidentd -g nogroup";
32 };
33
34 users.users.oidentd = {
35 description = "Ident Protocol daemon user";
36 group = "oidentd";
37 uid = config.ids.uids.oidentd;
38 };
39
40 users.groups.oidentd.gid = config.ids.gids.oidentd;
41
42 };
43
44}