Files
sydnix/modules/home/sops.nix
Madeleine Sydney 52dc849c67 feat: Manage secrets w/ sops-nix
Closes #1
2024-12-29 01:42:01 -07:00

29 lines
620 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let cfg = config.sydnix.sops;
in {
options = {
sydnix.sops = {
enable = mkEnableOption "Sops";
keyFile = mkOption {
description = "Path to an Age key file.";
type = types.path;
default = config.home.homeDirectory + "/key.txt";
};
secrets = mkOption {
description = "Secrets passed directly to sops-nix.";
};
};
};
config = mkIf cfg.enable {
sops = {
age.keyFile = cfg.keyFile;
defaultSopsFile = ../../users/${config.home.username}/secrets.yaml;
secrets = cfg.secrets;
};
};
}