Files
sydnix/modules/home/sops.nix
2025-03-13 13:59:07 -06:00

31 lines
675 B
Nix
Executable File

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