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
@ -29,10 +34,10 @@
openvpn.enable = true; openvpn.enable = true;
# nm-networks # nm-networks
networking.nmConnections = [ ]; networking.nmConnections = [];
# enable sops # enable sops
sops = { enable = true; }; sops = {enable = true;};
# enable wireguard # enable wireguard
wireguard.enable = true; wireguard.enable = true;
@ -40,17 +45,22 @@
# user setup # user setup
users = { users = {
enable = true; enable = true;
admins = [ "ellmau" ]; admins = ["ellmau"];
users = [ ]; users = [];
meta = { ellmau.git = { signDefault = true; }; }; meta = {
ellmau = {
git = {signDefault = true;};
extraGroups = ["networkmanager"];
};
};
}; };
}; };
boot = { boot = {
extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ]; extraModulePackages = [config.boot.kernelPackages.v4l2loopback];
kernelModules = [ "v4l2loopback" ]; kernelModules = ["v4l2loopback"];
plymouth.enable = true; plymouth.enable = true;
}; };

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
@ -34,10 +40,10 @@
openvpn.enable = true; openvpn.enable = true;
# nm-networks # nm-networks
networking.nmConnections = [ "tartaros" "eduroam" ]; networking.nmConnections = ["tartaros" "eduroam"];
# enable sops # enable sops
sops = { enable = true; }; sops = {enable = true;};
# enable wireguard # enable wireguard
wireguard.enable = true; wireguard.enable = true;
@ -45,23 +51,26 @@
# user setup # user setup
users = { users = {
enable = true; enable = true;
admins = [ "ellmau" ]; admins = ["ellmau"];
users = [ ]; users = [];
meta = { meta = {
ellmau.git = { ellmau = {
git = {
key = "0x4998BEEE"; key = "0x4998BEEE";
gpgsm = true; gpgsm = true;
signDefault = true; signDefault = true;
}; };
extraGroups = ["networkmanager"];
};
}; };
}; };
}; };
boot = { boot = {
extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ]; extraModulePackages = [config.boot.kernelPackages.v4l2loopback];
kernelModules = [ "v4l2loopback" ]; kernelModules = ["v4l2loopback"];
plymouth.enable = true; plymouth.enable = true;
}; };

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;
}; };