hosts/dunamis/sops.nix: add hostname workaround

hosts/eldrid/sops.nix: add hostname workaround
hosts/sarien/sops.nix: add hostname workaround

Signed-off-by: unexplrd <unexplrd@linerds.us>
This commit is contained in:
2025-04-06 13:49:15 +03:00
parent 1f0bbc9daf
commit b5ed7d822e
3 changed files with 22 additions and 11 deletions

View File

@ -1,8 +1,14 @@
{inputs, ...}: let
{
config,
inputs,
...
}: let
inherit (inputs) mysecrets;
# TODO: stop relying on networking.hostName
hostname = "sarien";
sopsFile = mysecrets + "/hosts/${hostname}.yaml";
hostName =
if (config.networking.hostName == "vylxae")
then "sarien"
else config.networking.hostName;
sopsFile = mysecrets + "/hosts/${hostName}.yaml";
dotSsh = name: "/home/user/.ssh/" + name;
sshKey = {
mode = "0400";
@ -27,12 +33,12 @@ in {
mode = "0400";
owner = "user";
};
"ssh-${hostname}-user" = {
"ssh-${hostName}-user" = {
inherit sopsFile;
inherit (sshKey) mode owner;
path = dotSsh "id_ed25519";
};
"ssh-${hostname}-user.pub" = {
"ssh-${hostName}-user.pub" = {
inherit sopsFile;
inherit (sshKey) mode owner;
path = dotSsh "id_ed25519.pub";