2017-06-30 09:04:58 +00:00
|
|
|
let
|
|
|
|
lib = import ./lib;
|
|
|
|
pkgs = import <nixpkgs> { overlays = [(import ./krebs/5pkgs)]; };
|
2017-06-29 20:06:13 +00:00
|
|
|
|
2017-12-05 22:08:36 +00:00
|
|
|
get-version = pkgs.writeDash "get-version" ''
|
2017-06-29 20:06:13 +00:00
|
|
|
set -efu
|
|
|
|
version=git.$(${pkgs.git}/bin/git describe --always --dirty)
|
|
|
|
case $version in (*-dirty)
|
|
|
|
version=$version@$HOSTNAME
|
|
|
|
esac
|
|
|
|
date=$(${pkgs.coreutils}/bin/date +%y.%m)
|
|
|
|
echo "$date.$version"
|
|
|
|
'';
|
|
|
|
|
|
|
|
in pkgs.stdenv.mkDerivation {
|
|
|
|
name = "stockholm";
|
2017-06-30 01:16:24 +00:00
|
|
|
shellHook = /* sh */ ''
|
2017-07-23 20:46:30 +00:00
|
|
|
export OLD_PATH="$PATH"
|
2017-08-15 21:15:39 +00:00
|
|
|
export NIX_PATH=stockholm=${toString ./.}:nixpkgs=${toString <nixpkgs>}
|
2017-07-23 22:05:31 +00:00
|
|
|
if test -e /nix/var/nix/daemon-socket/socket; then
|
|
|
|
export NIX_REMOTE=daemon
|
|
|
|
fi
|
2017-06-29 20:06:13 +00:00
|
|
|
export PATH=${lib.makeBinPath [
|
2017-12-05 22:08:36 +00:00
|
|
|
pkgs.stockholm
|
2017-06-29 20:06:13 +00:00
|
|
|
]}
|
|
|
|
|
|
|
|
eval "$(declare -F | ${pkgs.gnused}/bin/sed s/declare/unset/)"
|
|
|
|
shopt -u no_empty_cmd_completion
|
|
|
|
unalias -a
|
|
|
|
|
|
|
|
enable -n \
|
|
|
|
. [ alias bg bind break builtin caller cd command compgen complete \
|
|
|
|
compopt continue dirs disown eval exec false fc fg getopts hash \
|
|
|
|
help history jobs kill let local logout mapfile popd printf pushd \
|
|
|
|
pwd read readarray readonly shift source suspend test times trap \
|
|
|
|
true typeset ulimit umask unalias wait
|
|
|
|
|
|
|
|
exitHandler() {
|
|
|
|
:
|
|
|
|
}
|
|
|
|
|
|
|
|
export HOSTNAME="$(${pkgs.nettools}/bin/hostname)"
|
2017-12-05 22:08:36 +00:00
|
|
|
export STOCKHOLM_VERSION="''${STOCKHOLM_VERSION-$(${get-version})}"
|
2017-06-29 20:06:13 +00:00
|
|
|
|
|
|
|
PS1='\[\e[38;5;162m\]\w\[\e[0m\] '
|
|
|
|
'';
|
|
|
|
}
|