1
0
mirror of https://github.com/ellmau/nixos.git synced 2025-12-19 09:29:36 +01:00

Add option for additional groups to user meta definition

This commit is contained in:
Stefan Ellmauthaler 2023-05-24 10:39:45 +02:00
parent 6bb520b0ae
commit e061882727
Signed by: ellmau
GPG Key ID: C804A9C1B7AF8256
3 changed files with 47 additions and 22 deletions

View File

@ -1,6 +1,11 @@
{ config, pkgs, inputs, nixos-hardware, ... }: { {
imports = config,
[ ../../common/users.nix ./hardware-configuration.nix ./software.nix ]; pkgs,
inputs,
nixos-hardware,
...
}: {
imports = [../../common/users.nix ./hardware-configuration.nix ./software.nix];
elss = { elss = {
# base system # base system
@ -43,7 +48,12 @@
admins = ["ellmau"]; admins = ["ellmau"];
users = []; users = [];
meta = { ellmau.git = { signDefault = true; }; }; meta = {
ellmau = {
git = {signDefault = true;};
extraGroups = ["networkmanager"];
};
};
}; };
}; };

View File

@ -1,4 +1,10 @@
{ config, pkgs, inputs, nixos-hardware, ... }: { {
config,
pkgs,
inputs,
nixos-hardware,
...
}: {
imports = [ imports = [
../../common/users.nix ../../common/users.nix
./printer.nix ./printer.nix
@ -49,11 +55,14 @@
users = []; users = [];
meta = { meta = {
ellmau.git = { ellmau = {
git = {
key = "0x4998BEEE"; key = "0x4998BEEE";
gpgsm = true; gpgsm = true;
signDefault = true; signDefault = true;
}; };
extraGroups = ["networkmanager"];
};
}; };
}; };
}; };

View File

@ -45,6 +45,12 @@ with lib; {
type = types.str; type = types.str;
description = "Email address of the user"; description = "Email address of the user";
}; };
extraGroups = mkOption {
type = types.listOf types.str;
description = "additional groups to add";
default = [];
};
git = mkOption { git = mkOption {
type = types.submodule { type = types.submodule {
options = { options = {
@ -92,7 +98,7 @@ with lib; {
inherit (meta) description; inherit (meta) description;
isNormalUser = true; isNormalUser = true;
home = "/home/${login}"; home = "/home/${login}";
extraGroups = []; extraGroups = meta.extraGroups;
openssh.authorizedKeys.keys = meta.publicKeys; openssh.authorizedKeys.keys = meta.publicKeys;
}; };