Files
sydnix/modules/home/sops.nix
Madeleine Sydney d203a71aaa feat: Encryption
2025-02-18 15:59:17 -07:00

33 lines
666 B
Nix
Executable File

{ 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 {
home.packages = [
pkgs.sops
];
sops = {
age.keyFile = cfg.keyFile;
defaultSopsFile = ../../users/${config.home.username}/secrets.yaml;
secrets = cfg.secrets;
};
};
}