Skip to content

Commit

Permalink
feat: skip-nix-install (#23)
Browse files Browse the repository at this point in the history
We have some problems in our custom runner with this action so I've
tried it with skipping the installation via the included action and it
works in our runners (we do not use the GitHub provided ones, we are
using custom runners).

In case you are wondering which action we are using, we use:
`cachix/install-nix-action@v23` - I guess it has something to do with
the usage of `sudo` in the other action but I'm not 100% sure on that.
I'm also not sure about the differences between these two actions so
I've opted for the possibility to skip the installation rather than
changing the action as I guess you've put a lot of thought into which
action to use.

Edit: I need to correct myself, it's not because of `sudo` but because
of `systemd`. I tried to run the action without `systemd` by passing in
`init: none` and `planner: linux-multi` but I got other errors. So I
would prefer to be able to just skip the installation and use my own / a
different action to install `nix`.
  • Loading branch information
mstruebing authored Sep 27, 2023
1 parent f013611 commit 6b09349
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
| devbox-version | Specify devbox CLI version you want to pin to. Only supports >0.2.2 | latest |
| sha256-checksum | Specify an explicit checksum for the devbox binary | |
| disable-nix-access-token | Disable configuration of nix access-tokens with the GitHub token used in the workflow | false |
| skip-nix-installation | Skip the installation of nix | false |

### Example Configuration

Expand Down
8 changes: 6 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ branding:
color: 'purple'

inputs:
project-path: # path to folder
project-path: # path to folder
description: 'Project path to devbox.json. Default to the root directory of the repository.'
default: '.'
enable-cache: # 'true' or 'false'
enable-cache: # 'true' or 'false'
description: 'Caching the entire Nix store in github based on your devbox.json'
default: 'false'
refresh-cli: # 'true' or 'false'
Expand All @@ -22,6 +22,9 @@ inputs:
disable-nix-access-token: # 'true' or 'false'
description: 'Disable configuration of nix access-tokens with the GitHub token used in the workflow'
default: 'false'
skip-nix-installation: # 'true' or 'false'
description: 'Skip the installation of nix'
default: 'false'

runs:
using: "composite"
Expand Down Expand Up @@ -116,6 +119,7 @@ runs:
echo "access-tokens = github.com=${{ github.token }}" >> ~/.config/nix/nix.conf
- name: Install nix
if: inputs.skip-nix-installation == 'false'
uses: DeterminateSystems/nix-installer-action@v4
with:
logger: pretty
Expand Down

0 comments on commit 6b09349

Please sign in to comment.