nixos-configs/nixos/sops.nix

23 lines
423 B
Nix
Raw Normal View History

2024-10-26 18:33:47 +00:00
{
inputs,
pkgs,
flake,
2024-10-27 11:23:20 +00:00
config,
lib,
2024-10-26 18:33:47 +00:00
...
2024-10-27 11:23:20 +00:00
}: let
cfg = config.pim.sops;
in {
2024-10-26 18:33:47 +00:00
imports = [inputs.sops-nix.nixosModules.sops];
2024-10-27 11:23:20 +00:00
options.pim.sops.enable = lib.mkEnableOption "sops";
2024-10-26 18:24:13 +00:00
2024-10-27 11:23:20 +00:00
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [sops];
2024-10-26 18:24:13 +00:00
2024-10-27 11:23:20 +00:00
sops = {
age.keyFile = "/home/pim/.config/sops/age/keys.txt";
defaultSopsFile = "${flake}/secrets/secrets.yaml";
};
2024-10-26 18:24:13 +00:00
};
}