Skip to content

Commit

Permalink
Add nix flake checking action
Browse files Browse the repository at this point in the history
Signed-off-by: Aiden Fox Ivey <[email protected]>
  • Loading branch information
aidenfoxivey committed Jan 19, 2025
1 parent de5beca commit 7d7b974
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/nix-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "Nix Flake Check"

Check failure

Code scanning / Scorecard

Token-Permissions High

score is 0: no topLevel permission defined
Remediation tip: Visit https://app.stepsecurity.io/secureworkflow.
Tick the 'Restrict permissions for GITHUB_TOKEN'
Untick other options
NOTE: If you want to resolve multiple issues at once, you can visit https://app.stepsecurity.io/securerepo instead.
Click Remediation section below for further remediation help
on:
pull_request:
push:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 8: GitHub-owned GitHubAction not pinned by hash
Click Remediation section below to solve this issue
- uses: cachix/install-nix-action@v27

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 8: third-party GitHubAction not pinned by hash
Click Remediation section below to solve this issue
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- run: nix build # check that the build runs
- run: nix flake check # check for accurate syntax
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ __pycache__
.CMake/a.out
compile_commands.json

# Generated by Nix flake
result/

11 changes: 9 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
mkLib = shared:
stdenv.mkDerivation {
inherit name src;
# for whatever reason, trying to 'fix' the CMake file causes a failure
dontFixCmake = true;

nativeBuildInputs = with pkgs;
[cmake ninja doxygen pkg-config graphviz]
++ (
Expand Down Expand Up @@ -71,10 +74,14 @@
'';
};
in {
formatter = pkgs.alejandra;

packages = {
default = (mkPackageSet "gcc").shared; # default is gcc shared
gcc = mkPackageSet "gcc";
clang = mkPackageSet "clang";
gcc-shared = (mkPackageSet "gcc").shared;
clang-shared = (mkPackageSet "clang").shared;
gcc-static = (mkPackageSet "gcc").static;
clang-static = (mkPackageSet "clang").static;
};

# Development shells
Expand Down

0 comments on commit 7d7b974

Please sign in to comment.