diff --git a/homeManagerModules/default.nix b/homeManagerModules/default.nix index f1b9fde..60293bc 100644 --- a/homeManagerModules/default.nix +++ b/homeManagerModules/default.nix @@ -6,6 +6,7 @@ ./ghostty.nix ./git.nix ./shell.nix + ./sops.nix ./ssh.nix ./vscode.nix diff --git a/homeManagerModules/sops.nix b/homeManagerModules/sops.nix index 2e4e40a..d26e45b 100644 --- a/homeManagerModules/sops.nix +++ b/homeManagerModules/sops.nix @@ -1,13 +1,19 @@ -{ inputs, config, pkgs, lib, ... }: +{ config, pkgs, lib, ... }: let sopsConfigPath = "${config.home.homeDirectory}/.config/home-manager/jsl-home/.sops.yaml"; + sopsSecretsPath = "${config.home.homeDirectory}/.config/home-manager/jsl-home/keys/secrets.yaml"; in { sops = { # It's also possible to use a ssh key, but only when it has no password: - sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ]; - defaultSopsFile = ./secrets.yaml; + age.sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ]; + defaultSopsFile = ../keys/secrets.yaml; defaultSopsFormat = "yaml"; }; - programs.zsh.shellAliases.sops = lib.mkIf config.enableShell "${pkgs.sops-nix}/bin/sops --config ${sopsConfigPath}"; + home.packages = with pkgs; [ + (writeShellScriptBin "edit-secrets" '' + sops --config ${sopsConfigPath} ${sopsSecretsPath} + '') + ]; + programs.zsh.shellAliases.sops = lib.mkIf config.enableShell "sops --config ${sopsConfigPath}"; } \ No newline at end of file