2024-05-23 13:27:08 -05:00
|
|
|
name: Build NixOS (on demand)
|
2024-01-23 16:09:05 -06:00
|
|
|
|
2024-01-23 11:51:13 -06:00
|
|
|
on:
|
2024-05-23 13:27:08 -05:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
2024-06-20 11:17:27 -05:00
|
|
|
hosts:
|
2024-06-14 15:02:01 -05:00
|
|
|
description: 'list of hosts to build'
|
2024-05-23 13:27:08 -05:00
|
|
|
required: true
|
2024-06-14 15:02:01 -05:00
|
|
|
default: 'othalan algiz'
|
2024-05-23 13:27:08 -05:00
|
|
|
type: string
|
|
|
|
lockFile:
|
|
|
|
description: 'flake.lock file'
|
|
|
|
type: string
|
|
|
|
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
2024-06-20 11:17:27 -05:00
|
|
|
hosts:
|
2024-06-14 15:02:01 -05:00
|
|
|
description: 'list of hosts to build'
|
2024-06-20 12:47:16 -05:00
|
|
|
default: 'othalan algiz'
|
2024-05-23 13:27:08 -05:00
|
|
|
type: string
|
|
|
|
|
2024-06-20 11:17:27 -05:00
|
|
|
# concurrency:
|
|
|
|
# group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.host }}
|
|
|
|
# cancel-in-progress: true
|
2024-01-23 11:51:13 -06:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-06-14 12:17:39 -05:00
|
|
|
- name: Checkout
|
2024-06-14 12:36:34 -05:00
|
|
|
uses: actions/checkout@v4
|
2024-06-14 12:17:39 -05:00
|
|
|
|
2024-06-14 15:02:01 -05:00
|
|
|
- uses: ./.github/actions/clean-disk
|
2024-05-23 13:27:08 -05:00
|
|
|
|
2024-06-18 11:14:15 -05:00
|
|
|
- uses: DeterminateSystems/nix-installer-action@v12
|
|
|
|
with:
|
|
|
|
extra-conf: |
|
|
|
|
accept-flake-config = true
|
2024-06-29 18:10:42 -05:00
|
|
|
|
2024-06-14 12:36:32 -05:00
|
|
|
- uses: DeterminateSystems/magic-nix-cache-action@v7
|
2024-02-19 14:16:00 -06:00
|
|
|
|
2024-06-14 12:36:35 -05:00
|
|
|
- uses: cachix/cachix-action@v15
|
2024-01-23 11:51:13 -06:00
|
|
|
with:
|
|
|
|
name: daylin
|
|
|
|
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
2024-02-19 14:16:00 -06:00
|
|
|
|
2024-06-29 18:10:42 -05:00
|
|
|
- name: Swap Lix for nix
|
|
|
|
run: |
|
|
|
|
which nix
|
|
|
|
sudo nix run \
|
|
|
|
--experimental-features "nix-command flakes" \
|
|
|
|
--extra-substituters https://cache.lix.systems --extra-trusted-public-keys "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" \
|
|
|
|
'git+https://git@git.lix.systems/lix-project/lix?ref=refs/tags/2.90.0-rc1' -- \
|
|
|
|
upgrade-nix \
|
|
|
|
--extra-substituters https://cache.lix.systems --extra-trusted-public-keys "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
|
|
|
|
|
2024-05-23 13:27:08 -05:00
|
|
|
- name: write lock file
|
|
|
|
if: "${{ inputs.lockFile != '' }}"
|
|
|
|
run: |
|
|
|
|
echo '${{ inputs.lockFile }}' > flake.lock
|
|
|
|
git diff
|
|
|
|
|
2024-01-30 13:40:15 -06:00
|
|
|
- name: Build
|
|
|
|
run: |
|
2024-06-20 11:17:27 -05:00
|
|
|
for host in ${{ inputs.hosts }}; do
|
|
|
|
nix run . \
|
|
|
|
-- \
|
2024-06-24 12:53:07 -05:00
|
|
|
build --minimal \
|
2024-06-20 11:17:27 -05:00
|
|
|
--host "$host" \
|
|
|
|
--flake . \
|
2024-06-23 09:40:20 -05:00
|
|
|
--verbose \
|
2024-06-20 11:17:27 -05:00
|
|
|
-- \
|
|
|
|
--print-build-logs
|
2024-06-14 15:02:01 -05:00
|
|
|
done
|