summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2017-01-08 07:51:19 +0100
committerMatthias Beyer <mail@beyermatthias.de>2017-01-08 07:55:58 +0100
commit7db39f9f1282d038bdaab259d3fa62d3a3ece00f (patch)
tree4b3bb5c018ad4614109afe588d3df05385087680
parentb651e1fd17a2fda80dfc861231922b468180077b (diff)
switch: Tag current channel commit hash in channel tag
-rwxr-xr-xnix-script-switch.sh9
1 files 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 <tagname> Custom tag name
- -C Append channel generation in tag (<tag>-channel-<gen>)
+ -C Append channel generation in tag (<tag>-channel-<gen>-<sha1>)
+ Expl:
+ <tag> : nixos-<hostname>
+ <gen> : Number of the generation
+ <sha1>: SHA1 (abbrev) of the commit of the channel in nixpkgs
-p [<pkgs>] Generate the switch tag in the nixpkgs at <pkgs>
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"