From fdc031ea4d27370c7ced25fa18f3e8a4d5548e3c Mon Sep 17 00:00:00 2001 From: Ahwx Date: Wed, 30 Jul 2025 13:24:21 +0200 Subject: [PATCH] feat: write cursed function so that secrets are host-based --- modules/core/sops.nix | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/modules/core/sops.nix b/modules/core/sops.nix index d57f4d9..ddb6ee7 100644 --- a/modules/core/sops.nix +++ b/modules/core/sops.nix @@ -2,18 +2,29 @@ pkgs, inputs, username, + host, ... }: { imports = [ inputs.sops-nix.nixosModules.sops ]; sops = { - defaultSopsFile = ../../secrets/secrets.yaml; + defaultSopsFile = ../../secrets/${host}/secrets.yaml; defaultSopsFormat = "yaml"; age.keyFile = "/home/${username}/.config/sops/age/keys.txt"; - secrets = { - "systemMailerPassword" = { }; - }; + secrets = + if (host == "violet") then + { + "systemMailerPassword" = { }; + "forgejoWorkerSecret" = { }; + "matrixRegistrationSecret" = { }; + } + else if (host == "sakura") then + { + "systemMailerPassword" = { }; + } + else + { }; }; environment.systemPackages = with pkgs; [