mirror of
https://github.com/lloeki/dotfiles.git
synced 2025-12-06 07:24:39 +01:00
Load nix conditionally, allowing extra function definition
This commit is contained in:
parent
13fb27218f
commit
c312511fb3
1 changed files with 6 additions and 2 deletions
8
shell/nix
Normal file → Executable file
8
shell/nix
Normal file → Executable file
|
|
@ -1,7 +1,11 @@
|
|||
if [[ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]]; then
|
||||
if [[ -z "NIX_PATH" && -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]]; then
|
||||
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
|
||||
elif [[ -e "${HOME}/.nix-profile/etc/profile.d/nix.sh" ]]; then
|
||||
elif [[ -z "NIX_PATH" && -e "${HOME}/.nix-profile/etc/profile.d/nix.sh" ]]; then
|
||||
. "${HOME}/.nix-profile/etc/profile.d/nix.sh"
|
||||
fi
|
||||
|
||||
function nix-channel-version() {
|
||||
nix-instantiate --eval -A 'lib.version' '<nixpkgs>'
|
||||
}
|
||||
|
||||
# vim: ft=bash
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue