Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 37cf742656 | |||
| 3df486a535 | |||
| 677cbc8aa1 | |||
| ca688cebfe | |||
| 65d7c888b2 | |||
| 322d409404 | |||
| 11e71cc767 | |||
| 8c00b3afd2 | |||
| 9c5d3b3cb7 | |||
| 129f079024 | |||
| 23314a8041 | |||
| cd77c17f59 | |||
| 10f7447de7 | |||
| e46eb0b82c | |||
| 9b252454a8 | |||
| 77bddc5421 | |||
| b29ae48286 | |||
| 8c5c90b566 | |||
| 95f9c13053 | |||
| b0ccf90bd7 | |||
| eac6491610 | |||
| 81f14d0ea0 | |||
| 610f32a473 | |||
| 9ac19b020d | |||
| a2606f78c3 | |||
| 968165140b |
@@ -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
@@ -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
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user