Files
nixos-blueprint/hosts/dunamis/sops.nix
unexplrd 3f602f925f flake.lock: update mysecrets
hosts/dunamis/sops.nix: make it more composable

Signed-off-by: unexplrd <unexplrd@linerds.us>
2025-03-29 20:42:18 +02:00

63 lines
1.4 KiB
Nix

{
config,
inputs,
...
}: let
s = inputs.mysecrets;
hostname = config.networking.hostName;
sopsFile = "${s}/hosts/${hostname}.yaml";
in {
imports = with inputs; [
sops-nix.nixosModules.sops
];
sops = {
age = {
sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"];
keyFile = "/var/lib/sops-nix/key.txt";
generateKey = true;
};
defaultSopsFile = "${s}/common.yaml";
secrets = {
"user-password-hashed".neededForUsers = true;
"ssh-config" = {
path = "/home/user/.ssh/config";
mode = "0400";
owner = "user";
};
"ssh-${hostname}-user" = {
inherit sopsFile;
path = "/home/user/.ssh/id_ed25519";
mode = "0400";
owner = "user";
};
"ssh-${hostname}-user.pub" = {
inherit sopsFile;
path = "/home/user/.ssh/id_ed25519.pub";
mode = "0400";
owner = "user";
};
"ssh-unexplrd" = {
path = "/home/user/.ssh/id_unexplrd_ed25519";
mode = "0400";
owner = "user";
};
"ssh-unexplrd.pub" = {
path = "/home/user/.ssh/id_unexplrd_ed25519.pub";
mode = "0400";
owner = "user";
};
"ssh-uni" = {
path = "/home/user/.ssh/id_uni_ed25519";
mode = "0400";
owner = "user";
};
"ssh-uni.pub" = {
path = "/home/user/.ssh/id_uni_ed25519.pub";
mode = "0400";
owner = "user";
};
};
};
}