shell: rename hook attribute to shell
This commit is contained in:
parent
a2ea8740a4
commit
c500d72ad8
17
shell.nix
17
shell.nix
@ -121,32 +121,27 @@
|
|||||||
|
|
||||||
utils.build = pkgs.writeDash "utils.build" ''
|
utils.build = pkgs.writeDash "utils.build" ''
|
||||||
set -efu
|
set -efu
|
||||||
expr=$1
|
|
||||||
shift
|
|
||||||
${pkgs.nix}/bin/nix-build \
|
${pkgs.nix}/bin/nix-build \
|
||||||
-Q \
|
-Q \
|
||||||
--no-out-link \
|
--no-out-link \
|
||||||
--show-trace \
|
--show-trace \
|
||||||
-E "with import <stockholm>; $expr" \
|
-E "with import <stockholm>; $1" \
|
||||||
-I "$target_path" \
|
-I "$target_path" \
|
||||||
"$@" \
|
|
||||||
2>&1 |
|
2>&1 |
|
||||||
${pkgs.whatsupnix}/bin/whatsupnix
|
${pkgs.whatsupnix}/bin/whatsupnix
|
||||||
'';
|
'';
|
||||||
|
|
||||||
utils.deploy = pkgs.writeDash "utils.deploy" ''
|
utils.deploy = pkgs.writeDash "utils.deploy" ''
|
||||||
set -efu
|
set -efu
|
||||||
PATH=/run/current-system/sw/bin nixos-rebuild \
|
PATH=/run/current-system/sw/bin nixos-rebuild switch \
|
||||||
switch \
|
|
||||||
-Q \
|
-Q \
|
||||||
--show-trace \
|
--show-trace \
|
||||||
-I "$target_path" \
|
-I "$target_path" \
|
||||||
"$@" \
|
|
||||||
2>&1 |
|
2>&1 |
|
||||||
${pkgs.whatsupnix}/bin/whatsupnix
|
${pkgs.whatsupnix}/bin/whatsupnix
|
||||||
'';
|
'';
|
||||||
|
|
||||||
hook.get-version = pkgs.writeDash "hook.get-version" ''
|
shell.get-version = pkgs.writeDash "shell.get-version" ''
|
||||||
set -efu
|
set -efu
|
||||||
version=git.$(${pkgs.git}/bin/git describe --always --dirty)
|
version=git.$(${pkgs.git}/bin/git describe --always --dirty)
|
||||||
case $version in (*-dirty)
|
case $version in (*-dirty)
|
||||||
@ -156,7 +151,7 @@
|
|||||||
echo "$date.$version"
|
echo "$date.$version"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
hook.pkg = pkgs.runCommand "hook.pkg" {} /* sh */ ''
|
shell.cmdspkg = pkgs.runCommand "shell.cmdspkg" {} /* sh */ ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
${lib.concatStrings (lib.mapAttrsToList (name: path: /* sh */ ''
|
${lib.concatStrings (lib.mapAttrsToList (name: path: /* sh */ ''
|
||||||
ln -s ${path} $out/bin/${name}
|
ln -s ${path} $out/bin/${name}
|
||||||
@ -168,7 +163,7 @@ in pkgs.stdenv.mkDerivation {
|
|||||||
shellHook = /* sh */ ''
|
shellHook = /* sh */ ''
|
||||||
export NIX_PATH="stockholm=$PWD''${NIX_PATH+:$NIX_PATH}"
|
export NIX_PATH="stockholm=$PWD''${NIX_PATH+:$NIX_PATH}"
|
||||||
export PATH=${lib.makeBinPath [
|
export PATH=${lib.makeBinPath [
|
||||||
hook.pkg
|
shell.cmdspkg
|
||||||
]}
|
]}
|
||||||
|
|
||||||
eval "$(declare -F | ${pkgs.gnused}/bin/sed s/declare/unset/)"
|
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 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\] '
|
PS1='\[\e[38;5;162m\]\w\[\e[0m\] '
|
||||||
'';
|
'';
|
||||||
|
Loading…
Reference in New Issue
Block a user