-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #646 from VILLASframework/packaging-nix
Packaging nix
- Loading branch information
Showing
7 changed files
with
318 additions
and
92 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,34 @@ | ||
|
||
export_or_unset() | ||
{ | ||
local var=$1 | ||
|
||
if [ -z "${!var+x}" ]; then | ||
return | ||
fi | ||
|
||
if [ -n "$2" ]; then | ||
export $var="$2" | ||
else | ||
unset $var | ||
fi | ||
|
||
} | ||
|
||
if direnv_version "2.30.0" \ | ||
&& has nix \ | ||
&& nix show-config experimental-features 2>/dev/null | grep -wqF flakes | ||
then | ||
watch_file ./packaging/nix/*.nix | ||
use flake ./packaging/nix | ||
local oldtmp="$TMP" | ||
local oldtemp="$TEMP" | ||
local oldtmpdir="$TMPDIR" | ||
local oldtempdir="$TEMPDIR" | ||
|
||
watch_file ./packaging/nix/*.nix | ||
use flake ./packaging/nix | ||
|
||
export_or_unset TMP "$oldtmp" | ||
export_or_unset TEMP "$oldtemp" | ||
export_or_unset TMPDIR "$oldtmpdir" | ||
export_or_unset TEMPDIR "$oldtempdir" | ||
fi |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.