31 lines
947 B
Nix
Raw Normal View History

2023-11-24 19:08:21 +01:00
{ config, pkgs, ... }:
2024-04-13 09:32:22 +02:00
let
keyFilePath = "/var/lib/sops-nix/age-key.txt";
isCI = builtins.elem config.hostcfg.hostname [ "ci" ];
sopsSettings = {
sops.defaultSopsFile = ./common.yaml;
sops.age.keyFile = keyFilePath;
sops.age.generateKey = true;
2023-04-12 20:32:07 +02:00
2024-04-13 09:32:22 +02:00
sops.secrets.wifi = { };
2023-11-04 02:28:27 +01:00
2024-04-13 09:32:22 +02:00
sops.secrets."${config.hostcfg.hostname}_ssh_priv" = {
mode = "0400";
owner = config.users.users.sora.name;
group = config.users.users.sora.group;
};
sops.secrets."${config.hostcfg.hostname}_ssh_pub" = {
mode = "0400";
owner = config.users.users.sora.name;
group = config.users.users.sora.group;
};
sops.secrets."${config.hostcfg.hostname}_wg_priv" = { };
sops.secrets."${config.hostcfg.hostname}_wg_pub" = { };
2023-04-12 20:32:07 +02:00
};
2024-04-13 09:32:22 +02:00
in {
2023-11-04 02:28:27 +01:00
environment.systemPackages = with pkgs; [ sops ];
2023-11-24 19:08:21 +01:00
environment.sessionVariables.OPS_AGE_KEY_FILE = keyFilePath;
2024-04-13 09:32:22 +02:00
inherit (if isCI then { } else sopsSettings) sops;
2023-04-12 20:32:07 +02:00
}