From c500d72ad855418b7d4d9d852d423a8a9440285c Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 30 Jun 2017 09:43:33 +0200 Subject: shell: rename hook attribute to shell --- shell.nix | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'shell.nix') diff --git a/shell.nix b/shell.nix index d6d21586..782b4fa3 100644 --- a/shell.nix +++ b/shell.nix @@ -121,32 +121,27 @@ utils.build = pkgs.writeDash "utils.build" '' set -efu - expr=$1 - shift ${pkgs.nix}/bin/nix-build \ -Q \ --no-out-link \ --show-trace \ - -E "with import ; $expr" \ + -E "with import ; $1" \ -I "$target_path" \ - "$@" \ 2>&1 | ${pkgs.whatsupnix}/bin/whatsupnix ''; utils.deploy = pkgs.writeDash "utils.deploy" '' set -efu - PATH=/run/current-system/sw/bin nixos-rebuild \ - switch \ + PATH=/run/current-system/sw/bin nixos-rebuild switch \ -Q \ --show-trace \ -I "$target_path" \ - "$@" \ 2>&1 | ${pkgs.whatsupnix}/bin/whatsupnix ''; - hook.get-version = pkgs.writeDash "hook.get-version" '' + shell.get-version = pkgs.writeDash "shell.get-version" '' set -efu version=git.$(${pkgs.git}/bin/git describe --always --dirty) case $version in (*-dirty) @@ -156,7 +151,7 @@ echo "$date.$version" ''; - hook.pkg = pkgs.runCommand "hook.pkg" {} /* sh */ '' + shell.cmdspkg = pkgs.runCommand "shell.cmdspkg" {} /* sh */ '' mkdir -p $out/bin ${lib.concatStrings (lib.mapAttrsToList (name: path: /* sh */ '' ln -s ${path} $out/bin/${name} @@ -168,7 +163,7 @@ in pkgs.stdenv.mkDerivation { shellHook = /* sh */ '' export NIX_PATH="stockholm=$PWD''${NIX_PATH+:$NIX_PATH}" export PATH=${lib.makeBinPath [ - hook.pkg + shell.cmdspkg ]} eval "$(declare -F | ${pkgs.gnused}/bin/sed s/declare/unset/)" @@ -187,7 +182,7 @@ in pkgs.stdenv.mkDerivation { } export HOSTNAME="$(${pkgs.nettools}/bin/hostname)" - export STOCKHOLM_VERSION="''${STOCKHOLM_VERSION-$(${hook.get-version})}" + export STOCKHOLM_VERSION="''${STOCKHOLM_VERSION-$(${shell.get-version})}" PS1='\[\e[38;5;162m\]\w\[\e[0m\] ' ''; -- cgit v1.2.3