Refactor get_nixos()

This commit is contained in:
Martin Wimpress 2022-02-21 02:00:17 +00:00
parent eb23f010aa
commit fb39f67a5b
No known key found for this signature in database
GPG Key ID: 61DF940515E06DA3
1 changed files with 3 additions and 3 deletions

View File

@ -1067,11 +1067,11 @@ function get_nixos() {
local URL=""
validate_release "releases_nixos"
URL="https://channels.nixos.org/nixos-${RELEASE}"
FLAVOR=$(echo "${OS}" | cut -d'-' -f2)
ISO="latest-nixos-${FLAVOR}-x86_64-linux.iso"
URL="https://channels.nixos.org/nixos-${RELEASE}/${ISO}"
HASH=$(wget -q -O- "https://channels.nixos.org/nixos-${RELEASE}/${ISO}.sha256" | cut -d' ' -f1)
web_get "${URL}" "${VM_PATH}"
HASH=$(wget -q -O- "${URL}/${ISO}.sha256" | cut -d' ' -f1)
web_get "${URL}/${ISO}" "${VM_PATH}"
check_hash "${ISO}" "${HASH}"
make_vm_config "${ISO}"
}