nix-config/modules/base/secrets.nix
2025-09-30 23:24:10 +02:00

50 lines
1.1 KiB
Nix

{
lib,
config,
pkgs,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.horseman.base.secrets;
secretFile = path: ../../secrets/${path};
username = config.horseman.username;
in {
options = {
horseman.base.secrets = {
enable = mkEnableOption "";
};
};
config = mkIf cfg.enable {
environment.systemPackages = [pkgs.ragenix];
age.secrets = {
wifi.file = secretFile "wifi.age";
personalSSHpub = {
file = secretFile "id_personal.pub.age";
owner = username;
group = "users";
path = "/home/horseman/.ssh/id_personal.pub";
};
personalSSH = {
file = secretFile "id_personal.age";
owner = username;
group = "users";
path = "/home/horseman/.ssh/id_personal";
};
githubSSHpub = {
file = secretFile "id_github.pub.age";
owner = username;
group = "users";
path = "/home/horseman/.ssh/id_github.pub";
};
githubSSH = {
file = secretFile "id_github.age";
owner = username;
group = "users";
path = "/home/horseman/.ssh/id_github";
};
};
};
}