users: clean up sopsFile stuff a bit
This commit is contained in:
parent
2b2425bf51
commit
269a67b52d
@ -25,8 +25,10 @@ in
|
|||||||
|
|
||||||
config =
|
config =
|
||||||
let
|
let
|
||||||
|
inherit (config.networking) hostName;
|
||||||
|
secretAttrs = config.xin-secrets.${hostName}.user_passwords;
|
||||||
hasQbit =
|
hasQbit =
|
||||||
if builtins.hasAttr "qbit" config.xin-secrets.${config.networking.hostName}.user_passwords then
|
if builtins.hasAttr "qbit" secretAttrs then
|
||||||
true
|
true
|
||||||
else false;
|
else false;
|
||||||
in
|
in
|
||||||
@ -39,7 +41,7 @@ in
|
|||||||
root_hash =
|
root_hash =
|
||||||
{
|
{
|
||||||
name = "hash";
|
name = "hash";
|
||||||
sopsFile = config.xin-secrets.${config.networking.hostName}.user_passwords.root;
|
sopsFile = secretAttrs.root;
|
||||||
owner = "root";
|
owner = "root";
|
||||||
mode = "400";
|
mode = "400";
|
||||||
neededForUsers = true;
|
neededForUsers = true;
|
||||||
@ -47,7 +49,7 @@ in
|
|||||||
}
|
}
|
||||||
(mkIf hasQbit {
|
(mkIf hasQbit {
|
||||||
qbit_hash = {
|
qbit_hash = {
|
||||||
sopsFile = config.xin-secrets.${config.networking.hostName}.user_passwords.qbit;
|
sopsFile = secretAttrs.qbit;
|
||||||
owner = "root";
|
owner = "root";
|
||||||
mode = "400";
|
mode = "400";
|
||||||
neededForUsers = true;
|
neededForUsers = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user