summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2017-12-05 23:31:16 +0100
committerlassulus <lassulus@lassul.us>2017-12-05 23:31:16 +0100
commitceb4f0fb7e5332e70f9ba54418693124ee6d739e (patch)
treee2e6fe6ef61c2d3a31f0040a5a30533dd299fcb4
parent569ef4fb369b94799c8ef69cb4e6f9cd8a2cdaeb (diff)
parent289dd785e5bd5f3a628a7f0282ed4f8638277c5c (diff)
Merge remote-tracking branch 'ni/master' into HEAD
-rw-r--r--krebs/5pkgs/simple/stockholm/default.nix14
-rw-r--r--shell.nix13
2 files changed, 14 insertions, 13 deletions
diff --git a/krebs/5pkgs/simple/stockholm/default.nix b/krebs/5pkgs/simple/stockholm/default.nix
index 3d9cea64d..da07c8120 100644
--- a/krebs/5pkgs/simple/stockholm/default.nix
+++ b/krebs/5pkgs/simple/stockholm/default.nix
@@ -207,6 +207,10 @@
'');
init.env = pkgs.writeText "init.env" /* sh */ ''
+
+ export HOSTNAME="$(${pkgs.nettools}/bin/hostname)"
+ export STOCKHOLM_VERSION="''${STOCKHOLM_VERSION-$(${shell.get-version})}"
+
export quiet
export system
export target
@@ -274,6 +278,16 @@
fi
'';
+ shell.get-version = pkgs.writeDash "stockholm.get-version" ''
+ 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.writeOut "stockholm" (lib.mapAttrs' (name: link:
diff --git a/shell.nix b/shell.nix
index 69f5e86c0..6c6b7cad7 100644
--- a/shell.nix
+++ b/shell.nix
@@ -2,16 +2,6 @@ let
lib = import ./lib;
pkgs = import <nixpkgs> { overlays = [(import ./krebs/5pkgs)]; };
- get-version = pkgs.writeDash "get-version" ''
- 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";
shellHook = /* sh */ ''
@@ -39,9 +29,6 @@ in pkgs.stdenv.mkDerivation {
:
}
- export HOSTNAME="$(${pkgs.nettools}/bin/hostname)"
- export STOCKHOLM_VERSION="''${STOCKHOLM_VERSION-$(${get-version})}"
-
PS1='\[\e[38;5;162m\]\w\[\e[0m\] '
'';
}