europa/stan: make peerix private key owner dynamic

This commit is contained in:
Aaron Bieber 2022-09-01 12:42:47 -06:00
parent 61913c8182
commit 9217f91383
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, ... }:
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 {
_module.args.isUnstable = true;
@ -31,7 +36,7 @@ in {
};
peerix_private_key = {
sopsFile = config.xin-secrets.europa.peerix;
owner = "peerix";
owner = "${peerixUser}";
group = "wheel";
mode = "400";
};

View File

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