2024-04-14 07:57:07 +02:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
let
|
2024-04-14 21:22:22 +02:00
|
|
|
isCI = builtins.elem config.syscfg.hostname [ "ci" "sandbox" ];
|
2024-04-21 10:24:22 +02:00
|
|
|
keyFilePath = (if isCI then
|
|
|
|
"/var/lib/sops-nix/mock-key.txt"
|
|
|
|
else
|
|
|
|
"/var/lib/sops-nix/age-key.txt");
|
2024-04-14 07:57:07 +02:00
|
|
|
sopsFilePath = (if isCI then ./mock.yaml else ./common.yaml);
|
|
|
|
in {
|
|
|
|
environment.systemPackages = with pkgs; [ sops ];
|
2024-05-08 18:47:42 +02:00
|
|
|
environment.sessionVariables.SOPS_AGE_KEY_FILE = keyFilePath;
|
2024-04-14 07:57:07 +02:00
|
|
|
|
|
|
|
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" = { };
|
|
|
|
|
|
|
|
}
|