Skip to content

Commit

Permalink
Merge pull request #47 from matter-labs/attic
Browse files Browse the repository at this point in the history
chore: Migrate from cachix to Attic in nix and github workflows
  • Loading branch information
haraldh committed Jul 1, 2024
2 parents 3a27295 + 971e637 commit 347a89b
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 24 deletions.
39 changes: 27 additions & 12 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,52 +12,67 @@ concurrency:

jobs:
fmt:
runs-on: ubuntu-latest
runs-on: [ matterlabs-ci-runner ]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: cachix/install-nix-action@v27
with:
extra_nix_config: |
access-tokens = github.com=${{ github.token }}
- uses: cachix/cachix-action@v15
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= tee-pot:SS6HcrpG87S1M6HZGPsfo7d1xJccCGev7/tXc5+I4jg=
substituters = https://cache.nixos.org/ https://attic.teepot.org/tee-pot
sandbox = true
- name: Setup Attic cache
uses: ryanccn/attic-action@v0
with:
name: nixsgx
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
endpoint: https://attic.teepot.org/
cache: tee-pot
token: ${{ secrets.ATTIC_TOKEN }}
- name: Enable magic Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main

- run: nix fmt . -- --check

check:
runs-on: ubuntu-latest
runs-on: [ matterlabs-ci-runner ]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: cachix/install-nix-action@v27
with:
extra_nix_config: |
access-tokens = github.com=${{ github.token }}
- uses: cachix/cachix-action@v15
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= tee-pot:SS6HcrpG87S1M6HZGPsfo7d1xJccCGev7/tXc5+I4jg=
substituters = https://cache.nixos.org/ https://attic.teepot.org/tee-pot
sandbox = true
- name: Setup Attic cache
uses: ryanccn/attic-action@v0
with:
name: nixsgx
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
endpoint: https://attic.teepot.org/
cache: tee-pot
token: ${{ secrets.ATTIC_TOKEN }}
- name: Enable magic Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main

- run: nix flake check -L --show-trace --keep-going

build:
needs: check
runs-on: ubuntu-latest
runs-on: [ matterlabs-ci-runner ]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: cachix/install-nix-action@v27
with:
extra_nix_config: |
access-tokens = github.com=${{ github.token }}
- uses: cachix/cachix-action@v15
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= tee-pot:SS6HcrpG87S1M6HZGPsfo7d1xJccCGev7/tXc5+I4jg=
substituters = https://cache.nixos.org/ https://attic.teepot.org/tee-pot
sandbox = true
- name: Setup Attic cache
uses: ryanccn/attic-action@v0
with:
name: nixsgx
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
endpoint: https://attic.teepot.org/
cache: tee-pot
token: ${{ secrets.ATTIC_TOKEN }}
- name: Enable magic Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main

Expand Down
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
nixConfig.extra-substituters = [
"https://nixsgx.cachix.org"
];
nixConfig.extra-trusted-public-keys = [
"nixsgx.cachix.org-1:tGi36DlY2joNsIXOlGnSgWW0+E094V6hW0umQRo/KoE="
];
nixConfig = {
extra-substituters = [ "https://attic.teepot.org/tee-pot" ];
extra-trusted-public-keys = [ "tee-pot:SS6HcrpG87S1M6HZGPsfo7d1xJccCGev7/tXc5+I4jg=" ];
};

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
Expand Down
2 changes: 2 additions & 0 deletions packages/sgx-sdk/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
, python3
, texinfo
, validatePkgConfig
, which
, writeShellApplication
, writeShellScript
, writeText
Expand Down Expand Up @@ -91,6 +92,7 @@ stdenv.mkDerivation rec {
python3
texinfo
validatePkgConfig
which
];

buildInputs = [
Expand Down

0 comments on commit 347a89b

Please sign in to comment.