diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2017-01-12 16:56:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-12 16:56:13 +0100 |
commit | 0a4d85925a80bf87f8dd1d3bb4726a6ec996f556 (patch) | |
tree | 0c59a17b5d8e92ea342bc979a15cd5d5aaecd39c | |
parent | b651e1fd17a2fda80dfc861231922b468180077b (diff) | |
parent | 62fdb04f4155a073c251676faf87a12112d98e20 (diff) |
Merge pull request #126 from matthiasbeyer/switch-nixpkgs-tag-default
Switch nixpkgs tag default
-rwxr-xr-x | nix-script-switch.sh | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/nix-script-switch.sh b/nix-script-switch.sh index 7fc3b9c..69a04fb 100755 --- a/nix-script-switch.sh +++ b/nix-script-switch.sh @@ -22,10 +22,18 @@ 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') + (Warning: deprecated + This flag is deprecated as tagging with the channel + commit hash is now default + ) -r [<remote>] Update the <remote> in the <pkgs> before tagging. Multiple possible, seperate with spaces. @@ -217,7 +225,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" @@ -234,6 +243,10 @@ if [[ $TAG_NIXPKGS -eq 1 ]] then if [[ ! -z "$NIXPKGS" ]] then + stderr "This option is deprecated." + stderr "Therefor it might be removed in the next version." + stderr "Please complain in the official nixos-scripts repository." + stdout "Trying to generate tag in $NIXPKGS" [[ ! -d "$NIXPKGS" ]] && \ stderr "'$NIXPKGS' is not a directory, so can't be a nixpkgs clone" && \ |