soraefir 8a09c870d7
All checks were successful
Nix Build / build-nixos (push) Successful in 14m29s
mockkey path
2024-04-21 02:32:38 +02:00

31 lines
1.0 KiB
Nix
Executable File

{ config, pkgs, ... }:
let
isCI = builtins.elem config.syscfg.hostname [ "ci" "sandbox" ];
keyFilePath =
(if isCI then "./mock-key.txt" else "/var/lib/sops-nix/age-key.txt");
sopsFilePath = (if isCI then ./mock.yaml else ./common.yaml);
in {
environment.systemPackages = with pkgs; [ sops ];
environment.sessionVariables.OPS_AGE_KEY_FILE = keyFilePath;
sops.defaultSopsFile = sopsFilePath;
sops.age.keyFile = keyFilePath;
sops.age.generateKey = true;
sops.secrets.wifi = { };
sops.secrets."${config.syscfg.hostname}_ssh_priv" = {
mode = "0400";
owner = config.users.users.${config.syscfg.defaultUser}.name;
group = config.users.users.${config.syscfg.defaultUser}.group;
};
sops.secrets."${config.syscfg.hostname}_ssh_pub" = {
mode = "0400";
owner = config.users.users.${config.syscfg.defaultUser}.name;
group = config.users.users.${config.syscfg.defaultUser}.group;
};
sops.secrets."${config.syscfg.hostname}_wg_priv" = { };
sops.secrets."${config.syscfg.hostname}_wg_pub" = { };
}