{ 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; }; }; }