Alias to checkout the current nixos version

Published on 23.05.2014
Published in git nixos

When changing things in the nixpkgs repo it is often useful to checkout the commit that corresponds to the current system. That helps to avoid rebuilds and therefore saves a lot of time depending on the difference between the current system and HEAD.

Therefore I have created an git alias that extracts the commit hash from nixos-version and checks out this commit.

[alias] nixos-version = !git checkout $(nixos-version | awk -F' ' '{print $1}' | rev | cut -c1-7 | rev)

Edit: Use a different approach to extract the hash. The old one was unreliable.

Leave a Reply

Comments

Kommentare für diesen Eintrag als RSS Feed
No comments