mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-12-21 19:24:15 +00:00
remove hardcodes from "channel" script
This commit is contained in:
parent
f5eb7d7efa
commit
217e63bbf7
1 changed files with 7 additions and 3 deletions
|
@ -47,9 +47,13 @@
|
|||
'')
|
||||
|
||||
(writeShellScriptBin "channel" ''
|
||||
echo "$(curl --silent -L https://channels.nixos.org/nixos-20.09/git-revision)" nixos-20.09
|
||||
echo "$(cat /nix/var/nix/profiles/per-user/root/channels/nixos/.git-revision)" nixos local
|
||||
echo "$(curl --silent -L https://channels.nixos.org/nixos-unstable/git-revision)" nixos-unstable
|
||||
nixos="/nix/var/nix/profiles/per-user/root/channels/nixos"
|
||||
[[ "$(<$nixos/.version-suffix)" =~ ^pre ]] &&
|
||||
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"
|
||||
'')
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in a new issue