2023-09-24 03:59:47 +02:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
{
|
|
|
|
environment.systemPackages = [
|
|
|
|
pkgs.ssh-to-age
|
|
|
|
pkgs.sops
|
|
|
|
];
|
|
|
|
|
|
|
|
imports = [ "${builtins.fetchTarball "https://github.com/Mic92/sops-nix/archive/master.tar.gz"}/modules/sops" ];
|
|
|
|
|
|
|
|
# This will add secrets.yml to the nix store
|
|
|
|
# You can avoid this by adding a string to the full path instead, i.e.
|
|
|
|
# sops.defaultSopsFile = "/root/.sops/secrets/example.yaml";
|
2023-12-06 22:21:44 +01:00
|
|
|
sops.defaultSopsFile = "/etc/nixos/nix-dotfiles/secrets/secrets.yaml";
|
|
|
|
sops.validateSopsFiles = false;
|
2023-09-24 03:59:47 +02:00
|
|
|
# This will automatically import SSH keys as age keys
|
2023-10-17 19:42:00 +02:00
|
|
|
sops.age.sshKeyPaths = [
|
2023-12-10 01:20:18 +01:00
|
|
|
"/etc/ssh/nixos"
|
|
|
|
#"/$HOME/.ssh/nixos"
|
|
|
|
#"/home/gunalx/.ssh/nixos"
|
|
|
|
];
|
2023-09-24 03:59:47 +02:00
|
|
|
# This is using an age key that is expected to already be in the filesystem
|
2023-10-17 19:42:00 +02:00
|
|
|
sops.age.keyFile = "/var/lib/sops-nix/key.txt";
|
2023-09-24 03:59:47 +02:00
|
|
|
# This will generate a new key if the key specified above does not exist
|
2023-10-17 19:42:00 +02:00
|
|
|
sops.age.generateKey = true;
|
2023-09-24 03:59:47 +02:00
|
|
|
|
|
|
|
# This is the actual specification of the secrets.
|
|
|
|
#sops.secrets."myservice/my_subdir/my_secret" = {};
|
2023-12-06 22:21:44 +01:00
|
|
|
sops.secrets."acme/certs" = { };
|
2023-12-10 01:20:18 +01:00
|
|
|
sops.secrets."nginx/defaultpass" = { };
|
2023-09-24 03:59:47 +02:00
|
|
|
|
|
|
|
}
|