{ pkgs, config, lib, inputs, ... }: let cfg = config.modules.system.sops; in { imports = [ inputs.sops-nix.nixosModules.sops ]; options.modules.system.sops = { enable = lib.mkEnableOption "enables sops"; }; config = lib.mkIf cfg.enable { # enable and configure sops for secrets sops = { defaultSopsFile = ../../secrets/secrets.yaml; defaultSopsFormat = "yaml"; age.keyFile = "/home/blake/.config/sops/age/keys.txt"; secrets = { # define secrets with the following syntax # secret path is the nesting of headings in the yaml file # the secret is auto place in /run/ path allows you to symlink to the /run to where ever is needed # "" = { # owner = ""; # group = ""; # path = "" # }; "tailscale_authkey" = lib.mkIf config.modules.system.tailscale.enable { owner = "root"; }; "borg_passwd" = lib.mkIf config.modules.system.backups.enable { owner = "root"; group = "root"; }; "blake_passwd" = lib.mkIf config.users.blake.enable { owner = "root"; group = "root"; neededForUsers = true; }; # "ssl_blakedheld_crt" = lib.mkIf config.modules.homelab.nginx-proxy.enable { # owner = "nginx"; # group = "nginx"; # }; # # "ssl_blakedheld_key" = lib.mkIf config.modules.homelab.nginx-proxy.enable { # owner = "nginx"; # group = "nginx"; # }; }; }; }; }