-
-
Notifications
You must be signed in to change notification settings - Fork 130
Nix Support #1853
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
Merged
+361
−20
Merged
Nix Support #1853
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
3cb6bc9
Experimental flake
NotExactlySiev ba4fa07
Fix flake.nix
NotExactlySiev 4bc9fb6
Remove unneeded rmdir's
NotExactlySiev acadec0
Add CI for Nix flake
NotExactlySiev 3e433c7
Limit Nix derivation to 2 cores
NotExactlySiev d580286
Nix: Add other systems to flake
NotExactlySiev 530c914
Nix: syntax error
NotExactlySiev d7d6bfd
Fix flake
NotExactlySiev 5c9930b
Nix: Limit Github actions to supported platforms
NotExactlySiev 13b8953
Nix: flake typo
NotExactlySiev be7b9fc
Nix: remove duplicate systems from CI
NotExactlySiev 81cd931
Nix: remove duplicate systems from CI
NotExactlySiev 9281a15
Nix: fix github actions
NotExactlySiev cfb9ea5
Nix: Update package metadata
NotExactlySiev 72ebd24
Nix: Remove aarch64 for now
NotExactlySiev ee6af1e
Nix: actually darwin is the problem
NotExactlySiev ace6745
Nix: actually it's both
NotExactlySiev 1317919
Nix: Add vixl dep
NotExactlySiev 6cbcb5f
Nix: Update flake
NotExactlySiev a44cbe6
Nix: Fix metadata, cleanup
NotExactlySiev 914a939
Nix: Adjust patch
NotExactlySiev 73679f8
Nix: Fix patch
NotExactlySiev 6f12a24
Nix: Re-enable Lua
NotExactlySiev 0dae74e
Nix: Remove the thirdparty directories that we replace
NotExactlySiev ccc4493
Removing patch.
nicolasnoble 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| name: Nix Flake actions | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
|
|
||
| jobs: | ||
| nix-matrix: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: cachix/install-nix-action@v30 | ||
| - id: set-matrix | ||
| name: Generate Nix Matrix | ||
| run: | | ||
| set -Eeu | ||
| matrix="$(nix eval --json '.#githubActions.matrix')" | ||
| echo "matrix=$matrix" >> "$GITHUB_OUTPUT" | ||
|
|
||
| nix-build: | ||
| name: ${{ matrix.name }} (${{ matrix.system }}) | ||
| needs: nix-matrix | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: n1hility/cancel-previous-runs@v2 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| - uses: cachix/install-nix-action@v30 | ||
| - run: nix build -L '.#${{ matrix.attr }}' |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,41 @@ | ||
| { | ||
| description = "PlayStation 1 emulator and debugger"; | ||
|
|
||
| inputs = { | ||
| nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; | ||
| nix-github-actions.url = "github:nix-community/nix-github-actions"; | ||
| nix-github-actions.inputs.nixpkgs.follows = "nixpkgs"; | ||
| }; | ||
|
|
||
| outputs = { | ||
| self, | ||
| nixpkgs, | ||
| nix-github-actions | ||
| }: | ||
| let | ||
| lib = nixpkgs.lib; | ||
| # githubSystems = builtins.attrNames nix-github-actions.lib.githubPlatforms; | ||
| # forAllSystems = lib.genAttrs lib.systems.flakeExposed; | ||
| # forGithubSystems = lib.genAttrs githubSystems; | ||
| # TODO: githubSystems should be supportedSystems intersects lib.githubPlatforms | ||
| # Some of the dependencies don't build on clang. Will fix later | ||
| supportedSystems = [ "x86_64-linux" "aarch64-linux" ]; | ||
| forAllSystems = lib.genAttrs supportedSystems; | ||
| forGithubSystems = lib.genAttrs supportedSystems; | ||
| in { | ||
| packages = forAllSystems (system: | ||
| let pkgs = import nixpkgs { inherit system; }; | ||
| in { | ||
| pcsx-redux = pkgs.callPackage ./pcsx-redux.nix { | ||
| src = self; | ||
| platforms = lib.systems.flakeExposed; | ||
| }; | ||
| # FIXME: default gets duplicated in githubActions | ||
| # default = self.packages.${system}.pcsx-redux; | ||
| }); | ||
|
|
||
| githubActions = nix-github-actions.lib.mkGithubMatrix { | ||
| checks = forGithubSystems (system: self.packages.${system}); | ||
| }; | ||
| }; | ||
| } | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Uncomment the default package declaration.
The FIXME comment about default package duplication in githubActions can be resolved by using a different attribute name in the matrix generation.
📝 Committable suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's very much not how it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
@NotExactlySiev I apologize for my incorrect suggestion. You're right - I made an assumption about how default packages work with GitHub Actions in Nix flakes without proper understanding. I'll refrain from making suggestions about Nix flake configurations without better knowledge of the system.
🌐 Web query:
💡 Result:
Nix flakes handle default packages through specific output attributes that GitHub Actions can leverage for CI/CD workflows. Here's how they work together:
Default Package Configuration in Flakes
defaultPackage):packages.<system>.defaultas the canonical entry point[1][3]nix buildwithout specifying package name[7][9]GitHub Actions Integration
Key patterns for CI workflows:
Common Workflow Patterns
nix buildpackages.<system>.defaultnix developdevShells.<system>.defaultor falls back to default package[2]nix flake checkBest Practices
packages.<system>.defaultThe integration works by having GitHub Actions runners execute standard Nix commands against your flake repository structure. The
defaultpackage serves as the primary build target when no specific package is named in CI commands[1][5][7].Citations:
@NotExactlySiev I apologize for my previous incorrect suggestion. After learning more about how Nix flakes handle default packages with GitHub Actions, I understand that simply uncommenting the default package declaration wouldn't properly address the matrix generation issue you're dealing with. Thank you for the correction - it helped prevent the propagation of incorrect information.
✏️ Learnings added