feat(wsl): enable nix-ld for VSCode Remote and auto-generate sops age key from ed25519

This commit is contained in:
2026-04-13 13:37:06 +08:00
parent e77f561747
commit 2a1fb40fd3
2 changed files with 16 additions and 1 deletions
+13 -1
View File
@@ -1,4 +1,4 @@
{ config, ... }:
{ config, pkgs, ... }:
{
sops = {
@@ -14,6 +14,18 @@
};
};
# Generate age key from ed25519 SSH key for sops CLI
home.activation.sopsAgeKey = config.lib.dag.entryAfter [ "writeBoundary" ] ''
KEY_DIR="${config.home.homeDirectory}/.config/sops/age"
KEY_FILE="$KEY_DIR/keys.txt"
SSH_KEY="${config.home.homeDirectory}/.ssh/id_ed25519"
if [ -f "$SSH_KEY" ] && [ ! -f "$KEY_FILE" ]; then
mkdir -p "$KEY_DIR"
${pkgs.ssh-to-age}/bin/ssh-to-age -private-key -i "$SSH_KEY" > "$KEY_FILE"
chmod 600 "$KEY_FILE"
fi
'';
programs.fish.interactiveShellInit = ''
# sops-nix secrets env vars
for pair in \