From be5a15f3d4c0df663dd1b276e6cf8cd28bb91bfc Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Mon, 7 Jul 2025 01:10:11 -0500 Subject: [PATCH] moved sops stuff into sops.nix --- homeManagerModules/default.nix | 3 --- homeManagerModules/sops.nix | 7 ++++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/homeManagerModules/default.nix b/homeManagerModules/default.nix index 60293bc..9a30add 100644 --- a/homeManagerModules/default.nix +++ b/homeManagerModules/default.nix @@ -12,7 +12,6 @@ ../nixosModules/options.nix inputs._1password-shell-plugins.hmModules.default - inputs.sops-nix.homeManagerModules.sops ]; nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ @@ -54,8 +53,6 @@ lazygit btop yazi - sops - age (writeShellScriptBin "nhmu" '' nix flake update --flake ~/.config/home-manager nix run home-manager -- switch --flake ~/.config/home-manager --impure diff --git a/homeManagerModules/sops.nix b/homeManagerModules/sops.nix index d26e45b..333cf6b 100644 --- a/homeManagerModules/sops.nix +++ b/homeManagerModules/sops.nix @@ -1,9 +1,12 @@ -{ config, pkgs, lib, ... }: +{ inputs, 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 { + 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" ]; @@ -14,6 +17,8 @@ in (writeShellScriptBin "edit-secrets" '' sops --config ${sopsConfigPath} ${sopsSecretsPath} '') + sops + age ]; programs.zsh.shellAliases.sops = lib.mkIf config.enableShell "sops --config ${sopsConfigPath}"; } \ No newline at end of file