2022-08-13 19:18:48 -07:00
|
|
|
# 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.
|
|
|
|
|
2024-09-10 16:17:57 +01:00
|
|
|
{ lib, config, ... }:
|
2022-08-13 19:18:48 -07:00
|
|
|
|
|
|
|
let
|
|
|
|
inherit (lib) types;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
|
|
|
|
ids.uids = lib.mkOption {
|
|
|
|
internal = true;
|
2024-04-14 23:02:32 +02:00
|
|
|
description = ''
|
2022-08-13 19:18:48 -07:00
|
|
|
The user IDs used in NixOS.
|
|
|
|
'';
|
|
|
|
type = types.attrsOf types.int;
|
|
|
|
};
|
|
|
|
|
|
|
|
ids.gids = lib.mkOption {
|
|
|
|
internal = true;
|
2024-04-14 23:02:32 +02:00
|
|
|
description = ''
|
2022-08-13 19:18:48 -07:00
|
|
|
The group IDs used in NixOS.
|
|
|
|
'';
|
|
|
|
type = types.attrsOf types.int;
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
config = {
|
|
|
|
|
|
|
|
ids.uids = {
|
2024-09-10 16:17:57 +01:00
|
|
|
nixbld = lib.mkDefault 350;
|
2024-10-28 04:10:45 +01:00
|
|
|
_prometheus-node-exporter = 534;
|
2022-08-13 19:18:48 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
ids.gids = {
|
2024-09-10 16:17:57 +01:00
|
|
|
nixbld = lib.mkDefault (if config.system.stateVersion < 5 then 30000 else 350);
|
2024-10-28 04:10:45 +01:00
|
|
|
_prometheus-node-exporter = 534;
|
2022-08-13 19:18:48 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|