europa/stan: make peerix private key owner dynamic

This commit is contained in:
Aaron Bieber 2022-09-01 12:42:47 -06:00
parent 921a1f92f6
commit 55dbf93bfc
No known key found for this signature in database
2 changed files with 13 additions and 4 deletions

View File

@ -1,5 +1,10 @@
{ config, pkgs, lib, modulesPath, ... }: { config, pkgs, lib, modulesPath, ... }:
let myEmacs = pkgs.callPackage ../../configs/emacs.nix { }; let
myEmacs = pkgs.callPackage ../../configs/emacs.nix { };
peerixUser = if builtins.hasAttr "peerix" config.users.users then
config.users.users.peerix.name
else
"root";
in { in {
_module.args.isUnstable = true; _module.args.isUnstable = true;
@ -31,7 +36,7 @@ in {
}; };
peerix_private_key = { peerix_private_key = {
sopsFile = config.xin-secrets.europa.peerix; sopsFile = config.xin-secrets.europa.peerix;
owner = "peerix"; owner = "${peerixUser}";
group = "wheel"; group = "wheel";
mode = "400"; mode = "400";
}; };

View File

@ -7,6 +7,10 @@ let
userBase = { openssh.authorizedKeys.keys = pubKeys; }; userBase = { openssh.authorizedKeys.keys = pubKeys; };
myEmacs = pkgs.callPackage ../../configs/emacs.nix { }; myEmacs = pkgs.callPackage ../../configs/emacs.nix { };
peerixUser = if builtins.hasAttr "peerix" config.users.users then
config.users.users.peerix.name
else
"root";
in { in {
_module.args.isUnstable = true; _module.args.isUnstable = true;
imports = [ ./hardware-configuration.nix ../../overlays/default.nix ]; imports = [ ./hardware-configuration.nix ../../overlays/default.nix ];
@ -62,8 +66,8 @@ in {
}; };
peerix_private_key = { peerix_private_key = {
sopsFile = config.xin-secrets.stan.peerix; sopsFile = config.xin-secrets.stan.peerix;
owner = "peerix"; owner = "${peerixUser}";
group = "peerix"; group = "wheel";
mode = "400"; mode = "400";
}; };
}; };