From 8602ba8e8549b2223ded356d551661a27e750763 Mon Sep 17 00:00:00 2001 From: fedx-sudo Date: Sun, 24 Oct 2021 15:20:46 -0600 Subject: [PATCH] add NixOS to quickget add NixOS to quickget add NixOS to quickget --- quickget | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/quickget b/quickget index ebe8fd0..1e316da 100755 --- a/quickget +++ b/quickget @@ -40,6 +40,9 @@ function pretty_name() { linuxmint-cinnamon) PRETTY_NAME="Linux Mint Cinnamon";; linuxmint-mate) PRETTY_NAME="Linux Mint MATE";; linuxmint-xfce) PRETTY_NAME="Linux Mint XFCE";; + nisos-gnome) PRETTY_NAME="NixOS Gnome";; + nixos-plasma5) PRETTY_NAME="NixOS KDE";; + nixos-minimal) PRETTY_NAME="Nixos Minimal";; macos) PRETTY_NAME="macOS";; openbsd) PRETTY_NAME="OpenBSD";; opensuse) PRETTY_NAME="openSUSE";; @@ -116,6 +119,9 @@ function os_support() { linuxmint-cinnamon \ linuxmint-mate \ linuxmint-xfce \ + nixos-gnome \ + nixos-plasma5 \ + nixos-minimal \ lubuntu \ macos \ openbsd \ @@ -154,6 +160,10 @@ function releases_linuxmint(){ echo 20.2 } +function releases_nixos(){ + echo 21.05 +} + function releases_openbsd(){ echo 7.0 } @@ -460,6 +470,7 @@ function web_get() { local DIR="${2}" local FILE="" local URL="${1}" + if [ -n "${3}" ]; then FILE="${3}" else @@ -533,6 +544,9 @@ function make_vm_config() { elif [[ "${OS}" == *"linuxmint"* ]]; then GUEST="linux" IMAGE_TYPE="iso" + elif [[ "${OS}" == *"nixos"* ]]; then + GUEST="linux" + IMAGE_TYPE="iso" elif [ "${OS}" == "openbsd" ]; then GUEST="openbsd" IMAGE_TYPE="iso" @@ -668,7 +682,21 @@ function get_linuxmint() { check_hash "${ISO}" "${HASH}" make_vm_config "${ISO}" } +function get_nixos() { + local FLAVOR="" + local HASH="" + local ISO="" + local URL="" + validate_release "releases_nixos" + 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}" + check_hash "${ISO}" "${HASH}" + make_vm_config "${ISO}" +} function get_openbsd() { local HASH="" local ISO="" @@ -935,6 +963,8 @@ if [ -n "${2}" ]; then get_kali elif [[ "${OS}" == *"linuxmint"* ]]; then get_linuxmint + elif [[ "${OS}" == *"nixos"* ]]; then + get_nixos elif [ "${OS}" == "openbsd" ]; then get_openbsd elif [ "${OS}" == "opensuse" ]; then @@ -988,6 +1018,8 @@ else releases_kali elif [[ "${OS}" == *"linuxmint"* ]]; then releases_linuxmint + elif [[ "${OS}" == *"nixos"* ]]; then + releases_nixos elif [ "${OS}" == "opensuse" ]; then releases_opensuse elif [ "${OS}" == "openbsd" ]; then