2024-06-14 11:54:03 -05:00
|
|
|
name: Run Nix Flake Checks
|
|
|
|
|
|
|
|
on:
|
2024-06-14 11:54:54 -05:00
|
|
|
workflow_call:
|
2024-06-14 11:54:03 -05:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
lockFile:
|
|
|
|
description: 'flake.lock file'
|
|
|
|
type: string
|
|
|
|
|
|
|
|
jobs:
|
2024-06-18 11:14:15 -05:00
|
|
|
checks:
|
2024-06-14 11:54:03 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
2024-06-14 14:40:02 -05:00
|
|
|
- uses: ./.github/actions/clean-disk
|
2024-06-14 15:02:01 -05:00
|
|
|
with:
|
|
|
|
purge-packages: false
|
2024-06-14 14:40:02 -05:00
|
|
|
|
2024-06-14 11:54:03 -05:00
|
|
|
- uses: DeterminateSystems/nix-installer-action@main
|
2024-06-18 11:14:15 -05:00
|
|
|
with:
|
|
|
|
extra-conf: |
|
|
|
|
accept-flake-config = true
|
2024-06-14 12:36:32 -05:00
|
|
|
- uses: DeterminateSystems/magic-nix-cache-action@v7
|
2024-06-14 11:54:03 -05:00
|
|
|
|
2024-06-14 12:36:35 -05:00
|
|
|
- uses: cachix/cachix-action@v15
|
2024-06-14 11:54:03 -05:00
|
|
|
with:
|
|
|
|
name: daylin
|
|
|
|
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
|
|
|
|
|
|
|
- name: write lock file
|
|
|
|
if: "${{ inputs.lockFile != '' }}"
|
|
|
|
run: |
|
|
|
|
echo '${{ inputs.lockFile }}' > flake.lock
|
|
|
|
git diff
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
2024-06-18 11:14:15 -05:00
|
|
|
set -euo pipefail
|
|
|
|
# cachix watch-exec daylin -- nix build '.#checks.x86_64-linux.makePackages'
|
|
|
|
host=othalan
|
|
|
|
system_attr=$(nix run . -- output --host "$host" --flake .)
|
|
|
|
system_path=$(nix derivation show $system_attr | jq -r '.[].inputDrvs | with_entries(select(.key|match("system-path";"i"))) | keys | .[]')
|
|
|
|
|
|
|
|
echo "path to system-path drv ==> $system_path"
|
|
|
|
cachix watch-exec daylin -- nix build --print-build-logs "$system_path^*"
|
|
|
|
|