Skip to content

Commit

Permalink
support for XDG apps (#48)
Browse files Browse the repository at this point in the history
The bash-completions package automatically finds the right completion
scripts by looking into XDG_DATA_DIRS. Probably other programs
respecting XDG specs can also benefit from setting that environment
variable.

Thanks to NixOS/nixpkgs#103501 for finding that
gem.
  • Loading branch information
zimbatm committed Nov 24, 2020
1 parent 7045ccb commit 8a8a2af
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mkDevShell/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ let
PATH=''${PATH#${bashBin}:}
export PATH=$DEVSHELL_DIR/bin:${bashBin}:$PATH
# Fill with sensible default for Ubuntu
: "''${XDG_DATA_DIRS:=/usr/local/share:/usr/share}"
# This is used by bash-completions to find new completions on demand
export XDG_DATA_DIRS=$DEVSHELL_DIR/share:$XDG_DATA_DIRS
# Expose the path to nixpkgs
export NIXPKGS_PATH=${toString pkgs.path}
Expand Down Expand Up @@ -119,11 +124,6 @@ let
PS1='\[\033[38;5;202m\][${name}]$(rel_root)\$\[\033[0m\] '
fi
# Load bash completions
for file in "$DEVSHELL_DIR/share/bash-completion/completions/"* ; do
[[ -f "$file" ]] && source "$file"
done
${bash.interactive or ""}
fi # Interactive session
Expand Down

0 comments on commit 8a8a2af

Please sign in to comment.