ifTheuExist and extra groups to user sam

This commit is contained in:
Sam 2024-07-05 16:32:49 +01:00
parent 74dab0c38d
commit 911d7d6905
1 changed files with 10 additions and 3 deletions

View File

@ -1,5 +1,6 @@
{ pkgs, inputs, config, lib, ... }:
let
ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
username = "admin";
pubKeys = lib.filesystem.listFilesRecursive (../keys);
hostname = config.networking.hostName;
@ -15,7 +16,13 @@ in
hashedPasswordFile = sopsHashedPasswordFile;
openssh.authorizedKeys.keys = lib.lists.forEach pubKeys (key: builtins.readFile key);
extraGroups = ["wheel"];
extraGroups = [
"wheel"
] ++ ifTheyExist [
"docker"
"lxc"
"git"
];
packages = with pkgs; [
];