refactor: transition secrets to sops-nix instead of relying on hard-coded paths

This commit is contained in:
2026-10-21 12:40:01 -04:00
parent 36aa9a054e
commit 2167861451
9 changed files with 125 additions and 18 deletions
+11 -13
View File
@@ -1,7 +1,9 @@
{ inputs, pkgs, ... }:
let
sshSigningKey = builtins.readFile ./ssh-signing-key.pub;
in
{
inputs,
osConfig,
pkgs,
...
}:
{
imports = [
inputs.lazyvim.homeManagerModules.default
@@ -51,17 +53,12 @@ in
bash = {
enable = true;
# Import SSH identities and
# display fastfetch on shell open.
initExtra = ''
eval "$(devenv hook bash)"
[ -f $HOME/.ssh/id_floturcocantsee@daguerro.net ] && ssh-add $HOME/.ssh/id_floturcocantsee@daguerro.net
[ -f $HOME/.ssh/id_rsa ] && ssh-add $HOME/.ssh/id_rsa
clear;fastfetch
'';
};
# Configure ZSH if using darwin (macOS).
zsh =
if pkgs.stdenv.hostPlatform.isDarwin then
{
@@ -69,8 +66,6 @@ in
initContent = ''
eval "$(devenv hook zsh)"
[ -f $HOME/.ssh/id_floturcocantsee@daguerro.net ] && ssh-add --apple-use-keychain $HOME/.ssh/id_floturcocantsee@daguerro.net
[ -f $HOME/.ssh/id_rsa ] && --apple-use-keychain ssh-add $HOME/.ssh/id_rsa
clear;fastfetch
'';
}
@@ -111,7 +106,10 @@ in
enableDefaultConfig = false;
settings."*" = {
AddKeysToAgent = "yes";
IdentityFile = [
osConfig.sops.secrets."personal_ssh_key_ed25519".path
osConfig.sops.secrets."work_ssh_key_rsa".path
];
};
};
@@ -167,7 +165,7 @@ in
lfs.enable = true;
signing = {
key = sshSigningKey;
key = osConfig.sops.secrets."personal_ssh_key_ed25519.pub".path;
signByDefault = true;
};