-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use git-hooks.nix, treefmt-nix, and nix-direnv
- Loading branch information
1 parent
36d5300
commit d3c3600
Showing
55 changed files
with
984 additions
and
892 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_size = 2 | ||
indent_style = space | ||
max_line_length = 120 | ||
trim_trailing_whitespace = true | ||
|
||
[*.adoc] | ||
indent_size = unset | ||
|
||
[*.{adoc,envrc,nix,nu}] | ||
max_line_length = off | ||
|
||
[{justfile,.justfile,*.just,*.rs}] | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if ! has nix_direnv_version || ! nix_direnv_version 3.0.6; then | ||
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.6/direnvrc" "sha256-RYcUJaRMf8oF5LznDrlCXbkOQrywm0HDv1VjYGaJGdM=" | ||
fi | ||
|
||
use flake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Build Rasbperry Pi Pico | ||
name: Build Raspberry Pi Pico | ||
|
||
"on": | ||
pull_request: | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Check URLs with Lychee | ||
|
||
"on": | ||
pull_request: | ||
branches: [main] | ||
paths: | ||
- .github/workflows/link-checker.yaml | ||
- flake.lock | ||
- '**.adoc' | ||
push: | ||
branches: [main] | ||
paths: | ||
- .github/workflows/link-checker.yaml | ||
- flake.lock | ||
- '**.adoc' | ||
schedule: | ||
# Run once a month on the 14th. | ||
- cron: "0 0 14 * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
link-checker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Restore lychee cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: .lycheecache | ||
key: cache-lychee-${{ github.sha }} | ||
restore-keys: cache-lychee- | ||
- uses: actions/checkout@v4 | ||
- uses: DeterminateSystems/nix-installer-action@v14 | ||
- uses: DeterminateSystems/magic-nix-cache-action@v8 | ||
- name: Convert the Asciidoc files to html | ||
run: nix develop --command asciidoctor ./**/*.adoc | ||
- name: Run lychee on the generated site | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: nix develop --command lychee --cache --no-progress --verbose ./**/*.html |
This file was deleted.
Oops, something went wrong.
18 changes: 9 additions & 9 deletions
18
.../workflows/test-check-image-metadata.yaml → ...hub/workflows/test-update-nix-direnv.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
name: Test check-image-metadata.nu | ||
name: Test update-nix-direnv.nu | ||
"on": | ||
pull_request: | ||
branches: ["main"] | ||
paths: | ||
- .github/workflows/test-check-image-metadata.yaml | ||
- .github/workflows/test-update-nix-direnv.yaml | ||
- flake.lock | ||
- check-image-metadata.nu | ||
- check-image-metadata-tests.nu | ||
- update-nix-direnv.nu | ||
- update-nix-direnv-tests.nu | ||
push: | ||
branches: ["main"] | ||
paths: | ||
- .github/workflows/test-check-image-metadata.yaml | ||
- .github/workflows/test-update-nix-direnv.yaml | ||
- flake.lock | ||
- check-image-metadata.nu | ||
- check-image-metadata-tests.nu | ||
- update-nix-direnv.nu | ||
- update-nix-direnv-tests.nu | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test-check-image-metadata: | ||
test-update-nix-direnv: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: DeterminateSystems/nix-installer-action@v14 | ||
- uses: DeterminateSystems/magic-nix-cache-action@v8 | ||
- name: Run the Nushell tests | ||
run: nix develop --command nu check-image-metadata-tests.nu | ||
run: nix develop --command nu update-nix-direnv-tests.nu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Check files with treefmt | ||
"on": | ||
pull_request: | ||
branches: ["main"] | ||
push: | ||
branches: ["main"] | ||
|
||
jobs: | ||
treefmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: DeterminateSystems/nix-installer-action@v14 | ||
- uses: DeterminateSystems/magic-nix-cache-action@v8 | ||
- name: Run treefmt | ||
run: nix develop --command treefmt --ci | ||
- uses: reviewdog/action-suggester@v1 | ||
with: | ||
fail_on_error: true | ||
github_token: ${{ secrets.GH_TOKEN_FOR_UPDATES }} | ||
tool_name: treefmt |
19 changes: 8 additions & 11 deletions
19
.github/workflows/pre-commit-autoupdate.yaml → .github/workflows/update-nix-direnv.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,28 @@ | ||
name: Pre-commit auto-update | ||
name: Update nix-direnv | ||
|
||
"on": | ||
schedule: | ||
# Once a month on the 2nd | ||
- cron: "0 0 2 * *" | ||
- cron: "0 0 16 * *" | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
pre-commit-autoupdate: | ||
update-nix-direnv: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: DeterminateSystems/nix-installer-action@v14 | ||
- uses: DeterminateSystems/magic-nix-cache-action@v8 | ||
- name: Update pre-commit hooks | ||
run: nix develop --command pre-commit autoupdate | ||
- name: Run pre-commit hooks | ||
run: nix develop --command pre-commit run --all-files | ||
- name: Update nix-direnv to the latest version | ||
run: nix develop --command nu update-nix-direnv.nu | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v7 | ||
with: | ||
assignees: ${{ github.repository_owner }} | ||
branch: "update/pre-commit-hooks" | ||
commit-message: "chore(deps): Update pre-commit hooks" | ||
title: "chore(deps): Update pre-commit hooks" | ||
branch: "update/nix-direnv" | ||
commit-message: "chore(deps): Update nix-direnv" | ||
title: "chore(deps): Update nix-direnv" | ||
token: ${{ secrets.GH_TOKEN_FOR_UPDATES }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,12 @@ target/ | |
|
||
# Nix | ||
result | ||
|
||
# git-hooks.nix | ||
/.pre-commit-config.yaml | ||
|
||
# Asciidoctor | ||
*.html | ||
|
||
# lychee | ||
.lycheecache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.