-
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1853 from NotExactlySiev/flake
Nix Support
- Loading branch information
Showing
5 changed files
with
361 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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 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 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.