summary refs log tree commit diff
path: root/nixos/modules/services/networking/oidentd.nix
blob: feb84806ba99cef7ee462bec08e7d868aebf33c0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{ config, lib, pkgs, ... }:

with lib;

{

  ###### interface

  options = {

    services.oidentd.enable = mkOption {
      default = false;
      type = types.bool;
      description = ''
        Whether to enable ‘oidentd’, an implementation of the Ident
        protocol (RFC 1413).  It allows remote systems to identify the
        name of the user associated with a TCP connection.
      '';
    };

  };


  ###### implementation

  config = mkIf config.services.oidentd.enable {
    systemd.services.oidentd = {
      after = [ "network.target" ];
      wantedBy = [ "multi-user.target" ];
      serviceConfig.Type = "forking";
      script = "${pkgs.oidentd}/sbin/oidentd -u oidentd -g nogroup";
    };

    users.users.oidentd = {
      description = "Ident Protocol daemon user";
      group = "oidentd";
      uid = config.ids.uids.oidentd;
    };

    users.groups.oidentd.gid = config.ids.gids.oidentd;

  };

}