My nixos configuration
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

rewrite workflow

+51 -8
+51 -8
.github/workflows/flake-update.yml
··· 27 27 install_url: https://releases.nixos.org/nix/nix-2.7.0/install 28 28 - id: gen_matrix 29 29 run: | 30 - matrix=$(nix flake show --json | jq -c '.checks."x86_64-linux" | keys') 30 + matrix=$(nix flake show --json | jq -c '.packages."x86_64-linux" | keys') 31 31 printf "%s" "$matrix" | jq 32 32 printf "::set-output name=matrix::%s" "$matrix" 33 33 ··· 45 45 46 46 update_flake: 47 47 runs-on: ubuntu-20.04 48 - needs: generate_matrix 48 + steps: 49 + - name: Clone repository 50 + uses: actions/checkout@v3 51 + with: 52 + token: '${{ secrets.GITHUB_TOKEN }}' 53 + - name: Install nix 54 + uses: cachix/install-nix-action@v16 55 + with: 56 + extra_nix_config: | 57 + auto-optimise-store = true 58 + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} 59 + experimental-features = nix-command flakes 60 + substituters = https://cache.nixos.org/ https://nix-community.cachix.org 61 + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= 62 + install_url: https://releases.nixos.org/nix/nix-2.7.0/install 63 + - name: Set up git 64 + run: | 65 + git config user.email gitbot@nobbz.dev 66 + git config user.name "Git Bot" 67 + - name: Update the flake 68 + run: nix flake update 69 + - name: Store flake.lock 70 + uses: actions/upload-artifact@v3 71 + with: 72 + name: flake_lock 73 + path: flake.lock 74 + 75 + build_flake: 76 + runs-on: ubuntu-20.04 77 + needs: [generate_matrix, update_flake] 49 78 permissions: write-all 50 79 strategy: 51 80 fail-fast: false 52 81 matrix: 53 - check: ${{fromJson(needs.generate_matrix.outputs.matrix)}} 82 + package: ${{fromJson(needs.generate_matrix.outputs.matrix)}} 54 83 steps: 55 84 - name: Prepare store folder 56 85 run: sudo mkdir -p /nix ··· 80 109 with: 81 110 name: nobbz 82 111 signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' 112 + - name: Restore flake.lock 113 + uses: actions/download-artifact@v3 114 + with: 115 + name: flake_lock 116 + - name: Build everything 117 + run: nix build .#${{ matrix.package }} 118 + 119 + push_update: 120 + runs-on: ubuntu-20.04 121 + needs: [update_flake, build_flake] 122 + - name: Clone repository 123 + uses: actions/checkout@v3 124 + with: 125 + token: '${{ secrets.GITHUB_TOKEN }}' 126 + - name: Restore flake.lock 127 + uses: actions/download-artifact@v3 128 + with: 129 + name: flake_lock 83 130 - name: Set up git 84 131 run: | 85 132 git config user.email gitbot@nobbz.dev 86 133 git config user.name "Git Bot" 87 - git switch -c updates-${{ github.run_id }} 88 - - name: Update the flake 89 - run: nix flake update --commit-lock-file 90 - - name: Build everything 91 - run: nix build .#checks.x86_64-linux.${{ matrix.check }} 92 134 - name: Create and merge PR 93 135 run: | 136 + git commit -am "flake.lock: Update" 94 137 git push -u origin updates-${{ github.run_id }} 95 138 PR=$(gh pr create \ 96 139 --assignee NobbZ \