Last active
June 27, 2018 17:10
-
-
Save roberth/7cb1814116457aea6192641948927529 to your computer and use it in GitHub Desktop.
Bash completion and more in nix-shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pkgs.mkShell { | |
buildInputs = [...]; | |
shellHook = '' | |
nixShellAddXdgDataDirs(){ | |
local dirs="$(find $buildInputs -mindepth 1 -maxdepth 1 -path '*/share' -printf ':%p')" | |
dirs=''${dirs/:/} | |
export XDG_DATA_DIRS=''${XDG_DATA_DIRS:-}''${XDG_DATA_DIRS:+''${dirs:+:}}''${dirs} | |
} | |
nixShellAddXdgDataDirs | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment