sisyphus/nixos/modules-old/utils/sops/default.nix

48 lines
1.1 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
sops
];
sops = {
# Add secrets.yml to the nix store
defaultSopsFile = ../../../secrets/secrets.yaml;
age = {
# Automatically import SSH keys as age keys
sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
# Use an age key that is expected to already be in the filesystem
keyFile = "/var/lib/sops-nix/key.txt";
# Generate new keys if the key specified above does not exist
2023-09-11 12:49:47 +02:00
# generateKey = true;
};
2023-09-21 16:53:34 +02:00
secrets =
let
user = config.users.users.tdpeuter.name;
2023-10-05 21:09:36 +02:00
Hugo = {
format = "yaml";
sopsFile = ../../../secrets/Hugo.yaml;
owner = user;
};
UGent = {
2023-10-10 21:14:05 +02:00
format = "yaml";
sopsFile = ../../../secrets/UGent.yaml;
owner = user;
};
2023-10-05 21:09:36 +02:00
in {
"Hugo/ssh" = Hugo;
"UGent/HPC/ssh" = UGent;
"GitHub/ssh" = {
2023-09-21 16:53:34 +02:00
format = "yaml";
2023-10-05 21:09:36 +02:00
sopsFile = ../../../secrets/GitHub.yaml;
2023-09-21 16:53:34 +02:00
owner = user;
2023-09-11 13:28:41 +02:00
};
2023-10-05 21:09:36 +02:00
"Hugo/Gitea/ssh" = Hugo;
"UGent/GitHub/ssh" = UGent;
2023-10-10 21:14:05 +02:00
"UGent/SubGit/ssh" = UGent;
};
};
}