Compare commits

...

26 Commits

Author SHA1 Message Date
Ana Hobden 37cf742656 Try env-style settings 2023-07-06 10:09:34 -07:00
Ana Hobden 3df486a535 Add act support (#30)
* Add act support

* Unwhoops

* Better format bash

* Relocate some code

* Mac doesn't want to get fancy with mktemp

* Change branch

* Change to a pr instead of branch

* Use the pr all over

* Use main

* Don't cat the conf

* Improve act support

* Bash eval fix

* use single quotes instead

* Fix mac planner name

* Fix quotes again
2023-07-01 22:59:30 +02:00
Graham Christensen 677cbc8aa1 Merge pull request #27 from DeterminateSystems/bump-readme
Update README.md to say v4
2023-06-06 13:05:06 -04:00
Graham Christensen ca688cebfe Update README.md to say v4 2023-06-06 10:25:36 -04:00
Ana Hobden 65d7c888b2 Merge pull request #26 from DeterminateSystems/different-url-for-ci
Add a ?ci=github to GHA requests
2023-06-05 10:53:09 -07:00
Ana Hobden 322d409404 Add quotes 2023-06-01 11:32:35 -07:00
Ana Hobden 11e71cc767 Add a ?ci=github to GHA requests 2023-05-31 13:44:05 -07:00
Ana Hobden 8c00b3afd2 Merge pull request #25 from ajaxbits/patch-1
Update example in README to use v3
2023-05-30 09:50:55 -07:00
Alex Jackson 9c5d3b3cb7 Update README.md with latest v3 version
Updates readme to reflect latest `v3` release of the action.
2023-05-30 10:28:21 -05:00
Ana Hobden 129f079024 Merge pull request #22 from DeterminateSystems/v0.9.0-changes
v0.9.0 - nix profile location change
2023-05-25 09:57:30 -07:00
Ana Hobden 23314a8041 Merge branch 'use-not-fortune' into v0.9.0-changes 2023-05-25 09:32:35 -07:00
Ana Hobden cd77c17f59 Maybe we can use hello 2023-05-25 08:54:25 -07:00
Ana Hobden 10f7447de7 Use ripgrep instead of fortune 2023-05-25 08:53:32 -07:00
Ana Hobden e46eb0b82c v0.9.0 - nix profile location change 2023-05-24 09:46:04 -07:00
Ana Hobden 9b252454a8 Merge pull request #19 from DeterminateSystems/reflect-v0.6.0-changes
Reflect v0.6.0 changes
2023-03-21 09:23:30 -07:00
Ana Hobden 77bddc5421 Include version bump in README 2023-03-20 11:50:11 -07:00
Ana Hobden b29ae48286 Reflect v0.6.0 changes 2023-03-16 10:02:22 -07:00
Ana Hobden 8c5c90b566 Merge pull request #18 from DeterminateSystems/channels-begone
Reflect removal of channels in upcoming version
2023-03-16 09:55:10 -07:00
Cole Helbling 95f9c13053 Reflect removal of channels in upcoming version 2023-03-08 12:37:36 -08:00
Graham Christensen b0ccf90bd7 Merge pull request #16 from Mic92/diagnostic-endpoint
add option to change diagnostic endpoint
2023-03-06 09:41:30 -05:00
Ana Hobden eac6491610 Merge pull request #17 from DeterminateSystems/cole-h-patch-1
README: use tagged release
2023-03-02 10:58:17 -08:00
Cole Helbling 81f14d0ea0 Create PULL_REQUEST_TEMPLATE.md 2023-03-02 10:42:36 -08:00
Cole Helbling 610f32a473 README: use tagged release 2023-03-02 10:37:43 -08:00
Jörg Thalheim 9ac19b020d add option to change diagnostic endpoint 2023-03-01 09:08:39 +01:00
Cole Helbling a2606f78c3 Merge pull request #14 from DeterminateSystems/user-count-setting-table
Add missing setting to README table
2023-02-28 06:57:19 -08:00
Luc Perkins 968165140b Add missing nix-build-user-count setting 2023-02-28 15:25:46 +02:00
4 changed files with 131 additions and 152 deletions
+12
View File
@@ -0,0 +1,12 @@
##### Description
<!---
Please include a short description of what your PR does and / or the motivation
behind it
--->
##### Checklist
- [ ] Tested changes against a test repository
- [ ] Added or updated relevant documentation (leave unchecked if not applicable)
- [ ] (If this PR is for a release) Updated README to point to the new tag (leave unchecked if not applicable)
+31 -25
View File
@@ -17,16 +17,17 @@ jobs:
logger: pretty
log-directives: nix_installer=trace
backtrace: full
nix-installer-branch: main
- name: echo $PATH
run: echo $PATH
- name: Test `nix` with `$GITHUB_PATH`
if: success() || failure()
run: |
nix run nixpkgs#fortune
nix profile install nixpkgs#fortune
fortune
nix run nixpkgs#hello
nix profile install nixpkgs#hello
hello
nix store gc
nix run nixpkgs#fortune
nix run nixpkgs#hello
- name: Test bash
run: nix-instantiate -E 'builtins.currentTime' --eval
if: success() || failure()
@@ -41,14 +42,15 @@ jobs:
logger: pretty
log-directives: nix_installer=trace
backtrace: full
nix-installer-branch: main
- name: Test `nix` with `$GITHUB_PATH`
if: success() || failure()
run: |
nix run nixpkgs#fortune
nix profile install nixpkgs#fortune
fortune
nix run nixpkgs#hello
nix profile install nixpkgs#hello
hello
nix store gc
nix run nixpkgs#fortune
nix run nixpkgs#hello
- name: Reinstall Nix
uses: ./
with:
@@ -58,14 +60,15 @@ jobs:
reinstall: true
extra-conf: |
use-sqlite-wal = true
nix-installer-branch: main
- name: Test `nix` with `$GITHUB_PATH`
if: success() || failure()
run: |
nix run nixpkgs#fortune
nix profile install nixpkgs#fortune
fortune
nix run nixpkgs#hello
nix profile install nixpkgs#hello
hello
nix store gc
nix run nixpkgs#fortune
nix run nixpkgs#hello
- name: Verify the generated nix.conf
run: |
cat -n /etc/nix/nix.conf
@@ -83,16 +86,17 @@ jobs:
logger: pretty
log-directives: nix_installer=trace
backtrace: full
nix-installer-branch: main
- name: echo $PATH
run: echo $PATH
- name: Test `nix` with `$GITHUB_PATH`
if: success() || failure()
run: |
nix run nixpkgs#fortune
nix profile install nixpkgs#fortune
fortune
nix run nixpkgs#hello
nix profile install nixpkgs#hello
hello
nix store gc
nix run nixpkgs#fortune
nix run nixpkgs#hello
- name: Test bash
run: nix-instantiate -E 'builtins.currentTime' --eval
if: success() || failure()
@@ -111,14 +115,15 @@ jobs:
logger: pretty
log-directives: nix_installer=trace
backtrace: full
nix-installer-branch: main
- name: Test `nix` with `$GITHUB_PATH`
if: success() || failure()
run: |
nix run nixpkgs#fortune
nix profile install nixpkgs#fortune
fortune
nix run nixpkgs#hello
nix profile install nixpkgs#hello
hello
nix store gc
nix run nixpkgs#fortune
nix run nixpkgs#hello
- name: Reinstall Nix
uses: ./
with:
@@ -128,16 +133,17 @@ jobs:
reinstall: true
extra-conf: |
use-sqlite-wal = true
nix-installer-branch: main
- name: Test `nix` with `$GITHUB_PATH`
if: success() || failure()
run: |
nix run nixpkgs#fortune
nix profile install nixpkgs#fortune
fortune
nix run nixpkgs#hello
nix profile install nixpkgs#hello
hello
nix store gc
nix run nixpkgs#fortune
nix run nixpkgs#hello
- name: Verify the generated nix.conf
run: |
cat -n /etc/nix/nix.conf
cat /etc/nix/nix.conf
grep -E "^trusted-users = .*$USER" /etc/nix/nix.conf
grep -E "^use-sqlite-wal = true" /etc/nix/nix.conf
+34 -30
View File
@@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
uses: DeterminateSystems/nix-installer-action@v4
- name: Run `nix build`
run: nix build .
```
@@ -24,35 +24,39 @@ See [`.github/workflows/ci.yml`](.github/workflows/ci.yml) for a full example.
## Configuration
| Parameter | Description | Type | Default |
| :----------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------- | :---------------------------------------- |
| `backtrace` | The setting for [`RUST_BACKTRACE`][backtrace] | string | |
| `extra-args` | Extra arguments to pass to the planner (prefer using structured `with:` arguments unless using a custom [planner]!) | string | |
| `extra-conf` | Extra configuration lines for `/etc/nix/nix.conf` (includes `access-tokens` with `secrets.GITHUB_TOKEN` automatically if `github-token` is set) | string | |
| `github-token` | A [GitHub token] for making authenticated requests (which have a higher rate-limit quota than unauthenticated requests) | string | `${{ github.token }}` |
| `init` | The init system to configure (requires `planner: linux-multi`) | enum (`none` or `systemd`) | |
| `local-root` | A local `nix-installer` binary root. Overrides the `nix-installer-url` setting (a `nix-installer.sh` should exist, binaries should be named `nix-installer-$ARCH`, eg. `nix-installer-x86_64-linux`). | Boolean | `false` |
| `log-directives` | A list of [tracing directives], comma separated with `-`s replaced with `_` (eg. `nix_installer=trace`) | string | |
| `logger` | The logger to use during installation | enum (`pretty`, `json`, `full`, `compact`) | |
| `mac-case-sensitive` | Use a case-sensitive volume (`planner: macos` only) | Boolean | `false` |
| `mac-encrypt` | Force encryption on the volume (`planner: macos` only) | Boolean | `false` |
| `mac-root-disk` | The root disk of the target (`planner: macos` only) | string | |
| `mac-volume-label` | The label for the created [APFS] volume (`planner: macos` only) | string | |
| `modify-profile` | Modify the user [profile] to automatically load Nix | Boolean | `false` |
| `nix-build-group-id` | The Nix build group GID | integer | |
| `nix-build-group-name` | The Nix build group name | string | |
| `nix-build-user-base` | The Nix build user base UID (ascending) | integer | |
| `nix-build-user-prefix` | The Nix build user prefix (user numbers will be postfixed) | string | |
| `nix-installer-branch` | The branch of `nix-installer` to use (conflicts with the `nix-installer-tag`, `nix-installer-revision`, and `nix-installer-branch`) | string | |
| `nix-installer-pr` | The pull request of `nix-installer` to use (conflicts with `nix-installer-tag`, `nix-installer-revision`, and `nix-installer-branch`) | integer | |
| `nix-installer-revision` | The revision of `nix-installer` to use (conflicts with `nix-installer-tag`, `nix-installer-branch`, and `nix-installer-pr`) | string | |
| `nix-installer-tag` | The tag of `nix-installer` to use (conflicts with `nix-installer-revision`, `nix-installer-branch`, `nix-installer-pr`) | string | |
| `nix-installer-url` | A URL pointing to a `nix-installer.sh` script | URL | `https://install.determinate.systems/nix` |
| `nix-package-url` | The Nix package URL | URL | |
| `planner` | The installation [planner] to use | enum (`linux-multi` or `macos`) | |
| `reinstall` | Force a reinstall if an existing installation is detected (consider backing up `/nix/store`) | Boolean | `false` |
| `start-daemon` | If the daemon should be started, requires `planner: linux-multi` | Boolean | `false` |
| `trust-runner-user` | Whether to make the runner user trusted by the Nix daemon | Boolean | `true` |
| Parameter | Description | Type | Default |
| :----------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------- | :--------------------------------------------------- |
| `backtrace` | The setting for [`RUST_BACKTRACE`][backtrace] | string | |
| `extra-args` | Extra arguments to pass to the planner (prefer using structured `with:` arguments unless using a custom [planner]!) | string | |
| `extra-conf` | Extra configuration lines for `/etc/nix/nix.conf` (includes `access-tokens` with `secrets.GITHUB_TOKEN` automatically if `github-token` is set) | string | |
| `github-token` | A [GitHub token] for making authenticated requests (which have a higher rate-limit quota than unauthenticated requests) | string | `${{ github.token }}` |
| `init` | The init system to configure (requires `planner: linux-multi`) | enum (`none` or `systemd`) | |
| `local-root` | A local `nix-installer` binary root. Overrides the `nix-installer-url` setting (a `nix-installer.sh` should exist, binaries should be named `nix-installer-$ARCH`, eg. `nix-installer-x86_64-linux`). | Boolean | `false` |
| `log-directives` | A list of [tracing directives], comma separated with `-`s replaced with `_` (eg. `nix_installer=trace`) | string | |
| `logger` | The logger to use during installation | enum (`pretty`, `json`, `full`, `compact`) | |
| `mac-case-sensitive` | Use a case-sensitive volume (`planner: macos` only) | Boolean | `false` |
| `mac-encrypt` | Force encryption on the volume (`planner: macos` only) | Boolean | `false` |
| `mac-root-disk` | The root disk of the target (`planner: macos` only) | string | |
| `mac-volume-label` | The label for the created [APFS] volume (`planner: macos` only) | string | |
| `modify-profile` | Modify the user [profile] to automatically load Nix | Boolean | `false` |
| `nix-build-group-id` | The Nix build group GID | integer | |
| `nix-build-group-name` | The Nix build group name | string | |
| `nix-build-user-base` | The Nix build user base UID (ascending) | integer | |
| `nix-build-user-count` | The number of build users to create | integer | 32 |
| `nix-build-user-prefix` | The Nix build user prefix (user numbers will be postfixed) | string | |
| `nix-installer-branch` | The branch of `nix-installer` to use (conflicts with the `nix-installer-tag`, `nix-installer-revision`, and `nix-installer-branch`) | string | |
| `nix-installer-pr` | The pull request of `nix-installer` to use (conflicts with `nix-installer-tag`, `nix-installer-revision`, and `nix-installer-branch`) | integer | |
| `nix-installer-revision` | The revision of `nix-installer` to use (conflicts with `nix-installer-tag`, `nix-installer-branch`, and `nix-installer-pr`) | string | |
| `nix-installer-tag` | The tag of `nix-installer` to use (conflicts with `nix-installer-revision`, `nix-installer-branch`, `nix-installer-pr`) | string | |
| `nix-installer-url` | A URL pointing to a `nix-installer.sh` script | URL | `https://install.determinate.systems/nix` |
| `nix-package-url` | The Nix package URL | URL | |
| `planner` | The installation [planner] to use | enum (`linux` or `macos`) | |
| `reinstall` | Force a reinstall if an existing installation is detected (consider backing up `/nix/store`) | Boolean | `false` |
| `start-daemon` | If the daemon should be started, requires `planner: linux-multi` | Boolean | `false` |
| `trust-runner-user` | Whether to make the runner user trusted by the Nix daemon | Boolean | `true` |
| `diagnostic-endpoint` | Diagnostic endpoint url where the installer sends install [diagnostic reports](https://github.com/DeterminateSystems/nix-installer#diagnostics) to, to disable set this to an empty string | string | `https://install.determinate.systems/nix/diagnostic` |
| `proxy` | The proxy to use (if any), valid proxy bases are `https://$URL`, `http://$URL` and `socks5://$URL` | string | |
| `ssl-cert-file` | An SSL cert to use (if any), used for fetching Nix and sets `NIX_SSL_CERT_FILE` for Nix | string | |
[apfs]: https://en.wikipedia.org/wiki/Apple_File_System
[backtrace]: https://doc.rust-lang.org/std/backtrace/index.html#environment-variables
+54 -97
View File
@@ -7,9 +7,6 @@ inputs:
backtrace:
description: The setting for `RUST_BACKTRACE` (see https://doc.rust-lang.org/std/backtrace/index.html#environment-variables)
required: false
channels:
description: Channel(s) to add (eg `nixpkgs=https://nixos.org/channels/nixpkgs-unstable`)
required: false
extra-args:
description: Extra args to pass to the planner (prefer using structured `with:` arguments unless using a custom planner!)
required: false
@@ -31,6 +28,12 @@ inputs:
logger:
description: The logger to use for install (eg. `pretty`, `json`, `full`, `compact`)
required: false
ssl-cert-file:
description: "An SSL cert to use (if any), used for fetching Nix and sets `NIX_SSL_CERT_FILE` for Nix"
required: false
pproxy:
description: "The proxy to use (if any), valid proxy bases are `https://$URL`, `http://$URL` and `socks5://$URL`"
required: false
mac-case-sensitive:
description: "Use a case sensitive volume (`planner: macos` only)"
required: false
@@ -88,6 +91,9 @@ inputs:
start-daemon:
description: "If the daemon should be started, requires `planner: linux-multi`"
required: false
diagnostic-endpoint:
description: "Diagnostic endpoint url where the installer sends data to. To disable set this to an empty string."
default: "https://install.determinate.systems/nix/diagnostic"
trust-runner-user:
description: Whether to make the runner user trusted by the Nix daemon
default: "true"
@@ -97,10 +103,28 @@ runs:
steps:
- name: Install Nix
shell: bash
env:
NIX_INSTALLER_MODIFY_PROFILE: ${{ inputs.modify-profile }}
NIX_INSTALLER_NIX_BUILD_USER_COUNT: ${{ inputs.nix-build-user-count }}
NIX_INSTALLER_NIX_BUILD_USER_ID_BASE: ${{ inputs.nix-build-user-base }}
NIX_INSTALLER_NIX_BUILD_USER_PREFIX: ${{ inputs.nix-build-user-prefix }}
NIX_INSTALLER_NIX_BUILD_GROUP_ID: ${{ inputs.nix-build-group-id }}
NIX_INSTALLER_NIX_BUILD_GROUP_NAME: ${{ inputs.nix-build-group-name }}
NIX_INSTALLER_ENCRYPT: ${{ inputs.mac-encrypt }}
NIX_INSTALLER_CASE_SENSITIVE: ${{ inputs.mac-case-sensitive }}
NIX_INSTALLER_VOLUME_LABEL: ${{ inputs.mac-volume-label }}
NIX_INSTALLER_ROOT_DISK: ${{ inputs.mac-root-disk }}
NIX_INSTALLER_LOGGER: ${{ inputs.logger }}
NIX_INSTALLER_INIT: ${{ inputs.init }}
NIX_INSTALLER_START_DAEMON: ${{ inputs.start-daemon }}
NIX_INSTALLER_LOG_DIRECTIVES: ${{ inputs.log-directives }}
RUST_BACKTRACE: ${{ inputs.backtrace }}
NIX_INSTALLER_DIAGNOSTIC_ENDPOINT: ${{ inputs.diagnostic-endpoint }}
NIX_INSTALLER_NO_CONFIRM: true
run: |
if [ -f "/nix/receipt.json" ] && [ -f "/nix/nix-installer" ]; then
if ([ -n "${{ inputs.nix-installer-revision }}" ] || [ -n "${{ inputs.nix-installer-branch }}" ]) && [ "${{ inputs.reinstall }}" != "true" ]; then
echo "Detection of existing installation versions isn't supported when `nix-installer-revision` or `nix-installer-branch` are set, `reinstall: true` should also be set"
echo "Detection of existing installation versions isn't supported when \`nix-installer-revision\` or \`nix-installer-branch\` are set, \`reinstall: true\` should also be set"
fi
if [ -n "${{ inputs.reinstall }}" ] && [ "${{ inputs.reinstall }}" == "true" ]; then
@@ -113,43 +137,18 @@ runs:
fi
echo "Nix was already installed, using existing install"
echo "/nix/var/nix/profiles/default/bin" >> $GITHUB_PATH
echo "$HOME/.nix-profile/bin" >> $GITHUB_PATH
exit 0
fi
fi
if [ -n "${{ inputs.channels }}" ]; then
export NIX_INSTALLER_CHANNELS=${{ inputs.channels }}
echo "Set NIX_INSTALLER_CHANNELS=$NIX_INSTALLER_CHANNELS"
fi
NIX_EXTRA_CONF_FILE=$(mktemp)
if [ -n "${{ inputs.modify-profile }}" ]; then
export NIX_INSTALLER_MODIFY_PROFILE=${{ inputs.modify-profile }}
echo "Set NIX_INSTALLER_MODIFY_PROFILE=$NIX_INSTALLER_MODIFY_PROFILE"
fi
if [ -n "${{ inputs.nix-build-user-count }}" ]; then
export NIX_INSTALLER_NIX_BUILD_USER_COUNT=${{ inputs.nix-build-user-count }}
echo "Set NIX_INSTALLER_NIX_BUILD_USER_COUNT=$NIX_INSTALLER_NIX_BUILD_USER_COUNT"
fi
if [ -n "${{ inputs.nix-build-group-name }}" ]; then
export NIX_INSTALLER_NIX_BUILD_GROUP_NAME=${{ inputs.nix-build-group-name }}
echo "Set NIX_INSTALLER_NIX_BUILD_GROUP_NAME=$NIX_INSTALLER_NIX_BUILD_GROUP_NAME"
fi
if [ -n "${{ inputs.nix-build-group-id }}" ]; then
export NIX_INSTALLER_NIX_BUILD_GROUP_ID=${{ inputs.nix-build-group-id }}
echo "Set NIX_INSTALLER_NIX_BUILD_GROUP_ID=$NIX_INSTALLER_NIX_BUILD_GROUP_ID"
fi
if [ -n "${{ inputs.nix-build-user-prefix }}" ]; then
export NIX_INSTALLER_NIX_BUILD_USER_ID_BASE=${{ inputs.nix-build-user-prefix }}
echo "Set NIX_INSTALLER_NIX_BUILD_USER_ID_BASE=$NIX_INSTALLER_NIX_BUILD_USER_ID_BASE"
fi
if [ -n "${{ inputs.nix-build-user-base }}" ]; then
export NIX_INSTALLER_NIX_BUILD_USER_PREFIX=${{ inputs.nix-build-user-base }}
echo "Set NIX_INSTALLER_NIX_BUILD_USER_PREFIX=$NIX_INSTALLER_NIX_BUILD_USER_PREFIX"
if [ -n "$ACT" ] && [ ! -n "$NOT_ACT" ]; then
echo 'Detected `$ACT` environment, assuming this is a https://github.com/nektos/act created container, set `NOT_ACT=true` to override this. This will change the settings of the `init` as well as `extra-conf` to be compatible with `act`'
export NIX_INSTALLER_INIT="none"
echo "Set NIX_INSTALLER_INIT=$NIX_INSTALLER_INIT"
echo "sandbox = false" >> ${NIX_EXTRA_CONF_FILE}
fi
if [ -n "${{ inputs.nix-package-url }}" ]; then
@@ -157,43 +156,20 @@ runs:
echo "Set NIX_INSTALLER_NIX_PACKAGE_URL=$NIX_INSTALLER_NIX_PACKAGE_URL"
fi
NIX_EXTRA_CONF=""
NEWLINE='
'
if [ -n "${{ inputs.extra-conf }}" ]; then
NIX_EXTRA_CONF="${{ inputs.extra-conf }}"
echo "${{ inputs.extra-conf }}" >> ${NIX_EXTRA_CONF_FILE}
fi
if [ -n "${{ inputs.github-token }}" ]; then
NIX_EXTRA_CONF="${NIX_EXTRA_CONF:+$NIX_EXTRA_CONF$NEWLINE}access-tokens = github.com=${{ inputs.github-token }}"
echo "access-tokens = github.com=${{ inputs.github-token }}" >> ${NIX_EXTRA_CONF_FILE}
fi
if [ "${{ inputs.trust-runner-user }}" == "true" ]; then
NIX_EXTRA_CONF="${NIX_EXTRA_CONF:+$NIX_EXTRA_CONF$NEWLINE}trusted-users = root $USER"
echo "trusted-users = root $USER" >> ${NIX_EXTRA_CONF_FILE}
fi
if [ -n "$NIX_EXTRA_CONF" ]; then
export NIX_INSTALLER_EXTRA_CONF="$NIX_EXTRA_CONF"
if [ -n "$NIX_EXTRA_CONF_FILE" ]; then
export NIX_INSTALLER_EXTRA_CONF=$(cat ${NIX_EXTRA_CONF_FILE})
echo "Set NIX_INSTALLER_EXTRA_CONF=$NIX_INSTALLER_EXTRA_CONF"
fi
if [ -n "${{ inputs.mac-encrypt }}" ]; then
export NIX_INSTALLER_ENCRYPT=${{ inputs.mac-encrypt }}
echo "Set NIX_INSTALLER_ENCRYPT=$NIX_INSTALLER_ENCRYPT"
fi
if [ -n "${{ inputs.mac-case-sensitive }}" ]; then
export NIX_INSTALLER_CASE_SENSITIVE=${{ inputs.mac-case-sensitive }}
echo "Set NIX_INSTALLER_CASE_SENSITIVE=$NIX_INSTALLER_CASE_SENSITIVE"
fi
if [ -n "${{ inputs.mac-volume-label }}" ]; then
export NIX_INSTALLER_VOLUME_LABEL=${{ inputs.mac-volume-label }}
echo "Set NIX_INSTALLER_VOLUME_LABEL=$NIX_INSTALLER_VOLUME_LABEL"
fi
if [ -n "${{ inputs.mac-root-disk }}" ]; then
export NIX_INSTALLER_ROOT_DISK=${{ inputs.mac-root-disk }}
echo "Set NIX_INSTALLER_ROOT_DISK=$NIX_INSTALLER_ROOT_DISK"
fi
if [ -n "${{ inputs.nix-installer-pr }}" ] && [ -n "${{ inputs.nix-installer-tag }}" ]; then
echo "The nix-installer-pr and nix-installer-tag options conflict, please choose one"
exit 1
@@ -253,52 +229,33 @@ runs:
echo "Set NIX_INSTALLER_FORCE_ALLOW_HTTP=$NIX_INSTALLER_FORCE_ALLOW_HTTP"
else
if [ -n "${{ inputs.nix-installer-url }}" ]; then
export NIX_INSTALLER_URL=${{ inputs.nix-installer-url }}
export NIX_INSTALLER_URL="${{ inputs.nix-installer-url }}"
else
if [ -n "${{ inputs.nix-installer-pr }}" ]; then
export NIX_INSTALLER_URL=https://install.determinate.systems/nix/pr/${{ inputs.nix-installer-pr }}
export NIX_INSTALLER_URL="https://install.determinate.systems/nix/pr/${{ inputs.nix-installer-pr }}?ci=github"
elif [ -n "${{ inputs.nix-installer-tag }}" ]; then
export NIX_INSTALLER_URL=https://install.determinate.systems/nix/tag/${{ inputs.nix-installer-tag }}
export NIX_INSTALLER_URL="https://install.determinate.systems/nix/tag/${{ inputs.nix-installer-tag }}?ci=github"
elif [ -n "${{ inputs.nix-installer-revision }}" ]; then
export NIX_INSTALLER_URL=https://install.determinate.systems/nix/rev/${{ inputs.nix-installer-revision }}
export NIX_INSTALLER_URL="https://install.determinate.systems/nix/rev/${{ inputs.nix-installer-revision }}?ci=github"
elif [ -n "${{ inputs.nix-installer-branch }}" ]; then
export NIX_INSTALLER_URL=https://install.determinate.systems/nix/branch/${{ inputs.nix-installer-branch }}
export NIX_INSTALLER_URL="https://install.determinate.systems/nix/branch/${{ inputs.nix-installer-branch }}?ci=github"
else
export NIX_INSTALLER_URL=https://install.determinate.systems/nix
export NIX_INSTALLER_URL="https://install.determinate.systems/nix?ci=github"
fi
fi
echo "Set NIX_INSTALLER_URL=$NIX_INSTALLER_URL"
fi
if [ -n "${{ inputs.logger }}" ]; then
export NIX_INSTALLER_LOGGER=${{ inputs.logger }}
echo "Set NIX_INSTALLER_LOGGER=$NIX_INSTALLER_LOGGER"
if [ "${RUNNER_OS}" == "Linux" ]; then
export PLANNER="linux"
elif [ "${RUNNER_OS}" == "macOS" ]; then
export PLANNER="macos"
else
echo "${RUNNER_OS} not supported"
exit 1
fi
if [ -n "${{ inputs.init }}" ]; then
export NIX_INSTALLER_INIT=${{ inputs.init }}
echo "Set NIX_INSTALLER_INIT=$NIX_INSTALLER_INIT"
fi
if [ -n "${{ inputs.start-daemon }}" ]; then
export NIX_INSTALLER_START_DAEMON=${{ inputs.start-daemon }}
echo "Set NIX_INSTALLER_START_DAEMON=$NIX_INSTALLER_START_DAEMON"
fi
if [ -n "${{ inputs.log-directives }}" ]; then
export NIX_INSTALLER_LOG_DIRECTIVES=${{ inputs.log-directives }}
echo "Set NIX_INSTALLER_LOG_DIRECTIVES=$NIX_INSTALLER_LOG_DIRECTIVES"
fi
if [ -n "${{ inputs.backtrace }}" ]; then
export RUST_BACKTRACE=${{ inputs.backtrace }}
echo "Set RUST_BACKTRACE=$RUST_BACKTRACE"
fi
export NIX_INSTALLER_NO_CONFIRM=true
echo "Set NIX_INSTALLER_NO_CONFIRM=$NIX_INSTALLER_NO_CONFIRM"
curl --retry 20 -L $NIX_INSTALLER_URL | sh -s -- install ${{ inputs.planner }} ${{ inputs.extra-args }}
curl --retry 20 -L $NIX_INSTALLER_URL | sh -s -- install ${PLANNER} ${{ inputs.extra-args }}
if [ -n "$HTTP_PID" ]; then
kill $HTTP_PID