summaryrefslogtreecommitdiffstats
path: root/shell.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2017-08-15 23:34:10 +0200
committerlassulus <lassulus@lassul.us>2017-08-15 23:34:10 +0200
commit9fc1e0fba24ecfc765dedd966c0dcb6395aa1da9 (patch)
tree43b39f542c9f6cbea3c80439c2179cb4b4ebebec /shell.nix
parent82a01f5e7abc1009ee406f4a48e2a9d7794e50ae (diff)
parenta48cf7052a176376ec1bfe8da78f0491f6324aa4 (diff)
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'shell.nix')
-rw-r--r--shell.nix15
1 files changed, 11 insertions, 4 deletions
diff --git a/shell.nix b/shell.nix
index bc14fe7d8..a4ccc3187 100644
--- a/shell.nix
+++ b/shell.nix
@@ -9,6 +9,7 @@ let
# usage: deploy
# [--force-populate]
# [--quiet]
+ # [--source=PATH]
# --system=SYSTEM
# [--target=TARGET]
# [--user=USER]
@@ -20,6 +21,7 @@ let
\test -n "''${quiet-}" || quiet=false
\test -n "''${target-}" || target=$system
\test -n "''${user-}" || user=$LOGNAME
+ \test -n "''${source_file}" || source_file=$user/1systems/$system/source.nix
. ${init.env}
. ${init.proxy}
@@ -29,6 +31,7 @@ let
# usage: install
# [--force-populate]
# [--quiet]
+ # [--source=PATH]
# --system=SYSTEM
# --target=TARGET
# [--user=USER]
@@ -39,6 +42,7 @@ let
. ${init.args}
\test -n "''${quiet-}" || quiet=false
\test -n "''${user-}" || user=$LOGNAME
+ \test -n "''${source_file}" || source_file=$user/1systems/$system/source.nix
. ${init.env}
if \test "''${using_proxy-}" != true; then
@@ -76,6 +80,7 @@ let
# usage: test
# [--force-populate]
# [--quiet]
+ # [--source=PATH]
# --system=SYSTEM
# --target=TARGET
# [--user=USER]
@@ -88,6 +93,7 @@ let
. ${init.args}
\test -n "''${quiet-}" || quiet=false
\test -n "''${user-}" || user=$LOGNAME
+ \test -n "''${source_file}" || source_file=$user/1systems/$system/source.nix
. ${init.env}
. ${init.proxy}
@@ -160,14 +166,16 @@ let
init.args = pkgs.writeText "init.args" /* sh */ ''
args=$(${pkgs.utillinux}/bin/getopt -n "$command" -s sh \
-o Qs:t:u: \
- -l force-populate,quiet,system:,target:,user: \
+ -l force-populate,quiet,source:,system:,target:,user: \
-- "$@")
if \test $? != 0; then exit 1; fi
eval set -- "$args"
force_populate=false
+ source_file=
while :; do case $1 in
- --force-populate) force_populate=true; shift;;
+ --force-populate) force_populate=true; shift;;
-Q|--quiet) quiet=true; shift;;
+ --source) source_file=$2; shift 2;;
-s|--system) system=$2; shift 2;;
-t|--target) target=$2; shift 2;;
-u|--user) user=$2; shift 2;;
@@ -196,7 +204,6 @@ let
init.proxy = pkgs.writeText "init.proxy" /* sh */ ''
if \test "''${using_proxy-}" != true; then
- source_file=$user/1systems/$system/source.nix
source=$(get-source "$source_file")
qualified_target=$target_user@$target_host:$target_port$target_path
if \test "$force_populate" = true; then
@@ -269,7 +276,7 @@ in pkgs.stdenv.mkDerivation {
name = "stockholm";
shellHook = /* sh */ ''
export OLD_PATH="$PATH"
- export NIX_PATH=stockholm=$PWD:nixpkgs=${toString <nixpkgs>}
+ export NIX_PATH=stockholm=${toString ./.}:nixpkgs=${toString <nixpkgs>}
if test -e /nix/var/nix/daemon-socket/socket; then
export NIX_REMOTE=daemon
fi