Skip to content

Commit 9da4f08

Browse files
feat: initial dendritic implementation
0 parents  commit 9da4f08

Some content is hidden

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

72 files changed

+6667
-0
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 2
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[justfile]
12+
indent_size = 4

.envrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# shellcheck shell=bash
2+
if has nix_direnv_version; then
3+
use flake
4+
fi

.github/FUNDING.yaml

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

.github/dependabot.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
labels:
8+
- dependencies
9+
- github-actions
10+
commit-message:
11+
prefix: ci
12+
include: scope

.github/workflows/build.yaml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Build
2+
run-name: Build for ${{ github.ref_name }} by ${{ github.actor }}
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
jobs:
10+
build-hosts:
11+
timeout-minutes: 60
12+
name: Build ${{ matrix.host }}
13+
runs-on: ${{ matrix.runner }}
14+
permissions:
15+
contents: read
16+
strategy:
17+
matrix:
18+
include:
19+
- host: axolotl
20+
runner: ubuntu-latest
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24+
with:
25+
persist-credentials: false
26+
- name: Set up Nix
27+
uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
28+
- name: Set up Cachix
29+
uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 # v16
30+
with:
31+
name: heitor
32+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
33+
- name: Build host
34+
run: nix build .#nixosConfigurations.${{ matrix.host }}.config.system.build.toplevel --accept-flake-config
35+
build-dev-shells:
36+
timeout-minutes: 15
37+
name: Build devShell for ${{ matrix.package }} on ${{ matrix.system }}
38+
runs-on: ${{ matrix.runner }}
39+
permissions:
40+
contents: read
41+
strategy:
42+
matrix:
43+
system:
44+
- aarch64-linux
45+
- x86_64-linux
46+
include:
47+
- system: x86_64-linux
48+
runner: ubuntu-latest
49+
- system: aarch64-linux
50+
runner: ubuntu-24.04-arm
51+
steps:
52+
- name: Checkout repository
53+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
54+
with:
55+
persist-credentials: false
56+
- name: Set up Nix
57+
uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
58+
- name: Set up Cachix
59+
uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 # v16
60+
with:
61+
name: heitor
62+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
63+
- name: Build devShell
64+
run: nix build .#devShells.${{ matrix.system }}.default --accept-flake-config
65+
build-formatter:
66+
timeout-minutes: 14
67+
name: Build formatter on ${{ matrix.system }}
68+
runs-on: ${{ matrix.runner }}
69+
permissions:
70+
contents: read
71+
strategy:
72+
matrix:
73+
system:
74+
- aarch64-linux
75+
- x86_64-linux
76+
include:
77+
- system: x86_64-linux
78+
runner: ubuntu-latest
79+
- system: aarch64-linux
80+
runner: ubuntu-24.04-arm
81+
steps:
82+
- name: Checkout repository
83+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
84+
with:
85+
persist-credentials: false
86+
- name: Set up Nix
87+
uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
88+
- name: Set up Cachix
89+
uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 # v16
90+
with:
91+
name: heitor
92+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
93+
- name: Build formatter
94+
run: nix build .#formatter.${{ matrix.system }} --accept-flake-config

.github/workflows/check.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Flake check
2+
run-name: Flake check for ${{ github.ref_name }} by ${{ github.actor }}
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
jobs:
10+
check:
11+
timeout-minutes: 32
12+
name: Check flake on ${{ matrix.system }}
13+
runs-on: ${{ matrix.runner }}
14+
permissions:
15+
contents: read
16+
strategy:
17+
matrix:
18+
include:
19+
- system: x86_64-linux
20+
runner: ubuntu-latest
21+
- system: aarch64-linux
22+
runner: ubuntu-24.04-arm
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26+
with:
27+
persist-credentials: false
28+
- name: Set up Nix
29+
uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
30+
- name: Set up Cachix
31+
uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 # v16
32+
with:
33+
name: heitor
34+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
35+
- name: Run flake check
36+
run: nix flake check --accept-flake-config
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Dependabot auto-merge
2+
run-name: Dependabot auto-merge for ${{ github.event.pull_request.title }}
3+
on: pull_request
4+
permissions:
5+
contents: write
6+
pull-requests: write
7+
jobs:
8+
dependabot:
9+
timeout-minutes: 11
10+
runs-on: ubuntu-latest
11+
if: github.event.pull_request.user.login == 'dependabot[bot]'
12+
steps:
13+
- name: Dependabot metadata
14+
id: metadata
15+
uses: dependabot/fetch-metadata@21025c705c08248db411dc16f3619e6b5f9ea21a # v2.5.0
16+
with:
17+
github-token: "${{ secrets.GITHUB_TOKEN }}"
18+
- name: Enable auto-merge for Dependabot PRs
19+
run: gh pr merge --auto --squash --delete-branch "$PR_URL"
20+
env:
21+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
PR_URL: ${{ github.event.pull_request.html_url }}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Update flake inputs
2+
run-name: Update flake inputs by ${{ github.actor }}
3+
on:
4+
schedule:
5+
- cron: "0 0 */3 * *" # Every 3 days at midnight UTC
6+
workflow_dispatch:
7+
jobs:
8+
update-flake:
9+
timeout-minutes: 11
10+
name: Update flake inputs
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
18+
with:
19+
persist-credentials: false
20+
- name: Set up Nix
21+
uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
22+
- name: Generate app token
23+
id: app-token
24+
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
25+
with:
26+
app-id: ${{ vars.BOT_APP_ID }}
27+
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
28+
permission-contents: write
29+
permission-pull-requests: write
30+
- name: Configure Git
31+
run: |
32+
git config user.name "heitor-bot[bot]"
33+
git config user.email "246902415+heitor-bot[bot]@users.noreply.github.com"
34+
- name: Update flake.lock
35+
run: |
36+
nix flake update --accept-flake-config --commit-lock-file
37+
- name: Get commit message for PR body
38+
id: pr-body
39+
run: |
40+
COMMIT_BODY=$(git log -1 --pretty=%b)
41+
{
42+
echo "pr-body<<EOF"
43+
echo "### Automated flake update"
44+
echo ""
45+
echo "\`\`\`"
46+
echo "$COMMIT_BODY"
47+
echo "\`\`\`"
48+
echo "EOF"
49+
} >> "$GITHUB_OUTPUT"
50+
- name: Create Pull Request
51+
id: pull-request
52+
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
53+
with:
54+
body: ${{ steps.pr-body.outputs.pr-body }}
55+
branch: update-flake-lock
56+
delete-branch: true
57+
labels: |
58+
dependencies
59+
nix
60+
sign-commits: true
61+
title: "chore(deps): update flake"
62+
token: ${{ steps.app-token.outputs.token }}
63+
- name: Enable auto-merge
64+
if: steps.pull-request.outputs.pull-request-number
65+
env:
66+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
67+
PR_URL: ${{ steps.pull-request.outputs.pull-request-url }}
68+
run: gh pr merge --auto --squash --delete-branch "$PR_URL"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.direnv/
2+
result*

.sops.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
keys:
2+
# TODO: replace with actual public keys
3+
- &heitor ssh-ed25519 AAAA...
4+
- &axolotl ssh-ed25519 AAAA...
5+
creation_rules:
6+
- path_regex: ^secrets/hosts/common\.yaml$
7+
key_groups:
8+
- age:
9+
- *axolotl
10+
- path_regex: ^secrets/hosts/axolotl\.yaml$
11+
key_groups:
12+
- age:
13+
- *axolotl
14+
- path_regex: ^secrets/users/heitor\.yaml$
15+
key_groups:
16+
- age:
17+
- *heitor

0 commit comments

Comments
 (0)