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 = ''
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-interfaces.target" ];
29 wantedBy = [ "multi-user.target" ];
30 serviceConfig.Type = "forking";
31 script = "${pkgs.oidentd}/sbin/oidentd -u oidentd -g nogroup" +
32 optionalString config.networking.enableIPv6 " -a ::";
33 };
34
35 users.extraUsers.oidentd = {
36 description = "Ident Protocol daemon user";
37 group = "oidentd";
38 uid = config.ids.uids.oidentd;
39 };
40
41 users.extraGroups.oidentd.gid = config.ids.gids.oidentd;
42
43 };
44
45}