summaryrefslogtreecommitdiff
path: root/modules/misc/ids.nix
blob: 0bccdbc06cb5e3f3fede32552461c936eb089cc3 (plain)
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
45
46
47
48
49
50
# Based on: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/misc/ids.nix

# This module defines the global list of uids and gids.  We keep a
# central list to prevent id collisions.

# IMPORTANT!
# We only add static uids and gids for services where it is not feasible
# to change uids/gids on service start, in example a service with a lot of
# files.

{ lib, ... }:

let
  inherit (lib) types;
in
{
  options = {

    ids.uids = lib.mkOption {
      internal = true;
      description = lib.mdDoc ''
        The user IDs used in NixOS.
      '';
      type = types.attrsOf types.int;
    };

    ids.gids = lib.mkOption {
      internal = true;
      description = lib.mdDoc ''
        The group IDs used in NixOS.
      '';
      type = types.attrsOf types.int;
    };

  };


  config = {

    ids.uids = {
      nixbld = 300;
    };

    ids.gids = {
      nixbld = 30000;
    };

  };

}