users: fmt, stan: add root and fix default user name

This commit is contained in:
Aaron Bieber 2024-03-22 07:47:22 -06:00
parent 93108cf3b0
commit 178b2ebeb6
No known key found for this signature in database
2 changed files with 17 additions and 9 deletions

View File

@ -159,12 +159,20 @@ in
mode = "400"; mode = "400";
neededForUsers = true; neededForUsers = true;
}; };
root_hash = {
sopsFile = config.xin-secrets.stan.user_passwords.root;
owner = "root";
mode = "400";
neededForUsers = true;
};
}; };
users = { users = {
mutableUsers = false; mutableUsers = false;
users = { users = {
root = userBase; root = userBase // {
hashedPasswordFile = config.sops.secrets.root_hash.path;
};
abieber = userBase // { abieber = userBase // {
isNormalUser = true; isNormalUser = true;
description = "Aaron Bieber"; description = "Aaron Bieber";

View File

@ -35,15 +35,16 @@ in
{ {
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
secrets = mkMerge [ secrets = mkMerge [
({ {
root_hash = root_hash =
{ {
name = "hash";
sopsFile = config.xin-secrets.${config.networking.hostName}.user_passwords.root; sopsFile = config.xin-secrets.${config.networking.hostName}.user_passwords.root;
owner = "root"; owner = "root";
mode = "400"; mode = "400";
neededForUsers = true; neededForUsers = true;
}; };
}) }
(mkIf hasQbit { (mkIf hasQbit {
qbit_hash = { qbit_hash = {
sopsFile = config.xin-secrets.${config.networking.hostName}.user_passwords.qbit; sopsFile = config.xin-secrets.${config.networking.hostName}.user_passwords.qbit;
@ -57,12 +58,11 @@ in
users = { users = {
mutableUsers = false; mutableUsers = false;
users = mkMerge [ users = mkMerge [
( {
{ root = userBase // {
root = userBase // { hashedPasswordFile = config.sops.secrets.root_hash.path;
hashedPasswordFile = config.sops.secrets.root_hash.path; };
}; }
})
(mkIf hasQbit { (mkIf hasQbit {
qbit = userBase // { qbit = userBase // {
isNormalUser = true; isNormalUser = true;