diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml new file mode 100644 index 000000000..2670e7b9c --- /dev/null +++ b/.github/workflows/nix.yml @@ -0,0 +1,43 @@ +name: 📦 Nix Build + +on: + push: + branches: [ main ] + + pull_request: + branches: [ '**' ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + run-checks: + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - name: Install Protoc + uses: arduino/setup-protoc@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@v4 + + - name: Cache Magic + uses: DeterminateSystems/magic-nix-cache-action@v2 + + - name: Check Nix flake inputs + uses: DeterminateSystems/flake-checker-action@v5 + with: + ignore-missing-flake-lock: false + fail-mode: true + + - name: Nix Build + run: | + nix develop --show-trace -c irust --version + nix develop --show-trace -c rustc --version diff --git a/flake.lock b/flake.lock index f70e21f95..9c04b48da 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -20,11 +36,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1688465017, - "narHash": "sha256-xzFcCnzPOgQaX7Acprfqo+tqHJ2UKWC38pXrcqvdXHU=", + "lastModified": 1688523306, + "narHash": "sha256-xcJHmwlw0w05D/c8oPX6COxVLYNbu6lXF2mIV7dFGkc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0d5682acc109add20f70440269587a1b169cc2fe", + "rev": "023b1df882979a413a3f7e2009424db30d51a0fe", "type": "github" }, "original": { @@ -36,6 +52,7 @@ }, "root": { "inputs": { + "flake-compat": "flake-compat", "flake-utils": "flake-utils", "nixpkgs": "nixpkgs", "rust-overlay": "rust-overlay" @@ -51,11 +68,11 @@ ] }, "locked": { - "lastModified": 1688438033, - "narHash": "sha256-wOmpZis06pVKTR+5meGwhrW10/buf98lnA26uQLaqek=", + "lastModified": 1688524421, + "narHash": "sha256-EFauqXKKjbJKPWv3kbzl1lm1GnXl0+DBK4RcLuFndZQ=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "c3e43223dece545cfe06ddd92fd782adc73d56c3", + "rev": "ab050286f18ea354bfe7a49ca8ddcbd633cae1ca", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index ee823f62d..5083851e8 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,12 @@ # we leverage unstable due to wasm-tools/wasm updates nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; + + flake-compat = { + url = "github:edolstra/flake-compat"; + flake = false; + }; + rust-overlay = { url = "github:oxalica/rust-overlay"; inputs.nixpkgs.follows = "nixpkgs"; @@ -15,6 +21,7 @@ outputs = { self, nixpkgs, + flake-compat, flake-utils, rust-overlay, } @ inputs: @@ -193,6 +200,7 @@ darwin.apple_sdk.frameworks.CoreFoundation darwin.apple_sdk.frameworks.Foundation ]; + NIX_PATH = "nixpkgs=" + pkgs.path; RUST_BACKTRACE = 1; shellHook = ''