users: clean up sopsFile stuff a bit

This commit is contained in:
Aaron Bieber 2024-03-22 08:21:55 -06:00
parent 2b2425bf51
commit 269a67b52d
No known key found for this signature in database

View File

@ -25,8 +25,10 @@ in
config =
let
inherit (config.networking) hostName;
secretAttrs = config.xin-secrets.${hostName}.user_passwords;
hasQbit =
if builtins.hasAttr "qbit" config.xin-secrets.${config.networking.hostName}.user_passwords then
if builtins.hasAttr "qbit" secretAttrs then
true
else false;
in
@ -39,7 +41,7 @@ in
root_hash =
{
name = "hash";
sopsFile = config.xin-secrets.${config.networking.hostName}.user_passwords.root;
sopsFile = secretAttrs.root;
owner = "root";
mode = "400";
neededForUsers = true;
@ -47,7 +49,7 @@ in
}
(mkIf hasQbit {
qbit_hash = {
sopsFile = config.xin-secrets.${config.networking.hostName}.user_passwords.qbit;
sopsFile = secretAttrs.qbit;
owner = "root";
mode = "400";
neededForUsers = true;