NixOS + home-manager configs, mirrored from GitLab SaaS. gitlab.com/andreijiroh-dev/nixops-config
nix-flake nixos home-manager nixpkgs nix-flakes
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(home-manager): add VS Code and SSH agent integration scripts

- Introduced detect-vscode-for-git script to set VS Code as the editor
- Enhanced ssh-agent-loader to prevent source loops and manage loading
- Updated shell.nix to integrate both scripts for improved user experience
- Also updated packages.nix to add more packages under
my home-manager config

Signed-off-by: Andrei Jiroh Halili <ajhalili2006@andreijiroh.dev>

+38 -3
+8
misc/bash/lib/detect-vscode-for-git
··· 1 + #!/usr/bin/env bash 2 + # SPDX-License-Identifier: MPL-2.0 3 + # Sets EDITOR and related variables to use VS Code instead of firing up nano (or worse vi), 4 + # based on env var detection of VSCODE_* vars. 5 + 6 + if [[ -n $VSCODE_IPC_HOOK_CLI && -n $VSCODE_GIT_IPC_HANDLE ]]; then 7 + export GIT_EDITOR="code --wait" EDITOR="code --wait" VISUAL="code --wait" 8 + fi
+6 -2
misc/bash/lib/ssh-agent-loader
··· 88 88 fi 89 89 } 90 90 91 - # automatically detect things as we source this 92 - ssh-agent-loader auto 91 + # Avoid source loops on subsequent file resourcing. 92 + if [[ -z "$SSH_AGENT_LOADED" ]]; then 93 + # automatically detect things as we source this 94 + [[ "$FF_SKIP_AUTO_SSH_AGENT_LOADER" == "" ]] && ssh-agent-loader auto 95 + export SSH_AGENT_LOADED=1 96 + fi
+11 -1
shared/home-manager/packages.nix
··· 48 48 gnupg 49 49 gpg-tui 50 50 # imported from my nix profile list to avoid conflicts # 51 - gpgme 51 + gpgme 52 52 jq 53 53 54 54 ## programming languages ··· 81 81 tmux 82 82 openssl 83 83 unrar-wrapper 84 + storj-uplink 84 85 ]; 86 + 87 + programs.bashmount = { 88 + enable = true; 89 + }; 90 + 91 + programs.bat = { 92 + enable = true; 93 + extraPackages = with pkgs.bat-extras; [ batdiff batman batgrep batwatch ]; 94 + }; 85 95 }
+13
shared/home-manager/shell.nix
··· 38 38 "ignoredups" 39 39 "ignorespace" 40 40 ]; 41 + enableVteIntegration = true; 42 + profileExtra = '' 43 + # source our ssh-agent-loader first 44 + FF_SKIP_AUTO_SSH_AGENT_LOADER=true source ${../../misc/bash/lib/ssh-agent-loader} 45 + 46 + # try to use keychain in this situation 47 + ssh-agent-loader keychain 48 + ''; 49 + bashrcExtra = '' 50 + # detect if we are inside VS Code 51 + source ${../../misc/bash/lib/detect-vscode-for-git} 52 + ''; 41 53 initExtra = '' 42 54 # source our ssh-agent-loader first 55 + unset SSH_AGENT_LOADED 43 56 source ${../../misc/bash/lib/ssh-agent-loader} 44 57 45 58 # hack around for 1Password CLI when 1Password desktop app is up