feat: write cursed function so that secrets are host-based

This commit is contained in:
Ahwx 2025-07-30 13:24:21 +02:00
parent 83ea9f4916
commit fdc031ea4d

View file

@ -2,18 +2,29 @@
pkgs, pkgs,
inputs, inputs,
username, username,
host,
... ...
}: }:
{ {
imports = [ inputs.sops-nix.nixosModules.sops ]; imports = [ inputs.sops-nix.nixosModules.sops ];
sops = { sops = {
defaultSopsFile = ../../secrets/secrets.yaml; defaultSopsFile = ../../secrets/${host}/secrets.yaml;
defaultSopsFormat = "yaml"; defaultSopsFormat = "yaml";
age.keyFile = "/home/${username}/.config/sops/age/keys.txt"; age.keyFile = "/home/${username}/.config/sops/age/keys.txt";
secrets = { secrets =
if (host == "violet") then
{
"systemMailerPassword" = { }; "systemMailerPassword" = { };
}; "forgejoWorkerSecret" = { };
"matrixRegistrationSecret" = { };
}
else if (host == "sakura") then
{
"systemMailerPassword" = { };
}
else
{ };
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [