Compare commits
38 commits
victoria-m
...
main
Author | SHA1 | Date | |
---|---|---|---|
75b621e298 | |||
|
32f68a54a9 | ||
|
b00e47ec85 | ||
a50637d55e | |||
aa4f972085 | |||
8a5de73b47 | |||
3fecacb482 | |||
ded867d274 | |||
f61bd85d63 | |||
bf06d2573b | |||
6fbda40e5e | |||
2ffd7732ba | |||
d45b044b22 | |||
21b422b1ad | |||
420fe99984 | |||
32f13adaad | |||
a816c81125 | |||
6ab3e4b685 | |||
5f1436e4bf | |||
|
d8f90dd940 | ||
89b22a34da | |||
32d28ed351 | |||
46657a7f74 | |||
0a40fbbda0 | |||
045554b2e6 | |||
|
2cee8006d3 | ||
|
9e5be2a279 | ||
0576d1ecf8 | |||
06bbe99769 | |||
|
45f2f59055 | ||
0e3463102c | |||
d2f039755b | |||
a6aac2b0b4 | |||
ae7aaabf29 | |||
7ab63fb4a5 | |||
2bb03126cf | |||
2b858bbae4 | |||
4f18e8d387 |
47 changed files with 869 additions and 516 deletions
1
.envrc
1
.envrc
|
@ -1 +1,2 @@
|
||||||
|
watch_file workflows/*
|
||||||
use nix
|
use nix
|
||||||
|
|
|
@ -1,25 +1,21 @@
|
||||||
|
jobs:
|
||||||
|
check_dns:
|
||||||
|
runs-on: nix
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Check the validity of the DNS configuration
|
||||||
|
run: nix-build meta/verify.nix -A dns
|
||||||
|
check_meta:
|
||||||
|
runs-on: nix
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Check the validity of meta options
|
||||||
|
run: nix-build meta/verify.nix -A meta
|
||||||
name: Check meta
|
name: Check meta
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- 'meta/*'
|
- meta/*
|
||||||
|
|
||||||
jobs:
|
|
||||||
check_meta:
|
|
||||||
runs-on: nix
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Check the validity of meta options
|
|
||||||
run: nix-build meta/verify.nix -A meta
|
|
||||||
|
|
||||||
check_dns:
|
|
||||||
runs-on: nix
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Check the validity of the DNS configuration
|
|
||||||
run: nix-build meta/verify.nix -A dns --no-out-link
|
|
||||||
|
|
16
.forgejo/workflows/check-workflows.yaml
Normal file
16
.forgejo/workflows/check-workflows.yaml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
jobs:
|
||||||
|
check_workflows:
|
||||||
|
runs-on: nix
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Check that the workflows are up to date
|
||||||
|
run: nix-shell -A check-workflows --run '[ $(git status --porcelain | wc -l)
|
||||||
|
-eq 0 ]'
|
||||||
|
name: Check workflows
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- workflows/*
|
|
@ -1,56 +0,0 @@
|
||||||
name: ds-fr update
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: "26 18 * * wed"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
npins_update:
|
|
||||||
runs-on: nix
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.TEA_DGNUM_CHORES_TOKEN }}
|
|
||||||
|
|
||||||
- name: Update DS and open PR if necessary
|
|
||||||
run: |
|
|
||||||
# Fetch the latest release tag
|
|
||||||
VERSION=$(curl -L \
|
|
||||||
-H "Accept: application/vnd.github+json" \
|
|
||||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
||||||
https://api.github.com/repos/demarches-simplifiees/demarches-simplifiees.fr/releases/latest \
|
|
||||||
| jq -r '.tag_name')
|
|
||||||
|
|
||||||
# Move to the ds-fr directory
|
|
||||||
cd machines/compute01/ds-fr/package
|
|
||||||
|
|
||||||
# Run the update script
|
|
||||||
./update.sh -v "$VERSION"
|
|
||||||
|
|
||||||
if [ ! -z "$(git diff --name-only)" ]; then
|
|
||||||
echo "[+] Changes detected, pushing updates."
|
|
||||||
|
|
||||||
git switch -C ds-update
|
|
||||||
|
|
||||||
git add .
|
|
||||||
|
|
||||||
git config user.name "DGNum Chores"
|
|
||||||
git config user.email "tech@dgnum.eu"
|
|
||||||
|
|
||||||
git commit --message "chore(ds-fr): Update"
|
|
||||||
git push --set-upstream origin ds-update --force
|
|
||||||
|
|
||||||
# Connect to the server with the cli
|
|
||||||
tea login add \
|
|
||||||
-n dgnum-chores \
|
|
||||||
-t '${{ secrets.TEA_DGNUM_CHORES_TOKEN }}' \
|
|
||||||
-u https://git.dgnum.eu
|
|
||||||
|
|
||||||
# Create a pull request if needed
|
|
||||||
# i.e. no PR with the same title exists
|
|
||||||
if [ -z "$(tea pr ls -f='title,author' -o simple | grep 'chore(ds-fr): Update dgnum-chores')" ]; then
|
|
||||||
tea pr create \
|
|
||||||
--description "Automatic ds-fr update" \
|
|
||||||
--title "chore(ds-fr): Update" \
|
|
||||||
--head ds-update
|
|
||||||
fi
|
|
||||||
fi
|
|
119
.forgejo/workflows/eval-nodes.yaml
Normal file
119
.forgejo/workflows/eval-nodes.yaml
Normal file
|
@ -0,0 +1,119 @@
|
||||||
|
jobs:
|
||||||
|
bridge01:
|
||||||
|
runs-on: nix
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- env:
|
||||||
|
BUILD_NODE: bridge01
|
||||||
|
STORE_ENDPOINT: https://tvix-store.dgnum.eu/infra-signing/
|
||||||
|
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
||||||
|
STORE_USER: admin
|
||||||
|
name: Build and cache bridge01
|
||||||
|
run: nix-shell -A eval-nodes --run cache-node
|
||||||
|
compute01:
|
||||||
|
runs-on: nix
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- env:
|
||||||
|
BUILD_NODE: compute01
|
||||||
|
STORE_ENDPOINT: https://tvix-store.dgnum.eu/infra-signing/
|
||||||
|
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
||||||
|
STORE_USER: admin
|
||||||
|
name: Build and cache compute01
|
||||||
|
run: nix-shell -A eval-nodes --run cache-node
|
||||||
|
geo01:
|
||||||
|
runs-on: nix
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- env:
|
||||||
|
BUILD_NODE: geo01
|
||||||
|
STORE_ENDPOINT: https://tvix-store.dgnum.eu/infra-signing/
|
||||||
|
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
||||||
|
STORE_USER: admin
|
||||||
|
name: Build and cache geo01
|
||||||
|
run: nix-shell -A eval-nodes --run cache-node
|
||||||
|
geo02:
|
||||||
|
runs-on: nix
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- env:
|
||||||
|
BUILD_NODE: geo02
|
||||||
|
STORE_ENDPOINT: https://tvix-store.dgnum.eu/infra-signing/
|
||||||
|
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
||||||
|
STORE_USER: admin
|
||||||
|
name: Build and cache geo02
|
||||||
|
run: nix-shell -A eval-nodes --run cache-node
|
||||||
|
rescue01:
|
||||||
|
runs-on: nix
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- env:
|
||||||
|
BUILD_NODE: rescue01
|
||||||
|
STORE_ENDPOINT: https://tvix-store.dgnum.eu/infra-signing/
|
||||||
|
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
||||||
|
STORE_USER: admin
|
||||||
|
name: Build and cache rescue01
|
||||||
|
run: nix-shell -A eval-nodes --run cache-node
|
||||||
|
storage01:
|
||||||
|
runs-on: nix
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- env:
|
||||||
|
BUILD_NODE: storage01
|
||||||
|
STORE_ENDPOINT: https://tvix-store.dgnum.eu/infra-signing/
|
||||||
|
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
||||||
|
STORE_USER: admin
|
||||||
|
name: Build and cache storage01
|
||||||
|
run: nix-shell -A eval-nodes --run cache-node
|
||||||
|
vault01:
|
||||||
|
runs-on: nix
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- env:
|
||||||
|
BUILD_NODE: vault01
|
||||||
|
STORE_ENDPOINT: https://tvix-store.dgnum.eu/infra-signing/
|
||||||
|
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
||||||
|
STORE_USER: admin
|
||||||
|
name: Build and cache vault01
|
||||||
|
run: nix-shell -A eval-nodes --run cache-node
|
||||||
|
web01:
|
||||||
|
runs-on: nix
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- env:
|
||||||
|
BUILD_NODE: web01
|
||||||
|
STORE_ENDPOINT: https://tvix-store.dgnum.eu/infra-signing/
|
||||||
|
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
||||||
|
STORE_USER: admin
|
||||||
|
name: Build and cache web01
|
||||||
|
run: nix-shell -A eval-nodes --run cache-node
|
||||||
|
web02:
|
||||||
|
runs-on: nix
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- env:
|
||||||
|
BUILD_NODE: web02
|
||||||
|
STORE_ENDPOINT: https://tvix-store.dgnum.eu/infra-signing/
|
||||||
|
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
||||||
|
STORE_USER: admin
|
||||||
|
name: Build and cache web02
|
||||||
|
run: nix-shell -A eval-nodes --run cache-node
|
||||||
|
web03:
|
||||||
|
runs-on: nix
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- env:
|
||||||
|
BUILD_NODE: web03
|
||||||
|
STORE_ENDPOINT: https://tvix-store.dgnum.eu/infra-signing/
|
||||||
|
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
||||||
|
STORE_USER: admin
|
||||||
|
name: Build and cache web03
|
||||||
|
run: nix-shell -A eval-nodes --run cache-node
|
||||||
|
name: Build all the nodes
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
|
@ -1,200 +0,0 @@
|
||||||
name: build configuration
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [opened, synchronize, edited, reopened]
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build_and_cache_compute01:
|
|
||||||
runs-on: nix
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Build and cache the node
|
|
||||||
run: nix-shell --run cache-node
|
|
||||||
env:
|
|
||||||
STORE_ENDPOINT: "https://tvix-store.dgnum.eu/infra-signing/"
|
|
||||||
STORE_USER: "admin"
|
|
||||||
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
|
||||||
BUILD_NODE: "compute01"
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
name: outputs_compute01
|
|
||||||
path: paths.txt
|
|
||||||
|
|
||||||
build_and_cache_storage01:
|
|
||||||
runs-on: nix
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Build and cache the node
|
|
||||||
run: nix-shell --run cache-node
|
|
||||||
env:
|
|
||||||
STORE_ENDPOINT: "https://tvix-store.dgnum.eu/infra-signing/"
|
|
||||||
STORE_USER: "admin"
|
|
||||||
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
|
||||||
BUILD_NODE: "storage01"
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
name: outputs_storage01
|
|
||||||
path: paths.txt
|
|
||||||
|
|
||||||
build_and_cache_rescue01:
|
|
||||||
runs-on: nix
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Build and cache the node
|
|
||||||
run: nix-shell --run cache-node
|
|
||||||
env:
|
|
||||||
STORE_ENDPOINT: "https://tvix-store.dgnum.eu/infra-signing/"
|
|
||||||
STORE_USER: "admin"
|
|
||||||
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
|
||||||
BUILD_NODE: "rescue01"
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
name: outputs_rescue01
|
|
||||||
path: paths.txt
|
|
||||||
|
|
||||||
build_and_cache_geo01:
|
|
||||||
runs-on: nix
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Build and cache the node
|
|
||||||
run: nix-shell --run cache-node
|
|
||||||
env:
|
|
||||||
STORE_ENDPOINT: "https://tvix-store.dgnum.eu/infra-signing/"
|
|
||||||
STORE_USER: "admin"
|
|
||||||
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
|
||||||
BUILD_NODE: "geo01"
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
name: outputs_geo01
|
|
||||||
path: paths.txt
|
|
||||||
|
|
||||||
build_and_cache_geo02:
|
|
||||||
runs-on: nix
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Build and cache the node
|
|
||||||
run: nix-shell --run cache-node
|
|
||||||
env:
|
|
||||||
STORE_ENDPOINT: "https://tvix-store.dgnum.eu/infra-signing/"
|
|
||||||
STORE_USER: "admin"
|
|
||||||
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
|
||||||
BUILD_NODE: "geo02"
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
name: outputs_geo02
|
|
||||||
path: paths.txt
|
|
||||||
|
|
||||||
build_and_cache_vault01:
|
|
||||||
runs-on: nix
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Build and cache the node
|
|
||||||
run: nix-shell --run cache-node
|
|
||||||
env:
|
|
||||||
STORE_ENDPOINT: "https://tvix-store.dgnum.eu/infra-signing/"
|
|
||||||
STORE_USER: "admin"
|
|
||||||
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
|
||||||
BUILD_NODE: "vault01"
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
name: outputs_vault01
|
|
||||||
path: paths.txt
|
|
||||||
|
|
||||||
build_and_cache_web01:
|
|
||||||
runs-on: nix
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Build and cache the node
|
|
||||||
run: nix-shell --run cache-node
|
|
||||||
env:
|
|
||||||
STORE_ENDPOINT: "https://tvix-store.dgnum.eu/infra-signing/"
|
|
||||||
STORE_USER: "admin"
|
|
||||||
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
|
||||||
BUILD_NODE: "web01"
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
name: outputs_web01
|
|
||||||
path: paths.txt
|
|
||||||
|
|
||||||
build_and_cache_web02:
|
|
||||||
runs-on: nix
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Build and cache the node
|
|
||||||
run: nix-shell --run cache-node
|
|
||||||
env:
|
|
||||||
STORE_ENDPOINT: "https://tvix-store.dgnum.eu/infra-signing/"
|
|
||||||
STORE_USER: "admin"
|
|
||||||
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
|
||||||
BUILD_NODE: "web02"
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
name: outputs_web02
|
|
||||||
path: paths.txt
|
|
||||||
|
|
||||||
build_and_cache_web03:
|
|
||||||
runs-on: nix
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Build and cache the node
|
|
||||||
run: nix-shell --run cache-node
|
|
||||||
env:
|
|
||||||
STORE_ENDPOINT: "https://tvix-store.dgnum.eu/infra-signing/"
|
|
||||||
STORE_USER: "admin"
|
|
||||||
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
|
||||||
BUILD_NODE: "web03"
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
name: outputs_web02
|
|
||||||
path: paths.txt
|
|
||||||
|
|
||||||
build_and_cache_bridge01:
|
|
||||||
runs-on: nix
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Build and cache the node
|
|
||||||
run: nix-shell --run cache-node
|
|
||||||
env:
|
|
||||||
STORE_ENDPOINT: "https://tvix-store.dgnum.eu/infra-signing/"
|
|
||||||
STORE_USER: "admin"
|
|
||||||
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
|
|
||||||
BUILD_NODE: "bridge01"
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
name: outputs_web02
|
|
||||||
path: paths.txt
|
|
|
@ -1,11 +0,0 @@
|
||||||
name: lint
|
|
||||||
on: [push, pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check:
|
|
||||||
runs-on: nix
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Run pre-commit on all files
|
|
||||||
run: nix-shell --run 'pre-commit run --all-files --hook-stage pre-push --show-diff-on-failure' -A shells.pre-commit ./.
|
|
25
.forgejo/workflows/npins-update.yaml
Normal file
25
.forgejo/workflows/npins-update.yaml
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
jobs:
|
||||||
|
npins_update:
|
||||||
|
runs-on: nix
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
depth: 0
|
||||||
|
token: ${{ secrets.TEA_DGNUM_CHORES_TOKEN }}
|
||||||
|
- name: Update dependencies and open PR if necessary
|
||||||
|
run: "npins update\n\nif [ ! -z \"$(git diff --name-only)\" ]; then\n echo
|
||||||
|
\"[+] Changes detected, pushing updates.\"\n\n git switch -C npins-update\n\
|
||||||
|
\n git add npins\n\n git config user.name \"DGNum Chores\"\n git config
|
||||||
|
user.email \"tech@dgnum.eu\"\n\n git commit --message \"chore(npins): Update\"\
|
||||||
|
\n git push --set-upstream origin npins-update --force\n\n # Connect to
|
||||||
|
the server with the cli\n tea login add \\\n -n dgnum-chores \\\n -t
|
||||||
|
\"${{ secrets.TEA_DGNUM_CHORES_TOKEN }}\" \\\n -u https://git.dgnum.eu\n\
|
||||||
|
\n # Create a pull request if needed\n # i.e. no PR with the same title
|
||||||
|
exists\n if [ -z \"$(tea pr ls -f='title,author' -o simple | grep 'chore(npins):
|
||||||
|
Update dgnum-chores')\" ]; then\n tea pr create \\\n --description
|
||||||
|
\"Automatic npins update\" \\\n --title \"chore(npins): Update\" \\\n\
|
||||||
|
\ --head npins-update\n fi\nfi\n"
|
||||||
|
name: npins update
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: 25 15 * * *
|
12
.forgejo/workflows/pre-commit.yaml
Normal file
12
.forgejo/workflows/pre-commit.yaml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
runs-on: nix
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Run pre-commit on all files
|
||||||
|
run: nix-shell -A pre-commit --run 'pre-commit run --all-files --hook-stage
|
||||||
|
pre-push --show-diff-on-failure'
|
||||||
|
name: Run pre-commit on all files
|
||||||
|
on:
|
||||||
|
- push
|
||||||
|
- pull_request
|
73
default.nix
73
default.nix
|
@ -41,7 +41,15 @@
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
git-checks = (import (builtins.storePath sources.git-hooks)).run {
|
inherit (pkgs.lib)
|
||||||
|
isFunction
|
||||||
|
mapAttrs
|
||||||
|
mapAttrs'
|
||||||
|
nameValuePair
|
||||||
|
removeSuffix
|
||||||
|
;
|
||||||
|
|
||||||
|
git-checks = (import sources.git-hooks).run {
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
|
||||||
hooks = {
|
hooks = {
|
||||||
|
@ -67,6 +75,22 @@ let
|
||||||
commitizen.enable = true;
|
commitizen.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
workflows = (import sources.nix-actions { inherit pkgs; }).install {
|
||||||
|
src = ./.;
|
||||||
|
|
||||||
|
workflows = mapAttrs' (
|
||||||
|
name: _:
|
||||||
|
nameValuePair (removeSuffix ".nix" name) (
|
||||||
|
let
|
||||||
|
w = import ./workflows/${name};
|
||||||
|
in
|
||||||
|
if isFunction w then w { inherit (pkgs) lib; } else w
|
||||||
|
)
|
||||||
|
) (builtins.readDir ./workflows);
|
||||||
|
};
|
||||||
|
|
||||||
|
scripts = import ./scripts { inherit pkgs; };
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -78,36 +102,35 @@ in
|
||||||
|
|
||||||
mkCacheSettings = import ./machines/storage01/tvix-cache/cache-settings.nix;
|
mkCacheSettings = import ./machines/storage01/tvix-cache/cache-settings.nix;
|
||||||
|
|
||||||
shells = {
|
devShell = pkgs.mkShell {
|
||||||
default = pkgs.mkShell {
|
name = "dgnum-infra";
|
||||||
name = "dgnum-infra";
|
|
||||||
|
|
||||||
packages = [
|
packages = [
|
||||||
(pkgs.nixos-generators.overrideAttrs (_: {
|
(pkgs.nixos-generators.overrideAttrs (_: {
|
||||||
version = "1.8.0-unstable";
|
version = "1.8.0-unstable";
|
||||||
src = builtins.storePath sources.nixos-generators;
|
src = sources.nixos-generators;
|
||||||
}))
|
}))
|
||||||
pkgs.npins
|
pkgs.npins
|
||||||
|
|
||||||
(pkgs.callPackage ./lib/colmena { inherit (nix-pkgs) colmena; })
|
(pkgs.callPackage ./lib/colmena { inherit (nix-pkgs) colmena; })
|
||||||
(pkgs.callPackage "${sources.agenix}/pkgs/agenix.nix" { })
|
(pkgs.callPackage "${sources.agenix}/pkgs/agenix.nix" { })
|
||||||
(pkgs.callPackage "${sources.lon}/nix/packages/lon.nix" { })
|
(pkgs.callPackage "${sources.lon}/nix/packages/lon.nix" { })
|
||||||
|
] ++ (builtins.attrValues scripts);
|
||||||
|
|
||||||
] ++ (import ./scripts { inherit pkgs; });
|
shellHook = ''
|
||||||
|
${git-checks.shellHook}
|
||||||
|
${workflows.shellHook}
|
||||||
|
'';
|
||||||
|
|
||||||
shellHook = ''
|
preferLocalBuild = true;
|
||||||
${git-checks.shellHook}
|
|
||||||
'';
|
|
||||||
|
|
||||||
preferLocalBuild = true;
|
###
|
||||||
};
|
# Alternative shells
|
||||||
|
|
||||||
pre-commit = pkgs.mkShell {
|
passthru = mapAttrs (name: value: pkgs.mkShell (value // { inherit name; })) {
|
||||||
name = "pre-commit-shell";
|
pre-commit.shellHook = git-checks.shellHook;
|
||||||
|
check-workflows.shellHook = workflows.shellHook;
|
||||||
shellHook = ''
|
eval-nodes.packages = [ scripts.cache-node ];
|
||||||
${git-checks.shellHook}
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,9 @@ rec {
|
||||||
web03 = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICrWsMEfK86iaO9SubMqE2UvZNtHkLY5VUod/bbqKC0L" ];
|
web03 = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICrWsMEfK86iaO9SubMqE2UvZNtHkLY5VUod/bbqKC0L" ];
|
||||||
|
|
||||||
# SSH keys of the DGNum members
|
# SSH keys of the DGNum members
|
||||||
|
agroudiev = [
|
||||||
|
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDgyt3ntpcoI/I2n97R1hzjBiNL6R98S73fSi7pkSE/8mQbI8r9GzsPUBcxQ+tIg0FgwkLxTwF8DwLf0E+Le/rPznxBS5LUQaAktSQSrxz/IIID1+jN8b03vf5PjfKS8H2Tu3Q8jZXa8HNsj3cpySpGMqGrE3ieUmknd/YfppRRf+wM4CsGKZeS3ZhB9oZi3Jn22A0U/17AOJTnv4seq+mRZWRQt3pvQvpp8/2M7kEqizie/gTr/DnwxUr45wisqYYH4tat9Cw6iDr7LK10VCrK37BfFagMIZ08Hkh3c46jghjYNQWe+mBUWJByWYhTJ0AtYrbaYeUV1HVYbsRJ6bNx25K6794QQPaE/vc2Z/VK/ILgvJ+9myFSAWVylCWdyYpwUu07RH/jDBl2aqH62ESwAG7SDUUcte6h9N+EryAQLWc8OhsGAYLpshhBpiqZwzX90m+nkbhx1SqMbtt6TS+RPDEHKFYn8E6FBrf1FK34482ndq/hHXZ88mqzGb1nOnM="
|
||||||
|
];
|
||||||
catvayor = [
|
catvayor = [
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAA16foz+XzwKwyIR4wFgNIAE3Y7AfXyEsUZFVVz8Rie catvayor@katvayor"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAA16foz+XzwKwyIR4wFgNIAE3Y7AfXyEsUZFVVz8Rie catvayor@katvayor"
|
||||||
];
|
];
|
||||||
|
@ -44,8 +47,10 @@ rec {
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDMBW7rTtfZL9wtrpCVgariKdpN60/VeAzXkh9w3MwbO julien@enigma"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDMBW7rTtfZL9wtrpCVgariKdpN60/VeAzXkh9w3MwbO julien@enigma"
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGa+7n7kNzb86pTqaMn554KiPrkHRGeTJ0asY1NjSbpr julien@tower"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGa+7n7kNzb86pTqaMn554KiPrkHRGeTJ0asY1NjSbpr julien@tower"
|
||||||
];
|
];
|
||||||
|
mboyer = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGYnwZaFYvUxtJeNvpaA20rLfq8fOO4dFp7cIXsD8YNx" ];
|
||||||
mdebray = [
|
mdebray = [
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEpwF+XD3HgX64kqD42pcEZRNYAWoO4YNiOm5KO4tH6o maurice@polaris"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEpwF+XD3HgX64kqD42pcEZRNYAWoO4YNiOm5KO4tH6o maurice@polaris"
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFdDnSl3cyWil+S5JiyGqOvBR3wVh+lduw58S5WvraoL maurice@fekda"
|
||||||
];
|
];
|
||||||
raito = [
|
raito = [
|
||||||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDcEkYM1r8QVNM/G5CxJInEdoBCWjEHHDdHlzDYNSUIdHHsn04QY+XI67AdMCm8w30GZnLUIj5RiJEWXREUApby0GrfxGGcy8otforygfgtmuUKAUEHdU2MMwrQI7RtTZ8oQ0USRGuqvmegxz3l5caVU7qGvBllJ4NUHXrkZSja2/51vq80RF4MKkDGiz7xUTixI2UcBwQBCA/kQedKV9G28EH+1XfvePqmMivZjl+7VyHsgUVj9eRGA1XWFw59UPZG8a7VkxO/Eb3K9NF297HUAcFMcbY6cPFi9AaBgu3VC4eetDnoN/+xT1owiHi7BReQhGAy/6cdf7C/my5ehZwD"
|
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDcEkYM1r8QVNM/G5CxJInEdoBCWjEHHDdHlzDYNSUIdHHsn04QY+XI67AdMCm8w30GZnLUIj5RiJEWXREUApby0GrfxGGcy8otforygfgtmuUKAUEHdU2MMwrQI7RtTZ8oQ0USRGuqvmegxz3l5caVU7qGvBllJ4NUHXrkZSja2/51vq80RF4MKkDGiz7xUTixI2UcBwQBCA/kQedKV9G28EH+1XfvePqmMivZjl+7VyHsgUVj9eRGA1XWFw59UPZG8a7VkxO/Eb3K9NF297HUAcFMcbY6cPFi9AaBgu3VC4eetDnoN/+xT1owiHi7BReQhGAy/6cdf7C/my5ehZwD"
|
||||||
|
|
|
@ -190,8 +190,11 @@ rec {
|
||||||
recursiveFuse [
|
recursiveFuse [
|
||||||
(enableModules enabledModules)
|
(enableModules enabledModules)
|
||||||
|
|
||||||
{ imports = mkImports root ([ "_hardware-configuration" ] ++ enabledServices); }
|
{
|
||||||
|
imports =
|
||||||
|
(extraConfig.imports or [ ]) ++ (mkImports root ([ "_hardware-configuration" ] ++ enabledServices));
|
||||||
|
}
|
||||||
|
|
||||||
extraConfig
|
(removeAttrs extraConfig [ "imports" ])
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,14 @@
|
||||||
{ config, ... }:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
sources,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
host = "demarches.dgnum.eu";
|
host = "demarches.dgnum.eu";
|
||||||
|
|
||||||
|
dgn-id = "fca8f72cd60c00e74d7735ec13e4e3a22e8e1244";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [ ./module.nix ];
|
imports = [ ./module.nix ];
|
||||||
|
@ -11,6 +18,18 @@ in
|
||||||
services.demarches-simplifiees = {
|
services.demarches-simplifiees = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
package =
|
||||||
|
((import sources.nix-pkgs { inherit pkgs; }).demarches-simplifiees.override {
|
||||||
|
initialDeploymentDate = "20230923";
|
||||||
|
}).overrideAttrs
|
||||||
|
(old: {
|
||||||
|
dsModules = old.dsModules.overrideAttrs {
|
||||||
|
prePatch = ''
|
||||||
|
${pkgs.lib.getExe pkgs.git} apply -p1 < ${builtins.fetchurl "https://git.dgnum.eu/DGNum/demarches-normaliennes/commit/${dgn-id}.patch"}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
secretFile = config.age.secrets."ds-fr-secret_file".path;
|
secretFile = config.age.secrets."ds-fr-secret_file".path;
|
||||||
|
|
||||||
initialDeploymentDate = "20230923";
|
initialDeploymentDate = "20230923";
|
||||||
|
|
|
@ -10,7 +10,7 @@ let
|
||||||
# - push to a new branch dgn-v0.A.B where A.B is the new version
|
# - push to a new branch dgn-v0.A.B where A.B is the new version
|
||||||
# - finally, update the commit hash of the customization patch
|
# - finally, update the commit hash of the customization patch
|
||||||
|
|
||||||
dgn-id = "8f19cb1c9623f8da71f6512c1528d83acc35db57";
|
dgn-id = "d73e347b1cefe23092bfcb2d3f8a23903410203e";
|
||||||
port = 8084;
|
port = 8084;
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
{
|
{ config, pkgs, ... }:
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
nixpkgs,
|
|
||||||
sources,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
url = "https://git.dgnum.eu";
|
url = "https://git.dgnum.eu";
|
||||||
|
@ -30,8 +24,6 @@ let
|
||||||
options = "--cpus=4";
|
options = "--cpus=4";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nix-pkgs = import sources.nix-pkgs { inherit pkgs; };
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
services.forgejo-nix-runners = {
|
services.forgejo-nix-runners = {
|
||||||
|
@ -43,10 +35,8 @@ in
|
||||||
tokenFile = config.age.secrets."forgejo_runners-token_file".path;
|
tokenFile = config.age.secrets."forgejo_runners-token_file".path;
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
nix-pkgs.colmena
|
|
||||||
pkgs.npins
|
pkgs.npins
|
||||||
pkgs.tea
|
pkgs.tea
|
||||||
nixpkgs.unstable.nixfmt-rfc-style
|
|
||||||
];
|
];
|
||||||
|
|
||||||
containerOptions = [ "--cpus=4" ];
|
containerOptions = [ "--cpus=4" ];
|
||||||
|
|
|
@ -61,6 +61,7 @@ in
|
||||||
|
|
||||||
service = {
|
service = {
|
||||||
EMAIL_DOMAIN_ALLOWLIST = "dgnum.eu,*";
|
EMAIL_DOMAIN_ALLOWLIST = "dgnum.eu,*";
|
||||||
|
EMAIL_DOMAIN_BLOCKLIST = "*.shop,*.online,*.store";
|
||||||
ENABLE_NOTIFY_MAIL = true;
|
ENABLE_NOTIFY_MAIL = true;
|
||||||
|
|
||||||
DISABLE_REGISTRATION = false;
|
DISABLE_REGISTRATION = false;
|
||||||
|
|
|
@ -135,10 +135,11 @@ in
|
||||||
systemd.services."tvix-store" = {
|
systemd.services."tvix-store" = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
environment = {
|
environment = {
|
||||||
RUST_LOG = "debug";
|
RUST_LOG = "info";
|
||||||
};
|
};
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
UMask = "007";
|
UMask = "007";
|
||||||
|
LimitNOFILE = 1048576;
|
||||||
ExecStart = "${package}/bin/multitier-tvix-cache --endpoints-config ${toml.endpoints} --store-composition ${toml.composition}";
|
ExecStart = "${package}/bin/multitier-tvix-cache --endpoints-config ${toml.endpoints} --store-composition ${toml.composition}";
|
||||||
StateDirectory = "tvix-store";
|
StateDirectory = "tvix-store";
|
||||||
RuntimeDirectory = "tvix-store";
|
RuntimeDirectory = "tvix-store";
|
||||||
|
|
|
@ -6,30 +6,35 @@
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
metis = import sources.metis { inherit pkgs; };
|
inherit (lib) mapAttrsToList match;
|
||||||
|
|
||||||
inherit (metis) providers;
|
metis = import sources.metis { inherit pkgs; };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
services.nginx.virtualHosts."calendrier.dgnum.eu" = {
|
services.nginx.virtualHosts."calendrier.dgnum.eu" = {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
root = metis.production;
|
root = metis.package;
|
||||||
|
|
||||||
locations = lib.mapAttrs' (
|
locations = lib.mapAttrs' (
|
||||||
name: value:
|
name: domain:
|
||||||
lib.nameValuePair "/cal/${name}/" {
|
lib.nameValuePair "/cal/${name}/" {
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_set_header X-Forwarded-Host $host;
|
proxy_set_header X-Forwarded-Host $host;
|
||||||
proxy_set_header X-Forwarded-Server $host;
|
proxy_set_header X-Forwarded-Server $host;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_pass ${value};
|
proxy_pass https://${domain}/remote.php/dav/public-calendars/;
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
) providers;
|
) metis.providers;
|
||||||
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
rewrite ^/calendrier(.*)$ $1 permanent;
|
rewrite ^/calendrier(.*)$ $1 permanent;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
assertions = mapAttrsToList (name: domain: {
|
||||||
|
assertion = (match "[a-z-]+" name == [ ]) && (match "[a-z.-]+" domain == [ ]);
|
||||||
|
message = "The provider `${name}` associated to the domain `${domain}` seems to have an incorrect definition.";
|
||||||
|
}) metis.providers;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ in
|
||||||
services = {
|
services = {
|
||||||
netbox = {
|
netbox = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = nixpkgs.unstable.netbox_3_7;
|
package = nixpkgs.unstable.netbox_4_1;
|
||||||
secretKeyFile = "/dev/null";
|
secretKeyFile = "/dev/null";
|
||||||
listenAddress = "127.0.0.1";
|
listenAddress = "127.0.0.1";
|
||||||
plugins = p: [ p.netbox-qrcode ];
|
plugins = p: [ p.netbox-qrcode ];
|
||||||
|
|
|
@ -29,7 +29,6 @@ in
|
||||||
"bds.wp.dgnum.eu" = "bds.ens.fr";
|
"bds.wp.dgnum.eu" = "bds.ens.fr";
|
||||||
"www.tuteurs.ens.fr" = "tuteurs.ens.fr";
|
"www.tuteurs.ens.fr" = "tuteurs.ens.fr";
|
||||||
"www.interq.ens.fr" = "interq.ens.fr";
|
"www.interq.ens.fr" = "interq.ens.fr";
|
||||||
"www.lanuit.ens.fr" = "lanuit.ens.fr";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
temporary = {
|
temporary = {
|
||||||
|
|
44
machines/web03/django-apps/bocal.nix
Normal file
44
machines/web03/django-apps/bocal.nix
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
{ pkgs, sources, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
nix-pkgs = import sources.nix-pkgs { inherit pkgs; };
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
services.django-apps.sites.bocal = {
|
||||||
|
source = "https://git.dgnum.eu/DGNum/www-bocal";
|
||||||
|
branch = "main";
|
||||||
|
domain = "bocal.webapps.dgnum.eu";
|
||||||
|
|
||||||
|
nginx = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
webHookSecret = builtins.toFile "insecure-secret" "T5hNeDraMivRZLUkrekv&QeM";
|
||||||
|
|
||||||
|
python = pkgs.python3.override {
|
||||||
|
packageOverrides = _: _: { inherit (nix-pkgs) django-cas-ng django-solo loadcredential; };
|
||||||
|
};
|
||||||
|
|
||||||
|
dependencies = ps: [
|
||||||
|
ps.django
|
||||||
|
ps.django-cas-ng
|
||||||
|
ps.django-markdownx
|
||||||
|
ps.django-solo
|
||||||
|
ps.markdown
|
||||||
|
ps.pillow
|
||||||
|
ps.loadcredential
|
||||||
|
];
|
||||||
|
|
||||||
|
credentials = {
|
||||||
|
SECRET_KEY = builtins.toFile "insecure-key" "insecure-key";
|
||||||
|
};
|
||||||
|
|
||||||
|
environment = {
|
||||||
|
DJANGO_SETTINGS_MODULE = "app.settings";
|
||||||
|
BOCAL_ALLOWED_HOSTS = [ "bocal.webapps.dgnum.eu" ];
|
||||||
|
BOCAL_RHOSTS_PATH = "/var/lib/django-apps/bocal/.rhosts";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,14 +1,18 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./annuaire.nix
|
./annuaire.nix
|
||||||
|
./bocal.nix
|
||||||
./gestiojeux.nix
|
./gestiojeux.nix
|
||||||
|
./interludes.nix
|
||||||
|
./wikiens.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
services.django-apps = {
|
services.django-apps = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
webhook = {
|
webhook = {
|
||||||
domain = "hooks.webapps.dgnum.eu";
|
domain = "apps-webhook.dgnum.eu";
|
||||||
|
|
||||||
nginx = {
|
nginx = {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
|
66
machines/web03/django-apps/interludes.nix
Normal file
66
machines/web03/django-apps/interludes.nix
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
sources,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
nix-pkgs = import sources.nix-pkgs { inherit pkgs; };
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
services.webhook.extraArgs = [ "-debug" ];
|
||||||
|
services.django-apps.sites.interludes = {
|
||||||
|
source = "https://git.eleves.ens.fr/dlesbre/site-interludes";
|
||||||
|
branch = "master";
|
||||||
|
domain = "interludes.ens.fr";
|
||||||
|
|
||||||
|
nginx = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
|
||||||
|
serverAliases = [ "interludes.webapps.dgnum.eu" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
webHookSecret = config.age.secrets."webhook-interludes_token".path;
|
||||||
|
|
||||||
|
application = {
|
||||||
|
type = "wsgi";
|
||||||
|
module = "interludes";
|
||||||
|
};
|
||||||
|
|
||||||
|
dbType = "sqlite";
|
||||||
|
|
||||||
|
python = pkgs.python3.override {
|
||||||
|
packageOverrides = _: _: { inherit (nix-pkgs) python-cas loadcredential; };
|
||||||
|
};
|
||||||
|
|
||||||
|
django = ps: ps.django_4;
|
||||||
|
dependencies = ps: [
|
||||||
|
ps.loadcredential
|
||||||
|
ps.python-ldap
|
||||||
|
ps.python-cas
|
||||||
|
];
|
||||||
|
|
||||||
|
credentials = {
|
||||||
|
SECRET_KEY = config.age.secrets."dj_interludes-secret_key_file".path;
|
||||||
|
EMAIL_HOST_PASSWORD = config.age.secrets."dj_interludes-email_host_password_file".path;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment = {
|
||||||
|
INTERLUDES_ALLOWED_HOSTS = [
|
||||||
|
"interludes.ens.fr"
|
||||||
|
"interludes.webapps.dgnum.eu"
|
||||||
|
];
|
||||||
|
|
||||||
|
# E-mail configuration
|
||||||
|
INTERLUDES_SERVER_EMAIL = "noreply-interludes-admin@ens.fr";
|
||||||
|
INTERLUDES_DEFAULT_FROM_EMAIL = "noreply-interludes@ens.fr";
|
||||||
|
INTERLUDES_EMAIL_HOST = "clipper.ens.fr";
|
||||||
|
INTERLUDES_EMAIL_PORT = 465;
|
||||||
|
INTERLUDES_EMAIL_HOST_USER = "interludes";
|
||||||
|
INTERLUDES_DEBUG = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
40
machines/web03/django-apps/wikiens.nix
Normal file
40
machines/web03/django-apps/wikiens.nix
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
{ pkgs, sources, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
nix-pkgs = import sources.nix-pkgs { inherit pkgs; };
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
services.django-apps.sites.wikiens = {
|
||||||
|
source = "https://git.dgnum.eu/DGNum/wiki-eleves";
|
||||||
|
branch = "main";
|
||||||
|
domain = "wiki.webapps.dgnum.eu";
|
||||||
|
|
||||||
|
nginx = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
webHookSecret = builtins.toFile "insecure-secret" "T5hNeDraMivRZLUkrekv&QeM";
|
||||||
|
|
||||||
|
python = pkgs.python3.override {
|
||||||
|
packageOverrides = _: _: { inherit (nix-pkgs) django-allauth-ens django-wiki loadcredential; };
|
||||||
|
};
|
||||||
|
|
||||||
|
dependencies = ps: [
|
||||||
|
ps.django
|
||||||
|
ps.django-allauth-ens
|
||||||
|
ps.django-wiki
|
||||||
|
ps.loadcredential
|
||||||
|
ps.tinycss2
|
||||||
|
];
|
||||||
|
|
||||||
|
credentials = {
|
||||||
|
SECRET_KEY = builtins.toFile "insecure-key" "insecure-key";
|
||||||
|
};
|
||||||
|
|
||||||
|
environment = {
|
||||||
|
WIKIENS_ALLOWED_HOSTS = [ "wiki.webapps.dgnum.eu" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 jIXfPA iJSzsbA8RiEhUIyhlKWCASQKoSQstjK4drMYl+PsChw
|
||||||
|
8THrknrBu0WGFEb4xTZiJxEY26q7sW83rwViDjyTE24
|
||||||
|
-> ssh-ed25519 QlRB9Q e7PRE212Ggt8nO6Bb+BabO85FOARsJGs9cPJmZNI9kg
|
||||||
|
ubKIBxI1ZBXttA7TWj401siKNT1HyB+N2MsZ+ldkgb8
|
||||||
|
-> ssh-ed25519 r+nK/Q EWV24Emm9hENa+yUAuQpkuJ0uJ0zIv+vRIbWpM4Wtg4
|
||||||
|
J59wnHRytgNqpX4+5HaJ9KZ5GvhckgtRK6TzfX7Ci8Y
|
||||||
|
-> ssh-rsa krWCLQ
|
||||||
|
AvmrzShR+XTpUpKaScoqvgFQ40PTSqh8p383p98xjG5LIz5kqJoWBnxJK7JabBpq
|
||||||
|
JkqVeq5XdH5RX4weobieG4KYUV8EDheLfOMXH5BrPgeJO4yhJ1rzH+oHBw4TwvFM
|
||||||
|
UvEZEAVgi3G1/suPfJAkO7QRkZjE7fRppEo5RAI0gMlM43YyJavrfqVIqB40Uugk
|
||||||
|
h0b0ybChUbKpXlZjqhYAAMN45jTAvW1emO0DMeIk6dbmnbZNdibul8f+NNdWKbI1
|
||||||
|
9NN5iH2IzuqTdc6gkE4912hdDeUJ4NZ6x/Fxp1/u3d1z/Yg7daUQUXUIoDX0Hyvb
|
||||||
|
+01dH0D/7kzRhEdNLO2NXA
|
||||||
|
-> ssh-ed25519 /vwQcQ GAsAj2i65KDQeFhe69YR2ycdGskop1wu3Lzrxp59sTg
|
||||||
|
wCSUqEtWv0i6sNg1RVtHI/jZh3VeNX3qtnbagXoNGT4
|
||||||
|
-> ssh-ed25519 0R97PA mFZ3q/3jd1guXl8bhRWyYjgsgE4JErJEels6vdmpfCs
|
||||||
|
7oIAT0MTsaKxbf26PSDBk7KqfyFgcBq09FGJ9v/rXqE
|
||||||
|
-> ssh-ed25519 JGx7Ng tpslfMWMJMUH46EGycbLiXotVdXlP4xmK0slb7XKYS8
|
||||||
|
wLLfX4jX4mIxzI8zr2GBlpBcPztTrHqKngi/ON0TExg
|
||||||
|
-> ssh-ed25519 bUjjig zLoniLfwKGH9Ctu34103WHBvjIyImtPyKx8O+5UMLUU
|
||||||
|
sYsterVGvCg6JWA0z3AO5sSlj9DBfj8u5o5jH9K2xeA
|
||||||
|
-> ssh-ed25519 VQSaNw oHzU9Lc/7p+MZAjVylzC63h586vOcffXkkpAi4XB8Q0
|
||||||
|
7T8CREpaCxM58KMYW28FY2i+ELjrx3eC3K7xaBy7O6A
|
||||||
|
-> (_o61>U-grease .P>ZRrj~ -=7S;N
|
||||||
|
6vnQVKKZwp4JowIwVb4klrhaR6NZjwlZYnngVQ0wqVenMZPj9oyhIXthLRqE1Q6/
|
||||||
|
k+sGxA
|
||||||
|
--- +yT0o8oZJS+32MeUAl8T9zREh31rq77pSVsSoFjHO5A
|
||||||
|
è™ñΗ´ä!î^ûØÖ8Ô‚zøÑaÒÓÐàÔ@Ö¡s\ ˜_ÃÃúoÖö<C396>wõÖ¥Cr)¾€fû¿AÃ'•3D€â
|
29
machines/web03/secrets/dj_interludes-secret_key_file
Normal file
29
machines/web03/secrets/dj_interludes-secret_key_file
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 jIXfPA 7v2qJ+2ZSp0tf4m6gcK2ShFF9ulNm/g3aHu3Wqe4Sxo
|
||||||
|
ZyVqTqBCK51/U5yxtp23nywprQv46yL90zwx6+DqKRg
|
||||||
|
-> ssh-ed25519 QlRB9Q IePmluoRImtaDplOoVqNiwfTQMKF1CuF4M6AzurXGRY
|
||||||
|
JjtOeyvARlc9t5Q+LS2+TZwAUgV4Qn2L8SFkw9YLnaU
|
||||||
|
-> ssh-ed25519 r+nK/Q LGPI7PmVPnZDQe6Su5MZQauxRHZkBKehyNbMq+BKlGQ
|
||||||
|
3RvcfLAFKaScusYKf47zFNAtnot7wySvytuD81s6TwM
|
||||||
|
-> ssh-rsa krWCLQ
|
||||||
|
xGH7rl+r8L5HEp6JUlAm04ktn9rQsWfBBlSRp7UsOi6ojwCfjjIA91yUrYw8TYRs
|
||||||
|
Ci60uoLS7cuMtSE/jQVU/FuVtR5kwjhOkWmQDHrC7rUWb6CufusxPIVJ0xanp3wo
|
||||||
|
cc2t+EfSdpVyGIx5N8BEMhQ6sR2EfERHGfUrnKCpcL5hM5L8ZHnVh6CkRBtvZaq0
|
||||||
|
Zy44Ob4pqH6fDz7EziM1hBkfg9myN+/Iqfvg5OUnfSrqooLZ8l0gDvGafS5fok91
|
||||||
|
uqb0PGDiv6lwzpaj87jKUCaXAF3ag2KAa6j8sbZ4+fSsQeB/jhH7hTlWcAR/oEFW
|
||||||
|
fuPQDFKxMucAsPjv1H1iaQ
|
||||||
|
-> ssh-ed25519 /vwQcQ +5+xDNQyRwBWXT6c593S01OG9IemNul/81G4ie1hTVg
|
||||||
|
Tzkq0toOCqdHOZNPiy/rUrO2eQXTDHi7g+jKbrWU/hU
|
||||||
|
-> ssh-ed25519 0R97PA WEMs0phnuvw1kQaqeSkovwFUL6w7J6wh+V7D82NxfDs
|
||||||
|
V5npmkeTPVcnaNwDtoy7PqBRllPTuQjvF9Qu14V59os
|
||||||
|
-> ssh-ed25519 JGx7Ng 3bty0WCf+ElvPEFt7fSpgYf5MeFUPaZ4vVGWPUAjn0I
|
||||||
|
ggl5CgXaUx4T6qbA9EG1oaF9NbfFYye4davm7lKqUvI
|
||||||
|
-> ssh-ed25519 bUjjig zFlaOVzFEkPG+J3Yz7alPgSiCVbC/7u/hCTVIP8X/Ho
|
||||||
|
3PBIRu9ZKfb9lkzijw6kKjX0ztXBkiwVaQUx8rxuYJc
|
||||||
|
-> ssh-ed25519 VQSaNw btusrepFF5Jhl3x2YWs6wVrHwzb6qBXfDXESclQJAXo
|
||||||
|
HwfOU3tyP9OsNjTkaMMmJnd4b+0ZfxJLkP6xe5jsAZE
|
||||||
|
-> Tp-grease s03Py `u6"4 E|5 _
|
||||||
|
3CvcQ6NEZKLY1F6y0cTMQPwV9mJvHB0T7dauvWJAYKkfb95TymqfDYGWwW1veND2
|
||||||
|
n1XD/arAJHVwva95K7TaQdsNLPGo8/VePQGUnYqi
|
||||||
|
--- qe75UTWqdDd0gGg0nm054SFZ2AgqVBw/bbycvcZSfQY
|
||||||
|
ãñêÕ]¹¦zÂg©;Ê¡îñ˜öÓ´0éÅYëÀHãŒ!@ìpö¸T«?£iÞ‰áèÚ>I^ü‚l·o5”¯ë:{¬gJk£vø>€W8ði
|
|
@ -1,3 +1,6 @@
|
||||||
(import ../../../keys).mkSecrets [ "web03" ] [
|
(import ../../../keys).mkSecrets [ "web03" ] [
|
||||||
# List of secrets for web03
|
# List of secrets for web03
|
||||||
|
"dj_interludes-email_host_password_file"
|
||||||
|
"dj_interludes-secret_key_file"
|
||||||
|
"webhook-interludes_token"
|
||||||
]
|
]
|
||||||
|
|
BIN
machines/web03/secrets/webhook-interludes_token
Normal file
BIN
machines/web03/secrets/webhook-interludes_token
Normal file
Binary file not shown.
30
meta/dns.nix
30
meta/dns.nix
|
@ -1,7 +1,7 @@
|
||||||
{ lib, dns, ... }:
|
{ lib, dns, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mapAttrs' nameValuePair;
|
inherit (lib) mapAttrs' nameValuePair optional;
|
||||||
inherit (lib.extra) fuseAttrs mapSingleFuse;
|
inherit (lib.extra) fuseAttrs mapSingleFuse;
|
||||||
|
|
||||||
inherit (dns.lib.combinators) mx spf ttl;
|
inherit (dns.lib.combinators) mx spf ttl;
|
||||||
|
@ -138,7 +138,9 @@ let
|
||||||
];
|
];
|
||||||
|
|
||||||
web03.dual = [
|
web03.dual = [
|
||||||
"*.webapps" # Django apps
|
# Django Apps
|
||||||
|
"*.webapps"
|
||||||
|
"apps-webhook"
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -215,17 +217,19 @@ in
|
||||||
subdomains = mapAttrs' (
|
subdomains = mapAttrs' (
|
||||||
host:
|
host:
|
||||||
{ site, ... }:
|
{ site, ... }:
|
||||||
nameValuePair "${host}.${site}" (
|
let
|
||||||
with meta.network.${host}.addresses;
|
net = meta.network.${host};
|
||||||
{
|
inherit (net.addresses) ipv4 ipv6;
|
||||||
A = ipv4;
|
in
|
||||||
AAAA = ipv6;
|
nameValuePair "${host}.${site}" {
|
||||||
subdomains = {
|
A = ipv4;
|
||||||
v4.A = ipv4;
|
AAAA = ipv6;
|
||||||
v6.AAAA = ipv6;
|
subdomains = {
|
||||||
};
|
v4.A = ipv4;
|
||||||
}
|
v6.AAAA = ipv6;
|
||||||
)
|
private.A = optional (net.netbirdIp != null) net.netbirdIp;
|
||||||
|
};
|
||||||
|
}
|
||||||
) meta.nodes;
|
) meta.nodes;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -171,7 +171,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
hostId = "8afc7749";
|
hostId = "8afc7749";
|
||||||
netbirdIp = null; # web03 is not yet connected to the VPN
|
netbirdIp = "100.80.157.46";
|
||||||
};
|
};
|
||||||
|
|
||||||
rescue01 = {
|
rescue01 = {
|
||||||
|
|
|
@ -135,7 +135,7 @@
|
||||||
nix-modules = [ "services/django-apps" ];
|
nix-modules = [ "services/django-apps" ];
|
||||||
|
|
||||||
stateVersion = "24.05";
|
stateVersion = "24.05";
|
||||||
nixpkgs = "24.05";
|
nixpkgs = "unstable";
|
||||||
vm-cluster = "Hyperviseur NPS";
|
vm-cluster = "Hyperviseur NPS";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,11 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
members = {
|
members = {
|
||||||
|
agroudiev = {
|
||||||
|
name = "Antoine Groudiev";
|
||||||
|
email = "antoine.groudiev@dgnum.eu";
|
||||||
|
};
|
||||||
|
|
||||||
catvayor = {
|
catvayor = {
|
||||||
name = "Lubin Bailly";
|
name = "Lubin Bailly";
|
||||||
email = "catvayor@dgnum.eu";
|
email = "catvayor@dgnum.eu";
|
||||||
|
@ -34,6 +39,12 @@
|
||||||
username = "jmalka";
|
username = "jmalka";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mboyer = {
|
||||||
|
name = "Matthieu Boyer";
|
||||||
|
email = "matthieu.boyer@dgnum.eu";
|
||||||
|
username = "mboyer02";
|
||||||
|
};
|
||||||
|
|
||||||
mdebray = {
|
mdebray = {
|
||||||
name = "Maurice Debray";
|
name = "Maurice Debray";
|
||||||
email = "maurice.debray@dgnum.eu";
|
email = "maurice.debray@dgnum.eu";
|
||||||
|
@ -57,7 +68,6 @@
|
||||||
"thubrecht"
|
"thubrecht"
|
||||||
"raito"
|
"raito"
|
||||||
"mdebray"
|
"mdebray"
|
||||||
"luj"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# members of this group are root on the fai infrastructure
|
# members of this group are root on the fai infrastructure
|
||||||
|
|
|
@ -16,8 +16,8 @@ python3.pkgs.buildPythonApplication {
|
||||||
|
|
||||||
src = fetchgit {
|
src = fetchgit {
|
||||||
url = "https://git.dgnum.eu/DGNum/netbox-agent";
|
url = "https://git.dgnum.eu/DGNum/netbox-agent";
|
||||||
rev = "12ceea413cbb87280713de734b5e1b3e88c00178";
|
rev = "424283239658516feb34c0f68496775350b1bf22";
|
||||||
hash = "sha256-v6H8/yNUcpHERiyzytR2ZADLiDK2QpzSEmxTP5m9BLE=";
|
hash = "sha256-sp1QVy8AIezR2LRDDYS9G0g0GQRwGKGmEE7ykITPxtY=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = with python3.pkgs; [
|
nativeBuildInputs = with python3.pkgs; [
|
||||||
|
|
|
@ -59,10 +59,10 @@
|
||||||
"pre_releases": false,
|
"pre_releases": false,
|
||||||
"version_upper_bound": null,
|
"version_upper_bound": null,
|
||||||
"release_prefix": null,
|
"release_prefix": null,
|
||||||
"version": "v1.8.2",
|
"version": "v1.9.0",
|
||||||
"revision": "0a97c6683ecb8d92ab0ce4c3c39e896e4a3fe388",
|
"revision": "49a4936cee640e27d74baee6fd1278285d29b100",
|
||||||
"url": "https://api.github.com/repos/nix-community/disko/tarball/v1.8.2",
|
"url": "https://api.github.com/repos/nix-community/disko/tarball/v1.9.0",
|
||||||
"hash": "1xivgibk1fa07z4xqxpyha6yyb0pmahf52caf1kgh8zxr231ai1v"
|
"hash": "0j76ar4qz320fakdii4659w5lww8wiz6yb7g47npywqvf2lbp388"
|
||||||
},
|
},
|
||||||
"dns.nix": {
|
"dns.nix": {
|
||||||
"type": "GitRelease",
|
"type": "GitRelease",
|
||||||
|
@ -87,9 +87,9 @@
|
||||||
"repo": "git-hooks.nix"
|
"repo": "git-hooks.nix"
|
||||||
},
|
},
|
||||||
"branch": "master",
|
"branch": "master",
|
||||||
"revision": "3c3e88f0f544d6bb54329832616af7eb971b6be6",
|
"revision": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0",
|
||||||
"url": "https://github.com/cachix/git-hooks.nix/archive/3c3e88f0f544d6bb54329832616af7eb971b6be6.tar.gz",
|
"url": "https://github.com/cachix/git-hooks.nix/archive/cd1af27aa85026ac759d5d3fccf650abe7e1bbf0.tar.gz",
|
||||||
"hash": "04pwjz423iq2nkazkys905gvsm5j39722ngavrnx42b8msr5k555"
|
"hash": "1icl4cz33lkr4bz7fvlf3jppmahgpzij81wfa5any3z7w7b5lnxw"
|
||||||
},
|
},
|
||||||
"kadenios": {
|
"kadenios": {
|
||||||
"type": "Git",
|
"type": "Git",
|
||||||
|
@ -144,9 +144,9 @@
|
||||||
"url": "https://git.lix.systems/lix-project/lix.git"
|
"url": "https://git.lix.systems/lix-project/lix.git"
|
||||||
},
|
},
|
||||||
"branch": "main",
|
"branch": "main",
|
||||||
"revision": "0ff8f9132552e03497b07e1e5c068660a7a04515",
|
"revision": "c859d03013712b349d82ee6223948d6d03e63a8d",
|
||||||
"url": null,
|
"url": null,
|
||||||
"hash": "0qdaiqp5q2nb0yffc03vhlbd55v1jk3jlxz26prhk0hxddz0xhyq"
|
"hash": "14bn1c3azvnkp1wl28x7y288vpd2gp96nswlnfzrcp13a4ivbbbf"
|
||||||
},
|
},
|
||||||
"lix-module": {
|
"lix-module": {
|
||||||
"type": "Git",
|
"type": "Git",
|
||||||
|
@ -155,9 +155,9 @@
|
||||||
"url": "https://git.lix.systems/lix-project/nixos-module.git"
|
"url": "https://git.lix.systems/lix-project/nixos-module.git"
|
||||||
},
|
},
|
||||||
"branch": "main",
|
"branch": "main",
|
||||||
"revision": "fd186f535a4ac7ae35d98c1dd5d79f0a81b7976d",
|
"revision": "691193879d96bdfd1e6ab5ebcca2fadc7604cf34",
|
||||||
"url": null,
|
"url": null,
|
||||||
"hash": "0jxpqaz12lqibg03iv36sa0shfvamn2yhg937llv3kl4csijd34f"
|
"hash": "1h4f2p6x8vq7bfc20hxk6zz9i4imsjjkmf0m28bzmx6vinxqimj4"
|
||||||
},
|
},
|
||||||
"lon": {
|
"lon": {
|
||||||
"type": "Git",
|
"type": "Git",
|
||||||
|
@ -178,9 +178,9 @@
|
||||||
"url": "https://git.dgnum.eu/DGNum/metis"
|
"url": "https://git.dgnum.eu/DGNum/metis"
|
||||||
},
|
},
|
||||||
"branch": "master",
|
"branch": "master",
|
||||||
"revision": "f631751da44a330c41398356ce2295e17ed45b7b",
|
"revision": "ed6fafda45d638b1bafd5deaee098b80156b41e8",
|
||||||
"url": null,
|
"url": null,
|
||||||
"hash": "1laclhq6jz9mni4vxsxk3c143c2x478z1lqj115mqyj0d62rz8mg"
|
"hash": "086spyhn2x1x2h31b0y4an501fdhph1nk64riybqnh6mqjkzlq4m"
|
||||||
},
|
},
|
||||||
"microvm.nix": {
|
"microvm.nix": {
|
||||||
"type": "Git",
|
"type": "Git",
|
||||||
|
@ -194,6 +194,20 @@
|
||||||
"url": "https://github.com/RaitoBezarius/microvm.nix/archive/49899c9a4fdf75320785e79709bf1608c34caeb8.tar.gz",
|
"url": "https://github.com/RaitoBezarius/microvm.nix/archive/49899c9a4fdf75320785e79709bf1608c34caeb8.tar.gz",
|
||||||
"hash": "0sz6azdpiz4bd36x23bcdhx6mwyqj8zl5cczjgv48xqfmysy8zwy"
|
"hash": "0sz6azdpiz4bd36x23bcdhx6mwyqj8zl5cczjgv48xqfmysy8zwy"
|
||||||
},
|
},
|
||||||
|
"nix-actions": {
|
||||||
|
"type": "GitRelease",
|
||||||
|
"repository": {
|
||||||
|
"type": "Git",
|
||||||
|
"url": "https://git.dgnum.eu/DGNum/nix-actions.git"
|
||||||
|
},
|
||||||
|
"pre_releases": false,
|
||||||
|
"version_upper_bound": null,
|
||||||
|
"release_prefix": null,
|
||||||
|
"version": "v0.2.2",
|
||||||
|
"revision": "b9cb5d6f945d1e3fd7b70d63848c70335e9912e8",
|
||||||
|
"url": null,
|
||||||
|
"hash": "0m6bw5qlrchsigx7x4nz3xkcn3dnr14k5j0ws9lbggnldnz9qg2w"
|
||||||
|
},
|
||||||
"nix-modules": {
|
"nix-modules": {
|
||||||
"type": "Git",
|
"type": "Git",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -201,9 +215,9 @@
|
||||||
"url": "https://git.hubrecht.ovh/hubrecht/nix-modules.git"
|
"url": "https://git.hubrecht.ovh/hubrecht/nix-modules.git"
|
||||||
},
|
},
|
||||||
"branch": "main",
|
"branch": "main",
|
||||||
"revision": "516225dc6958645284b11b74b9ce31e01993341c",
|
"revision": "695cf83c526dd3d78c8ed79b33f80019db4c8019",
|
||||||
"url": null,
|
"url": null,
|
||||||
"hash": "1cxn1m1xf9p7p8a0y8r6iwp08d886k5rmgl947r9d0vg7ah31kmj"
|
"hash": "0xqv1rx0dnl3r1rhqdahcp8jqv8j9qc1v6xnmfiv0ddh81jd0szj"
|
||||||
},
|
},
|
||||||
"nix-patches": {
|
"nix-patches": {
|
||||||
"type": "GitRelease",
|
"type": "GitRelease",
|
||||||
|
@ -226,15 +240,15 @@
|
||||||
"url": "https://git.hubrecht.ovh/hubrecht/nix-pkgs"
|
"url": "https://git.hubrecht.ovh/hubrecht/nix-pkgs"
|
||||||
},
|
},
|
||||||
"branch": "main",
|
"branch": "main",
|
||||||
"revision": "0e80d4dcdd54a75556c0784de55dc139ad4fe797",
|
"revision": "0a4b564221481b5c40a677f8bfd5760f7b3398f8",
|
||||||
"url": null,
|
"url": null,
|
||||||
"hash": "1hlb0cczxq0jrzw4lhmkibnb8skcar0rmny594aqgyikknwzx2qf"
|
"hash": "121fqmr1jvsnnc5marvnsj3ic0w9f11lq3sx9ly197kc5rc1naj3"
|
||||||
},
|
},
|
||||||
"nixos-24.05": {
|
"nixos-24.05": {
|
||||||
"type": "Channel",
|
"type": "Channel",
|
||||||
"name": "nixos-24.05",
|
"name": "nixos-24.05",
|
||||||
"url": "https://releases.nixos.org/nixos/24.05/nixos-24.05.5809.4eb33fe664af/nixexprs.tar.xz",
|
"url": "https://releases.nixos.org/nixos/24.05/nixos-24.05.6668.e8c38b73aeb2/nixexprs.tar.xz",
|
||||||
"hash": "02hxkkrpf33s6nsqkla1292zw64dqfq9wpkda5hry3vr3fhxwwg4"
|
"hash": "0lhh36z3fvd3b64dz7an08y3c3shb67aj17ny9z28bs21i3dc5yh"
|
||||||
},
|
},
|
||||||
"nixos-generators": {
|
"nixos-generators": {
|
||||||
"type": "Git",
|
"type": "Git",
|
||||||
|
@ -244,21 +258,21 @@
|
||||||
"repo": "nixos-generators"
|
"repo": "nixos-generators"
|
||||||
},
|
},
|
||||||
"branch": "master",
|
"branch": "master",
|
||||||
"revision": "dd28a0806e7124fe392c33c9ccaa12f21970401f",
|
"revision": "15a87ccb45e06d24a9fd5f99a49782efe11b23f0",
|
||||||
"url": "https://github.com/nix-community/nixos-generators/archive/dd28a0806e7124fe392c33c9ccaa12f21970401f.tar.gz",
|
"url": "https://github.com/nix-community/nixos-generators/archive/15a87ccb45e06d24a9fd5f99a49782efe11b23f0.tar.gz",
|
||||||
"hash": "09226kqddjg1m8m1q9n4l1hsln93hckhj238q0v851wxbwd0qq73"
|
"hash": "0mwllbwinr6cira94347vhzq3jn3zgp28xg6w1ga0ncls7s476q4"
|
||||||
},
|
},
|
||||||
"nixos-unstable": {
|
"nixos-unstable": {
|
||||||
"type": "Channel",
|
"type": "Channel",
|
||||||
"name": "nixos-unstable",
|
"name": "nixos-unstable",
|
||||||
"url": "https://releases.nixos.org/nixos/unstable/nixos-24.11pre694395.4c2fcb090b1f/nixexprs.tar.xz",
|
"url": "https://releases.nixos.org/nixos/unstable/nixos-25.05beta708622.5e4fbfb6b3de/nixexprs.tar.xz",
|
||||||
"hash": "05fszj13lci5gdbn5grn92wd3mzj6f7gy11kqj78xcsg69m2wbrl"
|
"hash": "18zd6qnn1zmz3pgq2q484lmdk486ncxyp8r5g9c71r9dc8jr5dnc"
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"type": "Channel",
|
"type": "Channel",
|
||||||
"name": "nixpkgs-unstable",
|
"name": "nixpkgs-unstable",
|
||||||
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-24.11pre694416.ccc0c2126893/nixexprs.tar.xz",
|
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-25.05pre709559.5083ec887760/nixexprs.tar.xz",
|
||||||
"hash": "0cn1z4wzps8nfqxzr6l5mbn81adcqy2cy2ic70z13fhzicmxfsbx"
|
"hash": "1z912j1lmrg8zp2hpmmi69dls9zlpvqfvdkvh5xc3x6iqkqwn0cd"
|
||||||
},
|
},
|
||||||
"proxmox-nixos": {
|
"proxmox-nixos": {
|
||||||
"type": "Git",
|
"type": "Git",
|
||||||
|
@ -268,9 +282,9 @@
|
||||||
"repo": "proxmox-nixos"
|
"repo": "proxmox-nixos"
|
||||||
},
|
},
|
||||||
"branch": "main",
|
"branch": "main",
|
||||||
"revision": "950e4cccac0f942076e8558f7f9f4d496cabfb18",
|
"revision": "93880e244b528deca89828bc1edf08e23ccc18c4",
|
||||||
"url": "https://github.com/SaumonNet/proxmox-nixos/archive/950e4cccac0f942076e8558f7f9f4d496cabfb18.tar.gz",
|
"url": "https://github.com/SaumonNet/proxmox-nixos/archive/93880e244b528deca89828bc1edf08e23ccc18c4.tar.gz",
|
||||||
"hash": "0bhqw42ydc0jfkfqw64xsg518a1pbxnvpqw92nna7lm8mzpxm6d4"
|
"hash": "0dyiv7mvvxc0zygfzfb6zhc0v3s7a9pv8xydprxgqhyy1sajp02h"
|
||||||
},
|
},
|
||||||
"signal-irc-bridge": {
|
"signal-irc-bridge": {
|
||||||
"type": "Git",
|
"type": "Git",
|
||||||
|
@ -302,10 +316,10 @@
|
||||||
"server": "https://git.helsinki.tools/"
|
"server": "https://git.helsinki.tools/"
|
||||||
},
|
},
|
||||||
"branch": "master",
|
"branch": "master",
|
||||||
"revision": "f72adfc39c18630b45f8c982910314246d4a8d92",
|
"revision": "10c3f658aecc0a54baf062137071b129f3897111",
|
||||||
"url": "https://git.helsinki.tools/api/v4/projects/helsinki-systems%2Fwp4nix/repository/archive.tar.gz?sha=f72adfc39c18630b45f8c982910314246d4a8d92",
|
"url": "https://git.helsinki.tools/api/v4/projects/helsinki-systems%2Fwp4nix/repository/archive.tar.gz?sha=10c3f658aecc0a54baf062137071b129f3897111",
|
||||||
"hash": "08qfaav3vb832dr3r6f2n1ah6zyryvab0dxsaxwi6gk5p3zad3l8"
|
"hash": "13gbzfrz9vv9iz43bfl67hl11lsmrh524mw6kkjavfwpzw5shm1g"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"version": 3
|
"version": 3
|
||||||
}
|
}
|
70
patches/06-netbox-qrcode.patch
Normal file
70
patches/06-netbox-qrcode.patch
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
diff --git a/pkgs/development/python-modules/netbox-qrcode/default.nix b/pkgs/development/python-modules/netbox-qrcode/default.nix
|
||||||
|
new file mode 100644
|
||||||
|
index 000000000000..b378b839a8dc
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/pkgs/development/python-modules/netbox-qrcode/default.nix
|
||||||
|
@@ -0,0 +1,51 @@
|
||||||
|
+{ lib
|
||||||
|
+, buildPythonPackage
|
||||||
|
+, fetchFromGitHub
|
||||||
|
+, setuptools
|
||||||
|
+, wheel
|
||||||
|
+, pillow
|
||||||
|
+, qrcode
|
||||||
|
+, netbox
|
||||||
|
+}:
|
||||||
|
+
|
||||||
|
+buildPythonPackage rec {
|
||||||
|
+ pname = "netbox-qrcode";
|
||||||
|
+ version = "0.0.13";
|
||||||
|
+ pyproject = true;
|
||||||
|
+
|
||||||
|
+ src = fetchFromGitHub {
|
||||||
|
+ owner = "netbox-community";
|
||||||
|
+ repo = "netbox-qrcode";
|
||||||
|
+ rev = "v${version}";
|
||||||
|
+ hash = "sha256-/labSZyB1SkU/uemuL946RDk8IVEAgCYJY2vrJFney0=";
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
+ nativeBuildInputs = [
|
||||||
|
+ setuptools
|
||||||
|
+ wheel
|
||||||
|
+ ];
|
||||||
|
+
|
||||||
|
+ propagatedBuildInputs = [
|
||||||
|
+ qrcode
|
||||||
|
+ pillow
|
||||||
|
+ ];
|
||||||
|
+
|
||||||
|
+ checkInputs = [
|
||||||
|
+ netbox
|
||||||
|
+ ];
|
||||||
|
+
|
||||||
|
+ preFixup = ''
|
||||||
|
+ export PYTHONPATH=${netbox}/opt/netbox/netbox:$PYTHONPATH
|
||||||
|
+ '';
|
||||||
|
+
|
||||||
|
+ pythonImportsCheck = [
|
||||||
|
+ "netbox_qrcode"
|
||||||
|
+ ];
|
||||||
|
+
|
||||||
|
+ meta = with lib; {
|
||||||
|
+ description = "NetBox Plugin for generate QR Codes";
|
||||||
|
+ homepage = "https://github.com/netbox-community/netbox-qrcode";
|
||||||
|
+ license = licenses.asl20;
|
||||||
|
+ maintainers = with maintainers; [ sinavir ];
|
||||||
|
+ };
|
||||||
|
+}
|
||||||
|
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
|
||||||
|
index 9999d745e3ac..b226e0063672 100644
|
||||||
|
--- a/pkgs/top-level/python-packages.nix
|
||||||
|
+++ b/pkgs/top-level/python-packages.nix
|
||||||
|
@@ -8989,6 +8989,8 @@ self: super: with self; {
|
||||||
|
|
||||||
|
netbox-reorder-rack = callPackage ../development/python-modules/netbox-reorder-rack { };
|
||||||
|
|
||||||
|
+ netbox-qrcode = callPackage ../development/python-modules/netbox-qrcode { };
|
||||||
|
+
|
||||||
|
netcdf4 = callPackage ../development/python-modules/netcdf4 { };
|
||||||
|
|
||||||
|
netdata = callPackage ../development/python-modules/netdata { };
|
|
@ -1,12 +1,11 @@
|
||||||
{
|
{
|
||||||
"nixos-24.05" = [
|
"nixos-24.05" = [
|
||||||
# netbox qrcode plugin
|
|
||||||
{
|
{
|
||||||
_type = "commit";
|
_type = "static";
|
||||||
sha = "c82191d848e7a37e125ee15c485f32ac01afc0b2";
|
path = ./06-netbox-qrcode.patch;
|
||||||
hash = "sha256-TooktlqihtULzJJsHvm8EubbUdJZvbDKdIDcYu7Qcig=";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# nixos/nextcloud: Rename autocreate (a no-op) to verify_bucket_exists
|
||||||
{
|
{
|
||||||
id = "275165";
|
id = "275165";
|
||||||
hash = "sha256-9a26V3Pi8yLD3N9+mC1kvJoruxRTp/qOHapnt6VX7pw=";
|
hash = "sha256-9a26V3Pi8yLD3N9+mC1kvJoruxRTp/qOHapnt6VX7pw=";
|
||||||
|
@ -49,9 +48,8 @@
|
||||||
"nixos-unstable" = [
|
"nixos-unstable" = [
|
||||||
# netbox qrcode plugin
|
# netbox qrcode plugin
|
||||||
{
|
{
|
||||||
_type = "commit";
|
_type = "static";
|
||||||
sha = "c82191d848e7a37e125ee15c485f32ac01afc0b2";
|
path = ./06-netbox-qrcode.patch;
|
||||||
hash = "sha256-TooktlqihtULzJJsHvm8EubbUdJZvbDKdIDcYu7Qcig=";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Build netbird-relay
|
# Build netbird-relay
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
set -eu -o pipefail
|
set -o errexit
|
||||||
|
set -o nounset
|
||||||
|
set -o pipefail
|
||||||
|
shopt -s lastpipe
|
||||||
|
|
||||||
drv=$("@colmena@/bin/colmena" eval --instantiate -E "{ nodes, ... }: nodes.${BUILD_NODE}.config.system.build.toplevel")
|
drv=$(colmena eval --instantiate -E "{ nodes, ... }: nodes.${BUILD_NODE}.config.system.build.toplevel")
|
||||||
|
|
||||||
# Build the derivation and send it to the great beyond
|
# Build the derivation and send it to the great beyond
|
||||||
nix-store --query --requisites --force-realise --include-outputs "$drv" | grep -v '.*\.drv' >paths.txt
|
nix-store --query --requisites --force-realise --include-outputs "$drv" | grep -v '.*\.drv' >paths.txt
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
#!@bash@/bin/bash
|
|
||||||
# shellcheck shell=bash
|
|
||||||
|
|
||||||
set -o errexit
|
set -o errexit
|
||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
@ -20,7 +16,7 @@ Exemple:
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--help|-h)
|
--help | -h)
|
||||||
echo "$usage"
|
echo "$usage"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
@ -51,13 +47,13 @@ GIT_TOP_LEVEL=$(git rev-parse --show-toplevel)
|
||||||
|
|
||||||
echo "Cloning local main..."
|
echo "Cloning local main..."
|
||||||
git clone -q --branch main --single-branch "$GIT_TOP_LEVEL" "$TMP"
|
git clone -q --branch main --single-branch "$GIT_TOP_LEVEL" "$TMP"
|
||||||
pushd "$TMP" > /dev/null || exit 2
|
pushd "$TMP" >/dev/null || exit 2
|
||||||
|
|
||||||
####################
|
####################
|
||||||
# Evaluate configs #
|
# Evaluate configs #
|
||||||
####################
|
####################
|
||||||
|
|
||||||
colmena_failed () {
|
colmena_failed() {
|
||||||
>&2 echo "Colmena failed. Check your config. Logs:"
|
>&2 echo "Colmena failed. Check your config. Logs:"
|
||||||
>&2 cat "$COLMENA_LOGS"
|
>&2 cat "$COLMENA_LOGS"
|
||||||
exit 3
|
exit 3
|
||||||
|
@ -68,7 +64,7 @@ COLMENA_LOGS=$(mktemp)
|
||||||
echo "Evaluating configs..."
|
echo "Evaluating configs..."
|
||||||
# Disable warning because of '${}'
|
# Disable warning because of '${}'
|
||||||
# shellcheck disable=SC2016
|
# shellcheck disable=SC2016
|
||||||
RESULTS=$(colmena eval -E '{ nodes, lib, ...}: lib.mapAttrsToList (k: v: { machine = k; path = v.config.system.build.toplevel; drv = v.config.system.build.toplevel.drvPath; domain = "${v.config.networking.hostName}.${v.config.networking.domain}"; }) nodes' 2> "$COLMENA_LOGS" || colmena_failed)
|
RESULTS=$(colmena eval -E '{ nodes, lib, ...}: lib.mapAttrsToList (k: v: { machine = k; path = v.config.system.build.toplevel; drv = v.config.system.build.toplevel.drvPath; domain = "${v.config.networking.hostName}.${v.config.networking.domain}"; }) nodes' 2>"$COLMENA_LOGS" || colmena_failed)
|
||||||
|
|
||||||
rm "$COLMENA_LOGS"
|
rm "$COLMENA_LOGS"
|
||||||
echo "Evaluation finished"
|
echo "Evaluation finished"
|
||||||
|
@ -77,49 +73,48 @@ echo "Evaluation finished"
|
||||||
# retrieve and check current-system #
|
# retrieve and check current-system #
|
||||||
#####################################
|
#####################################
|
||||||
|
|
||||||
retrieve_current_system () {
|
retrieve_current_system() {
|
||||||
# TODO implement a less invasive method
|
# TODO implement a less invasive method
|
||||||
ssh -n "root@$1" "readlink -f /run/current-system"
|
ssh -n "root@$1" "readlink -f /run/current-system"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return_status=0
|
return_status=0
|
||||||
echo "$RESULTS" | @jq@/bin/jq -c '.[]' |
|
echo "$RESULTS" | jq -c '.[]' |
|
||||||
while IFS=$'\n' read -r c; do
|
while IFS=$'\n' read -r c; do
|
||||||
|
|
||||||
machine=$(echo "$c" | @jq@/bin/jq -r '.machine')
|
machine=$(echo "$c" | jq -r '.machine')
|
||||||
if [[ -n ${node-} ]] && [[ "$machine" != "$node" ]]; then
|
if [[ -n ${node-} ]] && [[ "$machine" != "$node" ]]; then
|
||||||
echo "Skipping ${machine}"
|
echo "Skipping ${machine}"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
expected_path=$(echo "$c" | @jq@/bin/jq -r '.path')
|
expected_path=$(echo "$c" | jq -r '.path')
|
||||||
domain=$(echo "$c" | @jq@/bin/jq -r '.domain')
|
domain=$(echo "$c" | jq -r '.domain')
|
||||||
drv_path=$(echo "$c" | @jq@/bin/jq -r '.drv')
|
drv_path=$(echo "$c" | jq -r '.drv')
|
||||||
|
|
||||||
err=0
|
err=0
|
||||||
current_path=$(retrieve_current_system "$domain") || err=1
|
current_path=$(retrieve_current_system "$domain") || err=1
|
||||||
if [[ "1" == "${err}" ]] ; then
|
if [[ "1" == "${err}" ]]; then
|
||||||
echo "❌ failed to contact $domain !"
|
echo "❌ failed to contact $domain !"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$expected_path" == "$current_path" ] ; then
|
if [ "$expected_path" == "$current_path" ]; then
|
||||||
echo "✅ $machine -> OK"
|
echo "✅ $machine -> OK"
|
||||||
elif [[ -n ${diff-} ]] ; then
|
elif [[ -n ${diff-} ]]; then
|
||||||
nix-copy-closure --from "root@$domain" "$current_path"
|
nix-copy-closure --from "root@$domain" "$current_path"
|
||||||
nix-store -r "$drv_path"
|
nix-store -r "$drv_path"
|
||||||
echo "$machine -> error. nvd output:"
|
echo "$machine -> error. nvd output:"
|
||||||
@nvd@/bin/nvd diff "$expected_path" "$current_path"
|
nvd diff "$expected_path" "$current_path"
|
||||||
return_status=1
|
return_status=1
|
||||||
else
|
else
|
||||||
echo "☠️ $machine -> error:"
|
echo "☠️ $machine -> error:"
|
||||||
echo " - Expected system: $expected_path"
|
echo " - Expected system: $expected_path"
|
||||||
echo " - Current system: $current_path"
|
echo " - Current system: $current_path"
|
||||||
return_status=1
|
return_status=1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
popd > /dev/null || exit 2
|
popd >/dev/null || exit 2
|
||||||
rm -r "$TMP"
|
rm -r "$TMP"
|
||||||
|
|
||||||
exit $return_status
|
exit $return_status
|
||||||
|
|
|
@ -1,39 +1,32 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs }:
|
||||||
|
|
||||||
let
|
let
|
||||||
substitutions = {
|
inherit (pkgs.lib) mapAttrs;
|
||||||
inherit (pkgs)
|
|
||||||
bash
|
inherit (pkgs)
|
||||||
|
writeShellApplication
|
||||||
|
colmena
|
||||||
|
jq
|
||||||
|
nvd
|
||||||
|
;
|
||||||
|
|
||||||
|
scripts = {
|
||||||
|
cache-node = [ colmena ];
|
||||||
|
check-deployment = [
|
||||||
colmena
|
colmena
|
||||||
coreutils
|
|
||||||
nvd
|
|
||||||
git
|
|
||||||
jq
|
jq
|
||||||
;
|
nvd
|
||||||
|
];
|
||||||
|
launch-vm = [ colmena ];
|
||||||
|
list-nodes = [ jq ];
|
||||||
};
|
};
|
||||||
|
|
||||||
mkShellScript =
|
|
||||||
name:
|
|
||||||
(pkgs.substituteAll (
|
|
||||||
{
|
|
||||||
inherit name;
|
|
||||||
src = ./. + "/${name}.sh";
|
|
||||||
dir = "/bin/";
|
|
||||||
isExecutable = true;
|
|
||||||
|
|
||||||
checkPhase = ''
|
|
||||||
${pkgs.stdenv.shellDryRun} "$target"
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
// substitutions
|
|
||||||
));
|
|
||||||
|
|
||||||
scripts = [
|
|
||||||
"cache-node"
|
|
||||||
"check-deployment"
|
|
||||||
"launch-vm"
|
|
||||||
"list-nodes"
|
|
||||||
];
|
|
||||||
in
|
in
|
||||||
|
|
||||||
builtins.map mkShellScript scripts
|
mapAttrs (
|
||||||
|
name: runtimeInputs:
|
||||||
|
writeShellApplication {
|
||||||
|
inherit name runtimeInputs;
|
||||||
|
|
||||||
|
text = builtins.readFile ./${name}.sh;
|
||||||
|
}
|
||||||
|
) scripts
|
||||||
|
|
|
@ -1,33 +1,35 @@
|
||||||
#!@bash@/bin/bash
|
|
||||||
# shellcheck shell=bash
|
|
||||||
set -o errexit
|
set -o errexit
|
||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
shopt -s lastpipe
|
||||||
|
|
||||||
MACHINE=""
|
MACHINE=""
|
||||||
HOSTFWD=""
|
HOSTFWD=""
|
||||||
|
|
||||||
while getopts 'p:o:h' opt; do
|
while getopts 'p:o:h' opt; do
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
p)
|
p)
|
||||||
HOSTFWD=",hostfwd=tcp::$OPTARG$HOSTFWD"
|
HOSTFWD=",hostfwd=tcp::$OPTARG$HOSTFWD"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
o)
|
o)
|
||||||
MACHINE="$OPTARG"
|
MACHINE="$OPTARG"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
h|?)
|
h | ?)
|
||||||
echo "Usage: $(basename "$0") [-p hostport-:guestport] -o MACHINE"
|
echo "Usage: $(basename "$0") [-p hostport-:guestport] -o MACHINE"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
shift "$((OPTIND -1))"
|
shift "$((OPTIND - 1))"
|
||||||
|
|
||||||
if [ -z "$MACHINE" ]; then echo "-o option needed"; exit 1; fi
|
if [ -z "$MACHINE" ]; then
|
||||||
|
echo "-o option needed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
DRV_PATH=$(@colmena@/bin/colmena eval --instantiate -E "{nodes, ...}: nodes.$MACHINE.config.system.build.vm")
|
DRV_PATH=$(colmena eval --instantiate -E "{nodes, ...}: nodes.$MACHINE.config.system.build.vm")
|
||||||
|
|
||||||
echo "Realising $DRV_PATH"
|
echo "Realising $DRV_PATH"
|
||||||
RESULT=$(nix-store -r "$DRV_PATH")
|
RESULT=$(nix-store -r "$DRV_PATH")
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!@bash@/bin/bash
|
set -o errexit
|
||||||
# shellcheck shell=bash
|
set -o nounset
|
||||||
|
set -o pipefail
|
||||||
|
shopt -s lastpipe
|
||||||
|
|
||||||
cd $(@git@/bin/git rev-parse --show-toplevel)
|
cd "$(git rev-parse --show-toplevel)"
|
||||||
|
|
||||||
nix-instantiate --strict --eval --json -A nodes | @jq@/bin/jq .
|
nix-instantiate --strict --eval --json -A nodes | jq .
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
(import ./. { }).shells.default
|
(import ./. { }).devShell
|
||||||
|
|
31
workflows/check-meta.nix
Normal file
31
workflows/check-meta.nix
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
name = "Check meta";
|
||||||
|
on = {
|
||||||
|
pull_request.branches = [ "main" ];
|
||||||
|
push.paths = [ "meta/*" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
jobs = {
|
||||||
|
check_meta = {
|
||||||
|
runs-on = "nix";
|
||||||
|
steps = [
|
||||||
|
{ uses = "actions/checkout@v3"; }
|
||||||
|
{
|
||||||
|
name = "Check the validity of meta options";
|
||||||
|
run = "nix-build meta/verify.nix -A meta";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
check_dns = {
|
||||||
|
runs-on = "nix";
|
||||||
|
steps = [
|
||||||
|
{ uses = "actions/checkout@v3"; }
|
||||||
|
{
|
||||||
|
name = "Check the validity of the DNS configuration";
|
||||||
|
run = "nix-build meta/verify.nix -A dns";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
20
workflows/check-workflows.nix
Normal file
20
workflows/check-workflows.nix
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
name = "Check workflows";
|
||||||
|
on = {
|
||||||
|
pull_request.branches = [ "main" ];
|
||||||
|
push.paths = [ "workflows/*" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
jobs = {
|
||||||
|
check_workflows = {
|
||||||
|
runs-on = "nix";
|
||||||
|
steps = [
|
||||||
|
{ uses = "actions/checkout@v3"; }
|
||||||
|
{
|
||||||
|
name = "Check that the workflows are up to date";
|
||||||
|
run = "nix-shell -A check-workflows --run '[ $(git status --porcelain | wc -l) -eq 0 ]'";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
32
workflows/eval-nodes.nix
Normal file
32
workflows/eval-nodes.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{ lib }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) attrNames genAttrs;
|
||||||
|
|
||||||
|
nodes = attrNames (builtins.readDir ../machines);
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
name = "Build all the nodes";
|
||||||
|
on = {
|
||||||
|
pull_request.branches = [ "main" ];
|
||||||
|
push.branches = [ "main" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
jobs = genAttrs nodes (node: {
|
||||||
|
runs-on = "nix";
|
||||||
|
steps = [
|
||||||
|
{ uses = "actions/checkout@v3"; }
|
||||||
|
{
|
||||||
|
name = "Build and cache ${node}";
|
||||||
|
run = "nix-shell -A eval-nodes --run cache-node";
|
||||||
|
env = {
|
||||||
|
STORE_ENDPOINT = "https://tvix-store.dgnum.eu/infra-signing/";
|
||||||
|
STORE_USER = "admin";
|
||||||
|
STORE_PASSWORD = "\${{ secrets.STORE_PASSWORD }}";
|
||||||
|
BUILD_NODE = node;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
});
|
||||||
|
}
|
|
@ -1,31 +1,24 @@
|
||||||
name: npins update
|
{
|
||||||
on:
|
name = "npins update";
|
||||||
schedule:
|
on.schedule = [
|
||||||
# Run at 11 o'clock every wednesday
|
# Run at 11 o'clock every wednesday
|
||||||
- cron: "25 15 * * *"
|
{ cron = "25 15 * * *"; }
|
||||||
|
];
|
||||||
|
|
||||||
jobs:
|
jobs.npins_update = {
|
||||||
npins_update:
|
runs-on = "nix";
|
||||||
runs-on: nix
|
steps = [
|
||||||
steps:
|
{
|
||||||
# - name: Install applications
|
uses = "actions/checkout@v3";
|
||||||
# run: apt-get update && apt-get install sudo
|
"with" = {
|
||||||
#
|
depth = 0;
|
||||||
- uses: actions/checkout@v3
|
token = "\${{ secrets.TEA_DGNUM_CHORES_TOKEN }}";
|
||||||
with:
|
};
|
||||||
depth: 0
|
}
|
||||||
token: ${{ secrets.TEA_DGNUM_CHORES_TOKEN }}
|
|
||||||
#
|
|
||||||
# - uses: https://github.com/cachix/install-nix-action@v22
|
|
||||||
# with:
|
|
||||||
# nix_path: nixpkgs=channel:nixos-unstable
|
|
||||||
|
|
||||||
# - name: Install tea
|
{
|
||||||
# run: |
|
name = "Update dependencies and open PR if necessary";
|
||||||
# nix-env -f '<nixpkgs>' -i tea
|
run = ''
|
||||||
|
|
||||||
- name: Update dependencies and open PR if necessary
|
|
||||||
run: |
|
|
||||||
npins update
|
npins update
|
||||||
|
|
||||||
if [ ! -z "$(git diff --name-only)" ]; then
|
if [ ! -z "$(git diff --name-only)" ]; then
|
||||||
|
@ -44,7 +37,7 @@ jobs:
|
||||||
# Connect to the server with the cli
|
# Connect to the server with the cli
|
||||||
tea login add \
|
tea login add \
|
||||||
-n dgnum-chores \
|
-n dgnum-chores \
|
||||||
-t '${{ secrets.TEA_DGNUM_CHORES_TOKEN }}' \
|
-t "''${{ secrets.TEA_DGNUM_CHORES_TOKEN }}" \
|
||||||
-u https://git.dgnum.eu
|
-u https://git.dgnum.eu
|
||||||
|
|
||||||
# Create a pull request if needed
|
# Create a pull request if needed
|
||||||
|
@ -56,3 +49,8 @@ jobs:
|
||||||
--head npins-update
|
--head npins-update
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
18
workflows/pre-commit.nix
Normal file
18
workflows/pre-commit.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
name = "Run pre-commit on all files";
|
||||||
|
on = [
|
||||||
|
"push"
|
||||||
|
"pull_request"
|
||||||
|
];
|
||||||
|
|
||||||
|
jobs.check = {
|
||||||
|
runs-on = "nix";
|
||||||
|
steps = [
|
||||||
|
{ uses = "actions/checkout@v3"; }
|
||||||
|
{
|
||||||
|
name = "Run pre-commit on all files";
|
||||||
|
run = "nix-shell -A pre-commit --run 'pre-commit run --all-files --hook-stage pre-push --show-diff-on-failure'";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue