Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions nixos/modules/config/nsswitch.nix
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,30 @@
'';
default = [ ];
};

subuid = lib.mkOption {
type = lib.types.listOf lib.types.str;
description = ''
List of subuid entries to configure in {file}`/etc/nsswitch.conf`.

Note that "files" is always prepended.

This option only takes effect if nscd is enabled.
'';
default = [ ];
};

subgid = lib.mkOption {
type = lib.types.listOf lib.types.str;
description = ''
List of subgid entries to configure in {file}`/etc/nsswitch.conf`.

Note that "files" is always prepended.

This option only takes effect if nscd is enabled.
'';
default = [ ];
};
};
};

Expand Down Expand Up @@ -133,6 +157,9 @@
services: ${lib.concatStringsSep " " config.system.nssDatabases.services}
protocols: files
rpc: files

subuid: ${lib.concatStringsSep " " config.system.nssDatabases.subuid}
subgid: ${lib.concatStringsSep " " config.system.nssDatabases.subgid}
'';

system.nssDatabases = {
Expand All @@ -145,6 +172,8 @@
(lib.mkOrder 1499 [ "dns" ])
];
services = lib.mkBefore [ "files" ];
subuid = lib.mkBefore [ "files" ];
subgid = lib.mkBefore [ "files" ];
};
};
}
1 change: 1 addition & 0 deletions nixos/modules/security/ipa.nix
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ in
allowed_uids = lib.concatStringsSep ", " cfg.ifpAllowedUids;
};
};
subIDsIntegration = true;
};

networking.timeServers = lib.optional cfg.useAsTimeserver cfg.server;
Expand Down
14 changes: 14 additions & 0 deletions nixos/modules/services/misc/sssd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ in
Kerberos will be configured to cache credentials in SSS.
'';
};

subIDsIntegration = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether to use SSS as a source for subuid and subgid.
'';
};

environmentFile = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
Expand Down Expand Up @@ -246,6 +255,11 @@ in
services.openssh.authorizedKeysCommand = "/etc/ssh/authorized_keys_command";
services.openssh.authorizedKeysCommandUser = "nobody";
})

(lib.mkIf cfg.subIDsIntegration {
system.nssDatabases.subuid = [ "sss" ];
system.nssDatabases.subgid = [ "sss" ];
})
];

meta.maintainers = with lib.maintainers; [ bbigras ];
Expand Down
Loading