1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

nix-script: resolve drv path

This commit is contained in:
Daiderd Jordan 2016-12-26 23:53:55 +01:00
parent bc5fc1af32
commit 3ec1300c67
No known key found for this signature in database
GPG key ID: D02435D05B810C96
2 changed files with 21 additions and 3 deletions

View file

@ -22,7 +22,8 @@
system.defaults.trackpad.Clicking = true;
environment.systemPackages =
[ pkgs.curl
[ pkgs.lnl.nix-script
pkgs.curl
pkgs.fzf
pkgs.gettext
pkgs.git
@ -133,7 +134,7 @@
environment.shellAliases.gl = "git log --graph --oneline";
environment.shellAliases.gd = "git diff --minimal --patch";
environment.shellAliases.nix = "${pkgs.lnl.nix-script}/bin/nix";
# environment.shellAliases.nix = "${pkgs.lnl.nix-script}/bin/nix";
nix.nixPath =
[ # Use local nixpkgs checkout instead of channels.

View file

@ -104,6 +104,7 @@ while [ "$#" -gt 0 ]; do
extraNixFlags+=("$i" "$j")
;;
--option|--arg|--argstr)
# nix-build
if [ -z "$1" -o -z "$2" ]; then
echo "$0: \`$i' requires two arguments"
exit 1
@ -112,9 +113,25 @@ while [ "$#" -gt 0 ]; do
k="$1"; shift 1
extraNixFlags+=("$i" "$j" "$k")
;;
--gc|--print-roots|--print-live|--print-dead)
# nix-store
extraNixFlags+=("$i")
;;
-r|--max-freed)
# nix-store
if [ -z "$1" ]; then
echo "$0: \`$i' requires an argument"
exit 1
fi
j="$1"; shift 1
extraNixFlags+=("$i" "$j")
;;
--)
break
;;
*'.drv')
src=$(readlink "$i")
;;
'./'*|'<'*'>')
src="$i"
;;
@ -173,7 +190,7 @@ if [ "$action" = hash ]; then
fi
if [ "$action" = store ]; then
exec nix-store ${extraNixFlags[@]} "$exprArg"
exec nix-store ${extraNixFlags[@]}
fi
if [ "$action" = repl ]; then