Skip to content

Commit 2dc025e

Browse files
committed
chore: Initial commit
0 parents  commit 2dc025e

File tree

116 files changed

+14728
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+14728
-0
lines changed

.config/flakebox/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tmp/
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
# Run a given command in every directory that contains cargo workspace
3+
# Right now it just scans for `Cargo.lock`
4+
5+
set -euo pipefail
6+
7+
git ls-files | grep -E '(^|/)Cargo.lock' | while read -r path ; do
8+
(
9+
cd "$(dirname "$path")"
10+
"$@"
11+
)
12+
done

.config/flakebox/id

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
e158df0f83d0386e19472d34f5cd3622eb5b458d194fed290df2561596ad2c0d25679a868556ce7d295c5df748006fddbcc58ed4c374318095fead410fe34fd1

.config/flakebox/shellHook.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env bash
2+
root="$(git rev-parse --show-toplevel)"
3+
dot_git="$(git rev-parse --git-common-dir)"
4+
if [[ ! -d "${dot_git}/hooks" ]]; then mkdir -p "${dot_git}/hooks"; fi
5+
# fix old bug
6+
rm -f "${dot_git}/hooks/comit-msg"
7+
rm -f "${dot_git}/hooks/commit-msg"
8+
ln -sf "${root}/misc/git-hooks/commit-msg" "${dot_git}/hooks/commit-msg"
9+
10+
root="$(git rev-parse --show-toplevel)"
11+
dot_git="$(git rev-parse --git-common-dir)"
12+
if [[ ! -d "${dot_git}/hooks" ]]; then mkdir -p "${dot_git}/hooks"; fi
13+
# fix old bug
14+
rm -f "${dot_git}/hooks/pre-comit"
15+
rm -f "${dot_git}/hooks/pre-commit"
16+
ln -sf "${root}/misc/git-hooks/pre-commit" "${dot_git}/hooks/pre-commit"
17+
18+
# set template
19+
git config commit.template misc/git-hooks/commit-template.txt
20+
21+
if ! flakebox lint --silent; then
22+
>&2 echo "ℹ️ Project recommendations detected. Run 'flakebox lint' for more info."
23+
fi
24+
25+
if [ -n "${DIRENV_IN_ENVRC:-}" ]; then
26+
# and not set DIRENV_LOG_FORMAT
27+
if [ -n "${DIRENV_LOG_FORMAT:-}" ]; then
28+
>&2 echo "💡 Set 'DIRENV_LOG_FORMAT=\"\"' in your shell environment variables for a cleaner output of direnv"
29+
fi
30+
fi
31+
32+
>&2 echo "💡 Run 'just' for a list of available 'just ...' helper recipes"

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.github/workflows/flakebox-ci.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# THIS FILE IS AUTOGENERATED FROM FLAKEBOX CONFIGURATION
2+
3+
jobs:
4+
build:
5+
name: Build
6+
runs-on: ${{ matrix.runs-on }}
7+
steps:
8+
- uses: actions/checkout@v4
9+
- name: Install Nix
10+
uses: DeterminateSystems/nix-installer-action@v4
11+
- name: Magic Nix Cache
12+
uses: DeterminateSystems/magic-nix-cache-action@v2
13+
- name: Build on ${{ matrix.host }}
14+
run: nix build -L .#ci.flakebox-project
15+
strategy:
16+
matrix:
17+
host:
18+
- macos-x86_64
19+
- macos-aarch64
20+
- linux
21+
include:
22+
- host: linux
23+
runs-on: ubuntu-latest
24+
timeout: 60
25+
- host: macos-x86_64
26+
runs-on: macos-13
27+
timeout: 60
28+
- host: macos-aarch64
29+
runs-on: macos-14
30+
timeout: 60
31+
timeout-minutes: ${{ matrix.timeout }}
32+
flake:
33+
name: Flake self-check
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
- name: Check Nix flake inputs
38+
uses: DeterminateSystems/flake-checker-action@v5
39+
with:
40+
fail-mode: true
41+
lint:
42+
name: Lint
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v4
46+
- name: Install Nix
47+
uses: DeterminateSystems/nix-installer-action@v4
48+
- name: Magic Nix Cache
49+
uses: DeterminateSystems/magic-nix-cache-action@v2
50+
- name: Cargo Cache
51+
uses: actions/cache@v3
52+
with:
53+
key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
54+
path: ~/.cargo
55+
- name: Commit Check
56+
run: '# run the same check that git `pre-commit` hook does
57+
58+
nix develop --ignore-environment .#lint --command ./misc/git-hooks/pre-commit
59+
60+
'
61+
name: CI
62+
'on':
63+
merge_group:
64+
branches:
65+
- master
66+
- main
67+
pull_request:
68+
branches:
69+
- master
70+
- main
71+
push:
72+
branches:
73+
- master
74+
- main
75+
tags:
76+
- v*
77+
workflow_dispatch: {}
78+
79+
80+
# THIS FILE IS AUTOGENERATED FROM FLAKEBOX CONFIGURATION
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# THIS FILE IS AUTOGENERATED FROM FLAKEBOX CONFIGURATION
2+
3+
jobs:
4+
flakehub-publish:
5+
permissions:
6+
contents: read
7+
id-token: write
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
ref: ${{ (inputs.tag != null) && format('refs/tags/{0}', inputs.tag) || ''
13+
}}
14+
- name: Install Nix
15+
uses: DeterminateSystems/nix-installer-action@v4
16+
- name: Flakehub Push
17+
uses: DeterminateSystems/flakehub-push@main
18+
with:
19+
name: ${{ github.repository }}
20+
tag: ${{ inputs.tag }}
21+
visibility: public
22+
name: Publish to Flakehub
23+
'on':
24+
push:
25+
tags:
26+
- v?[0-9]+.[0-9]+.[0-9]+*
27+
workflow_dispatch:
28+
inputs:
29+
tags:
30+
description: The existing tag to publish to FlakeHub
31+
required: true
32+
type: string
33+
34+
35+
# THIS FILE IS AUTOGENERATED FROM FLAKEBOX CONFIGURATION

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.aider*
2+
/.direnv
3+
/target
4+
/target-nix
5+
/tmp

.rustfmt.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
group_imports = "StdExternalCrate"
2+
wrap_comments = true
3+
format_code_in_doc_comments = true
4+
imports_granularity = "Module"
5+
edition = "2021"

.taplo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include = ["**/Cargo.toml"]
2+
3+
[formatting]
4+
reorder_keys = true

0 commit comments

Comments
 (0)