Modular, context-aware and aspect-oriented dendritic Nix configurations. Discussions: https://oeiuwq.zulipchat.com/join/nqp26cd4kngon6mo3ncgnuap/ den.oeiuwq.com
configurations den dendritic nix aspect oriented
at cross 47 lines 1.7 kB view raw
1on: 2 push: 3 branches: [main] 4 pull_request: 5 types: [labeled, opened, synchronize, reopened, review_requested, ready_for_review] 6concurrency: 7 group: ${{ github.workflow }}-${{ github.ref }} 8 cancel-in-progress: true 9jobs: 10 non-draft: 11 runs-on: ubuntu-latest 12 steps: 13 - run: test "true" = "${{github.ref == 'refs/heads/main' || github.event.pull_request.draft == false}}" 14 flake-check: 15 needs: [non-draft] 16 name: nix flake check 17 runs-on: ubuntu-latest 18 steps: 19 - uses: cachix/install-nix-action@v31 20 - run: nix flake check -L github:vic/checkmate --override-input target github:$GITHUB_REPOSITORY/$GITHUB_SHA 21 template: 22 needs: [non-draft] 23 strategy: 24 matrix: 25 os: [ubuntu-latest, macos-latest] 26 template: [default, bogus, examples] 27 name: Check template ${{matrix.template}} ${{matrix.os}} 28 runs-on: ${{matrix.os}} 29 steps: 30 - uses: wimpysworld/nothing-but-nix@main 31 if: matrix.os == 'ubuntu-latest' 32 - uses: cachix/install-nix-action@v31 33 - uses: DeterminateSystems/magic-nix-cache-action@v13 34 - run: nix flake init -t github:$GITHUB_REPOSITORY/$GITHUB_SHA#${{matrix.template}} 35 - run: | 36 cat <<-EOF > modules/ci-runtime.nix 37 { lib, ... }: 38 { 39 flake-file.inputs.den.url = lib.mkForce "github:$GITHUB_REPOSITORY/$GITHUB_SHA"; 40 _module.args.CI = true; 41 } 42 EOF 43 - run: nix run .#write-flake --override-input den "github:$GITHUB_REPOSITORY/$GITHUB_SHA" 44 - run: nix flake update den 45 - run: nix run .#write-flake 46 - run: nix flake metadata 47 - run: nix flake check