remove hardcodes from "channel" script

This commit is contained in:
Sean Buckley 2020-10-26 14:09:53 -04:00
parent f5eb7d7efa
commit 217e63bbf7

View file

@ -47,9 +47,13 @@
'') '')
(writeShellScriptBin "channel" '' (writeShellScriptBin "channel" ''
echo "$(curl --silent -L https://channels.nixos.org/nixos-20.09/git-revision)" nixos-20.09 nixos="/nix/var/nix/profiles/per-user/root/channels/nixos"
echo "$(cat /nix/var/nix/profiles/per-user/root/channels/nixos/.git-revision)" nixos local [[ "$(<$nixos/.version-suffix)" =~ ^pre ]] &&
echo "$(curl --silent -L https://channels.nixos.org/nixos-unstable/git-revision)" nixos-unstable channel="unstable" ||
channel="$(<$nixos/.version)"
echo "nixos-$channel"
echo "$(<$nixos/.git-revision) current local"
echo "$(curl --silent -L "https://channels.nixos.org/nixos-$channel/git-revision") latest available"
'') '')
]; ];