added users that can be disabled
This commit is contained in:
parent
9418b91b4d
commit
eda1db9136
6 changed files with 193 additions and 94 deletions
|
@ -1,23 +1,45 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
let
|
||||
cfg = config.users.ester;
|
||||
in
|
||||
{
|
||||
sops.secrets."passwords/ester" = {
|
||||
neededForUsers = true;
|
||||
# sopsFile = ../secrets.yaml;
|
||||
options.users.ester = {
|
||||
isNormalUser = lib.mkEnableOption "ester";
|
||||
};
|
||||
|
||||
# Define user accounts
|
||||
users.users.ester = {
|
||||
isNormalUser = true;
|
||||
uid = 1001;
|
||||
description = "Ester";
|
||||
extraGroups = [ "networkmanager" ];
|
||||
config = {
|
||||
sops.secrets = lib.mkIf cfg.isNormalUser {
|
||||
"passwords/ester" = {
|
||||
neededForUsers = true;
|
||||
# sopsFile = ../secrets.yaml;
|
||||
};
|
||||
};
|
||||
|
||||
hashedPasswordFile = config.sops.secrets."passwords/ester".path;
|
||||
users.groups.ester = {};
|
||||
|
||||
packages = with pkgs; [
|
||||
firefox
|
||||
bitwarden
|
||||
discord
|
||||
users.users.ester = lib.mkMerge [
|
||||
{
|
||||
uid = 1001;
|
||||
description = "Ester";
|
||||
group = "ester";
|
||||
}
|
||||
|
||||
(
|
||||
if cfg.isNormalUser then {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "networkmanager" ];
|
||||
|
||||
hashedPasswordFile = config.sops.secrets."passwords/ester".path;
|
||||
|
||||
packages = with pkgs; [
|
||||
firefox
|
||||
bitwarden
|
||||
discord
|
||||
];
|
||||
} else {
|
||||
isSystemUser = true;
|
||||
}
|
||||
)
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue