-
Notifications
You must be signed in to change notification settings - Fork 22
Try moving to Nix Experimental installer #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Lagoja
wants to merge
12
commits into
main
Choose a base branch
from
jl/migrate-installer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e3febc2
Try moving to Nix Experimental installer
Lagoja c8e141c
Fix action directory structure
Lagoja f596b08
run --no-interactive
Lagoja ad937bd
Remove Nix Package URL
Lagoja 7b21e62
Remove unused values
Lagoja 8a67f30
Add flakes and nix command by default
Lagoja 219b7e1
Remove dupe file
Lagoja b71faa2
fix subdir
Lagoja cda181e
undo change
Lagoja 5b8159d
Inline the nix install steps
Lagoja a0ed4fc
Add Environment Variables
Lagoja 3bbb7a8
Pull in all variables
Lagoja File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| name: 'Experimental Nix Installer' | ||
| description: 'Install Nix using the experimental installer' | ||
| branding: | ||
| icon: 'box' | ||
| color: 'blue' | ||
|
|
||
| inputs: | ||
| extra-conf: | ||
| description: 'Extra configuration to add to nix.conf' | ||
| default: '' | ||
| logger: | ||
| description: 'Logger format (compact, full, pretty)' | ||
| default: 'pretty' | ||
| nix-build-user-count: | ||
| description: 'Number of build users to create' | ||
| default: '32' | ||
| nix-build-group-name: | ||
| description: 'Name of the build group' | ||
| default: 'nixbld' | ||
| nix-build-group-id: | ||
| description: 'GID of the build group' | ||
| default: '30000' | ||
| modify-profile: | ||
| description: 'Modify user profile to set up environment' | ||
| default: 'true' | ||
| daemon: | ||
| description: 'Use daemon mode' | ||
| default: 'true' | ||
| init: | ||
| description: 'Init mode for installation' | ||
| default: 'systemd' | ||
| start-daemon: | ||
| description: 'Start the Nix daemon after installation' | ||
| default: 'true' | ||
| trust-runner-user: | ||
| description: 'Add runner user to trusted users' | ||
| default: 'true' | ||
| channels: | ||
| description: 'Nix channels to add' | ||
| default: 'nixpkgs=https://nixos.org/channels/nixpkgs-unstable' | ||
|
|
||
| outputs: | ||
| nix-version: | ||
| description: 'The version of Nix that was installed' | ||
| value: ${{ steps.nix-install.outputs.nix-version }} | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Download and install experimental Nix installer | ||
| id: nix-install | ||
| shell: bash | ||
| env: | ||
| NIX_INSTALLER_EXTRA_CONF: ${{ inputs.extra-conf }} | ||
| NIX_INSTALLER_LOGGER: ${{ inputs.logger }} | ||
| NIX_INSTALLER_NIX_BUILD_USER_COUNT: ${{ inputs.nix-build-user-count }} | ||
| NIX_INSTALLER_NIX_BUILD_GROUP_NAME: ${{ inputs.nix-build-group-name }} | ||
| NIX_INSTALLER_NIX_BUILD_GROUP_ID: ${{ inputs.nix-build-group-id }} | ||
| NIX_INSTALLER_MODIFY_PROFILE: ${{ inputs.modify-profile }} | ||
| NIX_INSTALLER_INIT: ${{ inputs.init }} | ||
| NIX_INSTALLER_START_DAEMON: ${{ inputs.start-daemon }} | ||
| NIX_INSTALLER_TRUST_RUNNER_USER: ${{ inputs.trust-runner-user }} | ||
| NIX_INSTALLER_CHANNELS: ${{ inputs.channels }} | ||
| run: | | ||
| echo "Installing Nix using experimental installer..." | ||
|
|
||
| # Download and run the experimental installer | ||
| curl --proto '=https' --tlsv1.2 -sSf -L https://artifacts.nixos.org/experimental-installer | \ | ||
| sh -s -- install --no-confirm | ||
|
|
||
| # Source the nix profile to make nix available in current shell | ||
| if [ -f ~/.nix-profile/etc/profile.d/nix.sh ]; then | ||
| source ~/.nix-profile/etc/profile.d/nix.sh | ||
| elif [ -f /etc/profile.d/nix.sh ]; then | ||
| source /etc/profile.d/nix.sh | ||
| fi | ||
|
|
||
| # Get Nix version and set output | ||
| NIX_VERSION=$(nix --version | awk '{print $NF}') | ||
| echo "nix-version=$NIX_VERSION" >> $GITHUB_OUTPUT | ||
| echo "Installed Nix version: $NIX_VERSION" | ||
|
|
||
| # Verify installation | ||
| nix --version | ||
| nix-env --version | ||
|
|
||
| - name: Add extra configuration | ||
| if: inputs.extra-conf != '' | ||
| shell: bash | ||
| run: | | ||
| echo "Adding extra Nix configuration..." | ||
| mkdir -p ~/.config/nix | ||
| echo "${{ inputs.extra-conf }}" >> ~/.config/nix/nix.conf | ||
| echo "Extra configuration added to nix.conf" | ||
|
|
||
| - name: Configure GitHub access token | ||
| if: github.server_url == 'https://github.com' | ||
| shell: bash | ||
| run: | | ||
| echo "Configuring GitHub access token for Nix..." | ||
| mkdir -p ~/.config/nix | ||
| echo "access-tokens = github.com=${{ github.token }}" >> ~/.config/nix/nix.conf | ||
| echo "GitHub access token configured" | ||
|
|
||
| - name: Verify Nix installation | ||
| shell: bash | ||
| run: | | ||
| echo "Verifying Nix installation..." | ||
| echo "Nix version: $(nix --version)" | ||
| echo "Nix store info:" | ||
| nix store info || echo "Store info not available" | ||
| echo "Nix channels:" | ||
| nix-channel --list || echo "No channels configured" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.