Skip to content

Commit

Permalink
Manually download the lix installer
Browse files Browse the repository at this point in the history
This uses curl's --etag-save and --etag-compare functions to see if we need a new installer and only then download it.
  • Loading branch information
antifuchs committed Feb 28, 2025
1 parent 5d1ae98 commit 46fa555
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion do-the-lix-thing
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ set -o pipefail # the return value of a pipeline is the status of
# Constants
REPO_URL="https://github.com/samueldr/lix-gha-installer-action"
ACTION_NAME="Lix GHA Installer Action"
INSTALLER_DOWNLOAD_DIR="/tmp/lix-installer"
################################################################################


Expand Down Expand Up @@ -126,7 +127,15 @@ trap _handle_exit EXIT
(
set -x

curl -sSf -L https://install.lix.systems/lix | bash -s -- install --no-confirm
_installer_bin="$INSTALLER_DOWNLOAD_DIR/lix-installer"
_etag="$INSTALLER_DOWNLOAD_DIR/etag"
mkdir -p "$(dirname "$_installer_bin")"
if ! curl --head -sSf -L --etag-compare "$_etag" "https://install.lix.systems/lix/lix-installer-$(_get_system)"
then
curl -o "$_installer_bin" -sSf -L --etag-save "$_etag" "https://install.lix.systems/lix/lix-installer-$(_get_system)"
chmod +x "$_installer_bin"
fi
env TERM=dumb "$_installer_bin" install </dev/null

(
< /etc/nix/nix.conf sed -e 's/nixpkgs=flake:nixpkgs/nixpkgs=channel:nixos-unstable/'
Expand Down

0 comments on commit 46fa555

Please sign in to comment.