{ inputs, config, pkgs, lib, ... }: let sopsConfigPath = "${config.xdg.configHome}/home-manager/jsl-home/.sops.yaml"; sopsSecretsPath = "${config.xdg.configHome}/home-manager/jsl-home/keys/secrets.yaml"; in { imports = [ inputs.sops-nix.homeManagerModules.sops ]; sops = { # It's also possible to use a ssh key, but only when it has no password: age.sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ]; defaultSopsFile = ../keys/secrets.yaml; defaultSopsFormat = "yaml"; secrets.gmail_api_credentials = { sopsFile = ../keys/gmail_api_credentials.json; format = "json"; path = "${config.home.homeDirectory}/.config/gmail_api_credentials.json"; }; }; home.packages = with pkgs; [ (writeShellScriptBin "edit-secrets" '' sops --config ${sopsConfigPath} ${sopsSecretsPath} '') sops age ]; programs.zsh.shellAliases.sops = lib.mkIf config.enableShell "sops --config ${sopsConfigPath}"; }