mirror of
https://github.com/tuxdotrs/nix-config.git
synced 2026-06-17 10:16:31 +05:30
feat(users): configure user password based on sops secret
This commit is contained in:
@@ -8,6 +8,9 @@
|
|||||||
userEmail,
|
userEmail,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
let
|
||||||
|
hasPasswordSecret = lib.hasAttrByPath [ "sops" "secrets" "tux-password" ] config;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
|
|
||||||
@@ -31,7 +34,8 @@
|
|||||||
mutableUsers = false;
|
mutableUsers = false;
|
||||||
defaultUserShell = pkgs.zsh;
|
defaultUserShell = pkgs.zsh;
|
||||||
users.${userName} = {
|
users.${userName} = {
|
||||||
hashedPasswordFile = config.sops.secrets.tux-password.path;
|
hashedPasswordFile = lib.mkIf hasPasswordSecret config.sops.secrets.tux-password.path;
|
||||||
|
initialPassword = lib.mkIf (!hasPasswordSecret) userName;
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
extraGroups = [
|
extraGroups = [
|
||||||
"networkmanager"
|
"networkmanager"
|
||||||
|
|||||||
Reference in New Issue
Block a user