mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-23 20:08:28 +01:00
Compare commits
No commits in common. "116ac08ad898e217ab054483261efc0d65a60491" and "da5df4f2ee8d84de31beeff69ed1ac03e7fa1a58" have entirely different histories.
116ac08ad8
...
da5df4f2ee
3 changed files with 39 additions and 70 deletions
29
.github/workflows/build-host.yml
vendored
29
.github/workflows/build-host.yml
vendored
|
|
@ -1,29 +0,0 @@
|
||||||
name: Build host
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
hosts:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
secrets:
|
|
||||||
CACHIX_AUTH_TOKEN:
|
|
||||||
required: true
|
|
||||||
jobs:
|
|
||||||
build-host:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
host: ${{ fromJson(inputs.hosts) }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- uses: cachix/install-nix-action@v31
|
|
||||||
with:
|
|
||||||
extra_nix_config: experimental-features = nix-command flakes pipe-operators
|
|
||||||
- uses: cachix/cachix-action@v15
|
|
||||||
with:
|
|
||||||
name: sebastian-stork
|
|
||||||
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
|
||||||
useDaemon: false
|
|
||||||
- name: Build host
|
|
||||||
run: nix build .#nixosConfigurations.${{ matrix.host }}.config.system.build.toplevel --print-build-logs
|
|
||||||
73
.github/workflows/ci.yml
vendored
73
.github/workflows/ci.yml
vendored
|
|
@ -8,36 +8,20 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
checks: ${{ steps.checks.outputs.checks }}
|
checks: ${{ steps.checks.outputs.checks }}
|
||||||
servers: ${{ steps.servers.outputs.servers }}
|
hosts: ${{ steps.hosts.outputs.hosts }}
|
||||||
workstations: ${{ steps.workstations.outputs.workstations }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
- uses: cachix/install-nix-action@v31
|
- uses: cachix/install-nix-action@v31
|
||||||
with:
|
with:
|
||||||
extra_nix_config: experimental-features = nix-command flakes pipe-operators
|
extra_nix_config: experimental-features = nix-command flakes pipe-operators
|
||||||
- name: Get checks
|
- id: checks
|
||||||
id: checks
|
|
||||||
run: |
|
run: |
|
||||||
checks=$(nix flake show --json | jq -c '.checks."x86_64-linux" | keys')
|
checks=$(nix flake show --json | jq -c '.checks."x86_64-linux" | keys')
|
||||||
printf "checks=%s" "$checks" >> "$GITHUB_OUTPUT"
|
printf "checks=%s" "$checks" >> "$GITHUB_OUTPUT"
|
||||||
- name: Get servers
|
- id: hosts
|
||||||
id: servers
|
|
||||||
run: |
|
run: |
|
||||||
servers=$(nix eval .#nixosConfigurations --apply 'configs:
|
hosts=$(nix flake show --json | jq -c '.nixosConfigurations | keys')
|
||||||
configs
|
printf "hosts=%s" "$hosts" >> "$GITHUB_OUTPUT"
|
||||||
|> builtins.attrNames
|
|
||||||
|> builtins.filter (name: configs.${name}.config.custom.services.comin.enable)
|
|
||||||
' --json)
|
|
||||||
printf "servers=%s" "$servers" >> "$GITHUB_OUTPUT"
|
|
||||||
- name: Get workstations
|
|
||||||
id: workstations
|
|
||||||
run: |
|
|
||||||
workstations=$(nix eval .#nixosConfigurations --apply 'configs:
|
|
||||||
configs
|
|
||||||
|> builtins.attrNames
|
|
||||||
|> builtins.filter (name: !configs.${name}.config.custom.services.comin.enable)
|
|
||||||
' --json)
|
|
||||||
printf "workstations=%s" "$workstations" >> "$GITHUB_OUTPUT"
|
|
||||||
build-check:
|
build-check:
|
||||||
needs: parse-flake
|
needs: parse-flake
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -55,28 +39,43 @@ jobs:
|
||||||
name: sebastian-stork
|
name: sebastian-stork
|
||||||
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||||
useDaemon: false
|
useDaemon: false
|
||||||
- name: Build check
|
- run: nix build .#checks.x86_64-linux.${{ matrix.check }} --print-build-logs
|
||||||
run: nix build .#checks.x86_64-linux.${{ matrix.check }} --print-build-logs
|
build-host:
|
||||||
build-server:
|
|
||||||
needs: parse-flake
|
needs: parse-flake
|
||||||
uses: ./.github/workflows/build-host.yml
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
host: ${{ fromJson(needs.parse-flake.outputs.hosts) }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v5
|
||||||
|
- uses: cachix/install-nix-action@v31
|
||||||
with:
|
with:
|
||||||
hosts: ${{ needs.parse-flake.outputs.servers }}
|
extra_nix_config: experimental-features = nix-command flakes pipe-operators
|
||||||
secrets:
|
- uses: cachix/cachix-action@v15
|
||||||
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
|
||||||
build-workstation:
|
|
||||||
needs: parse-flake
|
|
||||||
uses: ./.github/workflows/build-host.yml
|
|
||||||
with:
|
with:
|
||||||
hosts: ${{ needs.parse-flake.outputs.workstations }}
|
name: sebastian-stork
|
||||||
secrets:
|
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||||
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
useDaemon: false
|
||||||
|
- run: nix build .#nixosConfigurations.${{ matrix.host }}.config.system.build.toplevel --print-build-logs
|
||||||
|
flake-check:
|
||||||
|
needs: build-check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v5
|
||||||
|
- uses: cachix/install-nix-action@v31
|
||||||
|
with:
|
||||||
|
extra_nix_config: experimental-features = nix-command flakes pipe-operators
|
||||||
|
- uses: cachix/cachix-action@v15
|
||||||
|
with:
|
||||||
|
name: sebastian-stork
|
||||||
|
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||||
|
- run: nix flake check --keep-going --print-build-logs
|
||||||
deploy:
|
deploy:
|
||||||
needs: [build-check, build-server]
|
needs: [build-host, flake-check]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
- name: Push to deploy branch
|
- run: git push origin HEAD:deploy --force
|
||||||
run: git push origin HEAD:deploy --force
|
|
||||||
|
|
|
||||||
3
.github/workflows/update.yml
vendored
3
.github/workflows/update.yml
vendored
|
|
@ -13,8 +13,7 @@ jobs:
|
||||||
- uses: cachix/install-nix-action@v31
|
- uses: cachix/install-nix-action@v31
|
||||||
with:
|
with:
|
||||||
extra_nix_config: experimental-features = nix-command flakes pipe-operators
|
extra_nix_config: experimental-features = nix-command flakes pipe-operators
|
||||||
- name: Update and push
|
- run: |
|
||||||
run: |
|
|
||||||
git config user.name "github-actions[bot]"
|
git config user.name "github-actions[bot]"
|
||||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
nix flake update --commit-lock-file
|
nix flake update --commit-lock-file
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue