abstract user config

This commit is contained in:
Daylin Morgan 2024-01-28 13:09:34 -06:00
parent b07f50a77a
commit 06ecfb4310
Signed by: daylin
GPG Key ID: C1E52E7DD81DF79F
6 changed files with 47 additions and 23 deletions

View File

@ -30,12 +30,9 @@
security.sudo.wheelNeedsPassword = false;
users.extraUsers = {
users.users = {
daylin = {
shell = pkgs.zsh;
isNormalUser = true;
extraGroups = ["wheel" "docker"];
initialPassword = "nix";
extraGroups = ["docker"];
};
git = {
isNormalUser = true;

View File

@ -1,5 +1,5 @@
{...}: {
users.motd = builtins.readFile ./rune;
users.motdFile = ./rune;
swapDevices = [
{

View File

@ -13,14 +13,5 @@
nix-ld
];
users = {
extraUsers = {
daylin = {
shell = pkgs.zsh;
isNormalUser = true;
extraGroups = ["wheel" "docker" "networkmanager"];
initialPassword = "nix";
};
};
};
users.users.daylin.extraGroups = ["docker"];
}

View File

@ -43,13 +43,19 @@
enableSSHSupport = true;
};
users.users.daylin = {
isNormalUser = true;
shell = pkgs.zsh;
extraGroups = [
"wheel" # sudo
users.users.daylin.extraGroups = [
"video" # backlight control via light
"audio"
];
};
];
# users.users.daylin = {
# isNormalUser = true;
# shell = pkgs.zsh;
# extraGroups = [
# "wheel" # sudo
# "video" # backlight control via light
# "audio"
# ];
# };
}

View File

@ -1,5 +1,6 @@
{inputs, ...}: {
imports = with inputs.self.nixosModules; [
users
nix
cli
dev

29
modules/users/default.nix Normal file
View File

@ -0,0 +1,29 @@
{
nixpkgs,
config,
lib,
pkgs,
...
}: let
inherit (lib) mkOption mkIf types;
cfg = config.users.defaultUser;
in {
options.users.defaultUser = mkOption {
default = true;
type = types.bool;
description = ''
include default user "daylin"
'';
};
config = mkIf cfg {
users.users.daylin = {
isNormalUser = true;
shell = pkgs.zsh;
extraGroups = [
"wheel" # sudo
];
initialPassword = "nix";
};
};
}