Set a default user password

This commit is contained in:
Manuel Thalmann 2024-05-02 04:23:57 +02:00
parent 6a0a513465
commit d40c4898e8
3 changed files with 6 additions and 3 deletions

View file

@ -36,6 +36,8 @@
"/etc/ssh/ssh_host_ed25519_key" "/etc/ssh/ssh_host_ed25519_key"
]; ];
}; };
secrets.default_password.neededForUsers = true;
}; };
boot.loader = { boot.loader = {

View file

@ -47,6 +47,7 @@ in {
shell = lib.mkIf shell = lib.mkIf
(user.defaultShell != null) (user.defaultShell != null)
user.defaultShell; user.defaultShell;
hashedPasswordFile = config.sops.secrets.default_password.path;
extraGroups = lib.mkIf user.sudoer [ extraGroups = lib.mkIf user.sudoer [
"wheel" "wheel"
]; ];

View file

@ -1,4 +1,4 @@
default_password: ENC[AES256_GCM,data:Fu7oImuzV9R0cBIof4yxqkA=,iv:HLlmswAvTL9FCvtDjJF1GJs2V9a/sMdF3cQE5LRXARA=,tag:xooPA2X6fS9BzJQRxRg6lQ==,type:str] default_password: ENC[AES256_GCM,data:tltElaIpMnfOTy+6oBle42fBzX6fs9WO79/CKncPfY0dKktLaZmNxUdeSu1kLTNZxSozF7zWyoTKsYUAf8J6Cd6uTvQjLU3lyg==,iv:uWdZYsRWz4kjQuIaanMpQYqkzBTM6GcuDbrszqULv9w=,tag:QiqeNvngBYc/FiXOfU3/sg==,type:str]
hello: ENC[AES256_GCM,data:DrqMebu1YfPvRFdk1BrRMpcuYUhLjdsN7kmde6RD1GAHU80TC63cXJKGZa2U0w==,iv:4jmc4VD4UpeQW8xHwlRvUay3hl+RtQDKDLqntJuJvko=,tag:unv5SvsNXqf/6upLGVvzCw==,type:str] hello: ENC[AES256_GCM,data:DrqMebu1YfPvRFdk1BrRMpcuYUhLjdsN7kmde6RD1GAHU80TC63cXJKGZa2U0w==,iv:4jmc4VD4UpeQW8xHwlRvUay3hl+RtQDKDLqntJuJvko=,tag:unv5SvsNXqf/6upLGVvzCw==,type:str]
example_key: ENC[AES256_GCM,data:0ipg3+BUAKVrCk2kaA==,iv:aELPXsWgX7rpQ8RenuKf7rMvizMNoGEVOv3rs+ONrdI=,tag:RhfPB41QTp4dgfIF9bd6hQ==,type:str] example_key: ENC[AES256_GCM,data:0ipg3+BUAKVrCk2kaA==,iv:aELPXsWgX7rpQ8RenuKf7rMvizMNoGEVOv3rs+ONrdI=,tag:RhfPB41QTp4dgfIF9bd6hQ==,type:str]
#ENC[AES256_GCM,data:IwXJ/UrwHromJcQUQU47VQ==,iv:IPxKuE7XNfiej6z3+nITv/K8rFJdWHxnzrkScB8jciA=,tag:aWbzQEky9UGrIZB3ygHE+w==,type:comment] #ENC[AES256_GCM,data:IwXJ/UrwHromJcQUQU47VQ==,iv:IPxKuE7XNfiej6z3+nITv/K8rFJdWHxnzrkScB8jciA=,tag:aWbzQEky9UGrIZB3ygHE+w==,type:comment]
@ -25,8 +25,8 @@ sops:
dHVEbVh0a3diMXpuMlJLWEtLZ0dITFEKaVRCWGU/1w4zW+sYEkx/uqjlqVMoC6nY dHVEbVh0a3diMXpuMlJLWEtLZ0dITFEKaVRCWGU/1w4zW+sYEkx/uqjlqVMoC6nY
LRAU8FF9dDoyUwa6Tne6V83oyVf205c5tls2vPBIRh59cfiMeFq4qg== LRAU8FF9dDoyUwa6Tne6V83oyVf205c5tls2vPBIRh59cfiMeFq4qg==
-----END AGE ENCRYPTED FILE----- -----END AGE ENCRYPTED FILE-----
lastmodified: "2024-05-01T23:19:51Z" lastmodified: "2024-05-02T01:49:56Z"
mac: ENC[AES256_GCM,data:G/XxH2TBx/ePmUXP0ww1rRCnJf28CfVCb/9INS4k0qPKXee8Y/ClE06tsnyzqeiGH1fjYAMZeR1yXDrc0tcVByNkH+WTzTfsRXEyjZeTV1dx3KtK3hmYWHxKEOurJw0F6sPs8Jnc+gINNMMOrCjqAPvH3Xl2RSEqp3ZQGX3RS54=,iv:sfmNmJ2a5tw7T2q3tcFWbKQm5R8fPAfxV9Vo1dTTApg=,tag:GYgQ6Y+FOrJAF3URiz2vuA==,type:str] mac: ENC[AES256_GCM,data:sxM9JzY8q2Rn64DvZAhKsXnSoq6gj7OQqNG0xktR548x/VHxBq5AmWyu8zWMvgQMjBlQF/kR27DSt4bSY3I3FIl+yQCFRD/lfMCXqNkND7eVGSOFJAEoEIayV8LHV+dgRtxzxZAdw1IYgFlpc2EKgvkulME5GCsupw7zdY+d2NI=,iv:4FBjS/AGoaQUj0h+6NLKNUIL3YSwAVL/0hGi8h2y0rc=,tag:VG/H3N86BHjspslPQXzq6Q==,type:str]
pgp: pgp:
- created_at: "2024-05-01T23:06:06Z" - created_at: "2024-05-01T23:06:06Z"
enc: |- enc: |-