summaryrefslogtreecommitdiff
path: root/modules/root/normaluser.nix
diff options
context:
space:
mode:
authorTim Keller <tjk@tjkeller.xyz>2025-07-17 20:03:16 -0500
committerTim Keller <tjk@tjkeller.xyz>2025-07-17 20:03:16 -0500
commitb74e44f59eff364eb5281f7389f84ae4e3b692fe (patch)
tree31635add1d88af5c8d8f7eccf1267abaa0a9423f /modules/root/normaluser.nix
parent991ae9037461f2993f0f240be2fe4fe24bbeacb6 (diff)
downloadnixos-b74e44f59eff364eb5281f7389f84ae4e3b692fe.tar.xz
nixos-b74e44f59eff364eb5281f7389f84ae4e3b692fe.zip
cleanup secrets into different files and optional set user password etc
Diffstat (limited to 'modules/root/normaluser.nix')
-rw-r--r--modules/root/normaluser.nix35
1 files changed, 20 insertions, 15 deletions
diff --git a/modules/root/normaluser.nix b/modules/root/normaluser.nix
index 3bb9adc..ec266c4 100644
--- a/modules/root/normaluser.nix
+++ b/modules/root/normaluser.nix
@@ -1,18 +1,23 @@
-{ config, userDetails, ... }: {
- users.users.root = {
- hashedPasswordFile = config.sops.secrets.hashed-root-password.path;
+{ lib, config, userDetails, ... }: {
+ options = {
+ users.setPassword.enable = lib.mkEnableOption "set users password. requires hashed root password from sops";
};
- users.users.${userDetails.username} = {
- description = userDetails.fullname;
- #home = userDetails.home;
- isNormalUser = true;
- hashedPasswordFile = config.sops.secrets.hashed-root-password.path;
- extraGroups = [
- "i2c"
- "libvirtd"
- "nixbld"
- "video"
- "wheel"
- ];
+
+ config = {
+ users.users.root = lib.mkIf config.users.setPassword.enable {
+ hashedPasswordFile = config.sops.secrets.hashed-root-password.path;
+ };
+ users.users.${userDetails.username} = {
+ description = userDetails.fullname;
+ isNormalUser = true;
+ hashedPasswordFile = lib.mkIf config.users.setPassword.enable config.sops.secrets.hashed-root-password.path;
+ extraGroups = [
+ "i2c"
+ "libvirtd"
+ "nixbld"
+ "video"
+ "wheel"
+ ];
+ };
};
}