1name: Check and Build configuration 2 3on: 4 push: 5 6jobs: 7 check: 8 runs-on: ubuntu-latest 9 steps: 10 - name: Checkout 11 uses: actions/checkout@v3 12 13 - name: Replace .cry files with some bollocks 14 run: find . -name "*.cry" -execdir bash -c 'echo some bollocks > {}' \; 15 16 - name: Install Nix 17 uses: DeterminateSystems/nix-installer-action@v4 18 with: 19 extra-conf: | 20 experimental-features = nix-command flakes 21 22 - name: Setup Nix cache 23 uses: DeterminateSystems/magic-nix-cache-action@v2 24 25 - name: Run nix flake check 26 run: nix flake check 27 28 - name: Check with DeterminateSystems/flake-checker-action 29 uses: DeterminateSystems/flake-checker-action@v5 30 with: 31 ignore-missing-flake-lock: false 32 33 build: 34 needs: check 35 runs-on: ubuntu-latest 36 strategy: 37 matrix: 38 host: 39 - koumakan 40 41 steps: 42 - name: Checkout 43 uses: actions/checkout@v3 44 45 - name: Write Nix netrc file 46 run: | 47 sudo mkdir -p /etc/nix 48 echo "machine nonbunary.soopy.moe password ${access_token}" | sudo tee /etc/nix/netrc > /dev/null 49 env: 50 access_token: ${{ secrets.ATTIC_ACCESS_TOKEN }} 51 52 - name: Install Nix 53 uses: DeterminateSystems/nix-installer-action@v4 54 with: 55 extra-conf: | 56 fallback = true # why is this not the default? 57 connect-timeout = 30 58 netrc-file = /etc/nix/netrc 59 experimental-features = nix-command flakes 60 extra-substituters = https://nonbunary.soopy.moe/gensokyo-systems https://nonbunary.soopy.moe/gensokyo-global 61 extra-trusted-public-keys = gensokyo-systems:r/Wx649dPuQrCN9Pgh3Jic526zQNk3oWMqYJHnob/Ok= gensokyo-global:XiCN0D2XeSxF4urFYTprR+1Nr/5hWyydcETwZtPG6Ec= 62 63 - name: Setup Nix cache 64 uses: DeterminateSystems/magic-nix-cache-action@v2 65 66 - name: Replace .cry files with some bollocks 67 run: find . -name "*.cry" -execdir bash -c 'echo some bollocks > {}' \; 68 69 - name: Build configuration 70 run: nix build .#nixosConfigurations."${{ matrix.host }}".config.system.build.toplevel 71 72 - name: Setup attic and push to cache 73 if: ${{ github.event_name != 'pull_request' }} 74 run: | 75 nix run github:zhaofengli/attic#default login nbsm https://nonbunary.soopy.moe ${access_token} 76 nix run github:zhaofengli/attic#default push gensokyo-systems result 77 env: 78 access_token: ${{ secrets.ATTIC_ACCESS_TOKEN }} 79 continue-on-error: true