From 7db39f9f1282d038bdaab259d3fa62d3a3ece00f Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 8 Jan 2017 07:51:19 +0100 Subject: switch: Tag current channel commit hash in channel tag --- nix-script-switch.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nix-script-switch.sh b/nix-script-switch.sh index 7fc3b9c..3c97d76 100755 --- a/nix-script-switch.sh +++ b/nix-script-switch.sh @@ -22,7 +22,11 @@ usage() { -t Custom tag name - -C Append channel generation in tag (-channel-) + -C Append channel generation in tag (-channel--) + Expl: + : nixos- + : Number of the generation + : SHA1 (abbrev) of the commit of the channel in nixpkgs -p [] Generate the switch tag in the nixpkgs at as well. (default: '$RC_NIXPKGS') @@ -217,7 +221,8 @@ fi if [[ $APPEND_CHANNEL_GEN -eq 1 ]]; then dbg "Appending channel generation to tag name" - TAG_NAME="${TAG_NAME}-channel-$(current_channel_generation)" + commit=$(nixos-version | sed -r 's,(.*)\.(.*)\ (.*),\2,') + TAG_NAME="${TAG_NAME}-channel-$(current_channel_generation)-${commit}" dbg "TAG_NAME = $TAG_NAME" else dbg "Not appending channel generation to tag name" -- cgit v1.2.3