Compare commits

..

273 commits

Author SHA1 Message Date
cdf9819b93
Merge pull request 'updates: element-web, forgejo, keycloak, mastodon, matrix-synapse, nextcloud and more' (#318) from updates-23-03 into main
Reviewed-on: #318
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2025-03-25 17:46:03 +00:00
3cf98c1e0e
tests/keycloak: need to start acme-server
All checks were successful
Flake checks / Check (pull_request) Successful in 25m35s
2025-03-25 18:39:26 +01:00
b5e6483ca4
garage: update to 1.1.0 2025-03-25 18:39:04 +01:00
f591ea6c65
overlays: remove matrix-authentication-service
Some checks failed
Flake checks / Check (pull_request) Failing after 1h13m12s
It's now backported to NixOS 24.11.
2025-03-24 11:17:39 +01:00
e2c7808433
flake.lock: Update
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/19c1140419c4f1cdf88ad4c1cfb6605597628940' (2025-02-25)
  → 'github:nix-community/disko/0d8c6ad4a43906d14abd5c60e0ffe7b587b213de' (2025-03-12)
• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/3876f6b87db82f33775b1ef5ea343986105db764' (2025-03-01)
  → 'github:hercules-ci/flake-parts/f4330d22f1c5d2ba72d3d22df5597d123fdb60a9' (2025-03-07)
• Updated input 'flake-parts/nixpkgs-lib':
    '6d37022434.tar.gz?narHash=sha256-3wHafybyRfpUCLoE8M%2BuPVZinImg3xX%2BNm6gEfN3G8I%3D' (2025-03-01)
  → 'github:nix-community/nixpkgs.lib/147dee35aab2193b174e4c0868bd80ead5ce755c' (2025-03-02)
• Updated input 'fork':
    'github:teutat3s/nixpkgs/e370f40b129e47b08562524ab4f053a172a94273' (2025-02-06)
  → 'github:teutat3s/nixpkgs/8a43eb74ac149c080d57d8c80d647fef74df84d8' (2025-03-05)
• Updated input 'home-manager':
    'github:nix-community/home-manager/9d3d080aec2a35e05a15cedd281c2384767c2cfe' (2025-02-17)
  → 'github:nix-community/home-manager/0948aeedc296f964140d9429223c7e4a0702a1ff' (2025-03-22)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/991bb2f6d46fc2ff7990913c173afdb0318314cb' (2025-03-04)
  → 'github:lnl7/nix-darwin/ebb88c3428dcdd95c06dca4d49b9791a65ab777b' (2025-03-23)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/1546c45c538633ae40b93e2d14e0bb6fd8f13347' (2025-03-02)
  → 'github:nixos/nixpkgs/f0946fa5f1fb876a9dc2e1850d9d3a4e3f914092' (2025-03-23)
• Updated input 'unstable':
    'github:nixos/nixpkgs/ba487dbc9d04e0634c64e3b1f0d25839a0a68246' (2025-03-03)
  → 'github:nixos/nixpkgs/1e5b653dff12029333a6546c11e108ede13052eb' (2025-03-22)
2025-03-24 11:17:20 +01:00
174d979ccc
Merge pull request 'docs: update deletion request docs' (#317) from update-deletion-request-docs into main
Reviewed-on: #317
Reviewed-by: teutat3s <teutat3s@noreply.git.pub.solar>
2025-03-13 16:50:56 +00:00
5ecb8efd60
Merge pull request 'nachtigall: additional disks + docs' (#315) from nachtigall-more-disks into main
Reviewed-on: #315
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2025-03-13 16:50:47 +00:00
3caaf00239
Merge pull request 'docs: add systems overview, ZFS quickstart' (#316) from docs-systems-overview into main
Reviewed-on: #316
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2025-03-13 16:46:13 +00:00
664f7f06cc
docs: update deletion request docs
Some checks failed
Flake checks / Check (pull_request) Failing after 22m47s
* Add note on how to aquire an MAS auth token
* Update matrix cli docs URL
* Explain how to get to the forgejo cli
* Add response template
2025-03-13 17:45:19 +01:00
6dfcffad4b
docs: add TOC to systems overview
Some checks failed
Flake checks / Check (pull_request) Failing after 20m42s
2025-03-11 13:00:09 +01:00
7428c5e125
docs: add systems overview, ZFS quickstart 2025-03-11 12:59:52 +01:00
e8d92cb48f
nachtigall: add additional boot mirrors
Some checks failed
Flake checks / Check (pull_request) Failing after 20m29s
2025-03-11 11:39:46 +01:00
c3e9b81719
docs: add notes about adding disks to nachtigall 2025-03-11 11:39:07 +01:00
e92c7c357d
Merge pull request 'backups: increase spread to 1 hour per backup' (#314) from backups-increase-spread into main
Reviewed-on: #314
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2025-03-08 14:01:43 +00:00
5de43ae03f
backups: increase spread to 1 hour per backup
Some checks failed
Flake checks / Check (pull_request) Failing after 22m4s
2025-03-06 13:38:43 +01:00
2ec4637ced
Merge pull request 'security, maintenance: update keycloak, mastodon, matrix-synapse and others' (#313) from 2025-03 into main
Reviewed-on: #313
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2025-03-04 21:15:17 +00:00
3fdc6d79ac
tests: wait for nachtigall before starting client
Some checks failed
Flake checks / Check (pull_request) Failing after 19m56s
to avoid a race between keycloak and test client
2025-03-04 21:54:34 +01:00
2f48c853fe
tests: don't wait for acme client unit
Some checks failed
Flake checks / Check (pull_request) Has been cancelled
2025-03-04 21:47:57 +01:00
0d637649be
Merge pull request 'mail, treewide: update password because forgejo cannot properly escape strings in 2025' (#311) from update-admins-mail-password into main
Reviewed-on: #311
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2025-03-04 19:37:56 +00:00
c54c14cc60
Merge pull request 'mediawiki: allow svg, pdf file type uploads' (#312) from mediawiki-allow-svg-uploads into main
Reviewed-on: #312
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2025-03-04 19:23:38 +00:00
5dca2382e1
tests: wait for acme_server before starting nachtigall
Some checks failed
Flake checks / Check (pull_request) Failing after 26m30s
to avoid a race between step-ca and acme-client
2025-03-04 20:21:54 +01:00
db94060b22
flake.lock: Update
Some checks failed
Flake checks / Check (pull_request) Has been cancelled
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/15dbf8cebd8e2655a883b74547108e089f051bf0' (2025-02-18)
  → 'github:nix-community/disko/19c1140419c4f1cdf88ad4c1cfb6605597628940' (2025-02-25)
• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/32ea77a06711b758da0ad9bd6a844c5740a87abd' (2025-02-01)
  → 'github:hercules-ci/flake-parts/3876f6b87db82f33775b1ef5ea343986105db764' (2025-03-01)
• Updated input 'flake-parts/nixpkgs-lib':
    '072a6db25e.tar.gz?narHash=sha256-vJzFZGaCpnmo7I6i416HaBLpC%2BhvcURh/BQwROcGIp8%3D' (2025-02-01)
  → '6d37022434.tar.gz?narHash=sha256-3wHafybyRfpUCLoE8M%2BuPVZinImg3xX%2BNm6gEfN3G8I%3D' (2025-03-01)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/6ab392f626a19f1122d1955c401286e1b7cf6b53' (2025-02-19)
  → 'github:lnl7/nix-darwin/991bb2f6d46fc2ff7990913c173afdb0318314cb' (2025-03-04)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/36864ed72f234b9540da4cf7a0c49e351d30d3f1' (2025-02-19)
  → 'github:nixos/nixpkgs/1546c45c538633ae40b93e2d14e0bb6fd8f13347' (2025-03-02)
• Updated input 'unstable':
    'github:nixos/nixpkgs/73cf49b8ad837ade2de76f87eb53fc85ed5d4680' (2025-02-18)
  → 'github:nixos/nixpkgs/ba487dbc9d04e0634c64e3b1f0d25839a0a68246' (2025-03-03)
2025-03-04 20:02:20 +01:00
4aedc5aed8
mediawiki: allow svg, pdf file type uploads
Some checks failed
Flake checks / Check (pull_request) Failing after 17m43s
2025-03-04 19:43:48 +01:00
ba80bb98a2
mail: update admins@pub.solar password because forgejo
Some checks failed
Flake checks / Check (pull_request) Failing after 17m16s
cannot properly escape strings in 2025
2025-03-04 19:41:04 +01:00
c87cac28bc
Merge pull request 'nextcloud: update skeleton, add german version' (#297) from nextcloud-skeleton into main
Reviewed-on: #297
Reviewed-by: Akshay Mankar <axeman@noreply.git.pub.solar>
2025-02-28 12:47:00 +00:00
ca60c9fd66
tests: wait for default.target, add check for acme
Some checks failed
Flake checks / Check (pull_request) Failing after 18m32s
2025-02-28 13:46:04 +01:00
f4a2e7b165
Merge pull request 'nextcloud: make all apps declarative' (#310) from nextcloud-declarative-apps into main
Reviewed-on: #310
Reviewed-by: Akshay Mankar <axeman@noreply.git.pub.solar>
2025-02-28 12:06:33 +00:00
d519db0b0e
style: fix formatting
Some checks failed
Flake checks / Check (pull_request) Has been cancelled
2025-02-28 13:06:04 +01:00
474549fc7a
nextcloud-skeleton: en should be default
Some checks failed
Flake checks / Check (pull_request) Failing after 23s
https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#skeletondirectory
2025-02-28 13:05:01 +01:00
711cd3c1ae
nextcloud: make all apps declarative to avoid
All checks were successful
Flake checks / Check (pull_request) Successful in 18m35s
downtime caused by failing auto updates
2025-02-28 12:44:08 +01:00
b4c5a25da0
nextcloud-skeleton: remove fs.trace
Some checks failed
Flake checks / Check (pull_request) Failing after 23s
2025-02-28 12:33:39 +01:00
df4444b015
Merge branch 'main' into nextcloud-skeleton
Some checks failed
Flake checks / Check (pull_request) Failing after 49m36s
2025-02-25 13:55:09 +01:00
453e3d96d1
nextcloud: initial skeleton directory derivation
All checks were successful
Flake checks / Check (pull_request) Successful in 20m34s
for English and German
2025-02-24 22:31:55 +01:00
9b921f6c07
Merge pull request 'Update docs/nixos-anywhere.md' (#304) from hensoko-docs-nixos-anywhere into main
Reviewed-on: #304
Reviewed-by: teutat3s <teutat3s@noreply.git.pub.solar>
2025-02-24 20:54:37 +00:00
a18e1ff86c
Merge pull request 'security update for ssh, update nextcloud' (#309) from security-update-ssh into main
Reviewed-on: #309
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2025-02-20 13:17:48 +00:00
7ed692f6c2
flake.lock: Update
All checks were successful
Flake checks / Check (pull_request) Successful in 22m0s
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/fa5746ecea1772cf59b3f34c5816ab3531478142' (2025-02-15)
  → 'github:nix-community/disko/15dbf8cebd8e2655a883b74547108e089f051bf0' (2025-02-18)
• Updated input 'home-manager':
    'github:nix-community/home-manager/254d47082e23dbf72fdeca1da6fe1da420f478d8' (2025-02-14)
  → 'github:nix-community/home-manager/9d3d080aec2a35e05a15cedd281c2384767c2cfe' (2025-02-17)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/678b22642abde2ee77ae2218ab41d802f010e5b0' (2025-02-14)
  → 'github:lnl7/nix-darwin/6ab392f626a19f1122d1955c401286e1b7cf6b53' (2025-02-19)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/0b73e36b1962620a8ac551a37229dd8662dac5c8' (2025-02-13)
  → 'github:nixos/nixpkgs/36864ed72f234b9540da4cf7a0c49e351d30d3f1' (2025-02-19)
• Updated input 'unstable':
    'github:nixos/nixpkgs/2ff53fe64443980e139eaa286017f53f88336dd0' (2025-02-13)
  → 'github:nixos/nixpkgs/73cf49b8ad837ade2de76f87eb53fc85ed5d4680' (2025-02-18)
2025-02-20 12:14:01 +01:00
066b6b2bf5
Merge pull request 'nextcloud memories: add source link to comment' (#307) from nextcloud-add-comment into main
Reviewed-on: #307
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2025-02-18 15:50:55 +00:00
1483d3f1ca
style: fix trailing whitespace
Some checks failed
Flake checks / Check (pull_request) Failing after 16m49s
2025-02-17 21:59:42 +01:00
e8172a2759
nextcloud: add source link to comment
All checks were successful
Flake checks / Check (pull_request) Successful in 18m52s
2025-02-17 21:59:11 +01:00
77cf03d8f5
Merge pull request 'trinkgenossin: fix forgejo actions secret' (#306) from fix-forgejo-actions-secret into main
Reviewed-on: #306
2025-02-17 20:58:51 +00:00
7b9150ed8b
Update docs/nixos-anywhere.md
Some checks failed
Flake checks / Check (pull_request) Failing after 23s
2025-02-17 19:17:54 +00:00
4946cc7000
Update docs/nixos-anywhere.md 2025-02-17 19:17:54 +00:00
062ee013b1
Update docs/nixos-anywhere.md
Signed-off-by: hensoko <hensoko@gssws.de>
2025-02-17 19:17:54 +00:00
f4d7f61316
trinkgenossin: fix forgejo actions secret
All checks were successful
Flake checks / Check (pull_request) Successful in 18m45s
2025-02-17 19:24:24 +01:00
e016871a11
Merge pull request 'forgejo: add actions runner on trinkgenossin' (#305) from actions-runner-docker into main
Reviewed-on: #305
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2025-02-17 16:59:02 +00:00
fb6d1cd892
Merge pull request 'maintenance: update keycloak, matrix-synapse and others' (#302) from updates-15-02 into main
Reviewed-on: #302
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2025-02-17 16:57:09 +00:00
d5743d75e0
forgejo: add actions runner on trinkgenossin
Some checks failed
Flake checks / Check (pull_request) Failing after 43m15s
2025-02-17 17:52:31 +01:00
1ed0b473da
flake.lock: Update
All checks were successful
Flake checks / Check (pull_request) Successful in 21m52s
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/ff3568858c54bd306e9e1f2886f0f781df307dff' (2025-02-05)
  → 'github:nix-community/disko/fa5746ecea1772cf59b3f34c5816ab3531478142' (2025-02-15)
• Updated input 'home-manager':
    'github:nix-community/home-manager/bd65bc3cde04c16755955630b344bc9e35272c56' (2025-01-08)
  → 'github:nix-community/home-manager/254d47082e23dbf72fdeca1da6fe1da420f478d8' (2025-02-14)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/0b6f96a6b9efcfa8d3cc8023008bcbcd1b9bc1a4' (2025-02-08)
  → 'github:lnl7/nix-darwin/678b22642abde2ee77ae2218ab41d802f010e5b0' (2025-02-14)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/a45fa362d887f4d4a7157d95c28ca9ce2899b70e' (2025-02-08)
  → 'github:nixos/nixpkgs/0b73e36b1962620a8ac551a37229dd8662dac5c8' (2025-02-13)
• Updated input 'unstable':
    'github:nixos/nixpkgs/a79cfe0ebd24952b580b1cf08cd906354996d547' (2025-02-08)
  → 'github:nixos/nixpkgs/2ff53fe64443980e139eaa286017f53f88336dd0' (2025-02-13)
2025-02-15 19:51:20 +01:00
736856cea6
Merge pull request 'mediawiki: 1.42.4 -> 1.43.0' (#301) from mediawiki-1.43.0 into main
Reviewed-on: #301
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2025-02-13 17:30:50 +00:00
79ed3ff604
mediawiki: 1.42.4 -> 1.43.0
All checks were successful
Flake checks / Check (pull_request) Successful in 19m54s
2025-02-13 17:26:19 +01:00
8e4da4e16c
Merge pull request 'tests: fix website open port check' (#300) from tests-fix-website-port-check into main
Reviewed-on: #300
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2025-02-13 15:22:08 +00:00
835c7a8dde
Merge pull request 'mediawiki: set rememberme to avoid constant logout' (#299) from mediawiki-remember-password into main
Reviewed-on: #299
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2025-02-13 12:42:17 +00:00
c15bd0b180
Merge pull request 'nextcloud: add memories app + previews tuning' (#298) from nextcloud-memories into main
Reviewed-on: #298
2025-02-13 12:41:42 +00:00
a94290fb3a
tests: fix website open port check
All checks were successful
Flake checks / Check (pull_request) Successful in 17m35s
2025-02-11 18:57:28 +01:00
8707163324
nextcloud: add previewgenerator to extraApps
All checks were successful
Flake checks / Check (pull_request) Successful in 20m49s
2025-02-11 18:56:40 +01:00
cff2080d88
mediawiki: set rememberme to avoid constant logout
All checks were successful
Flake checks / Check (pull_request) Successful in 18m4s
2025-02-11 13:17:45 +01:00
fcbcbe755f
nextcloud(style): fix formatting
Some checks failed
Flake checks / Check (pull_request) Has been cancelled
2025-02-11 13:17:08 +01:00
db24ef998f
nextcloud: add memories app + previews tuning
Thanks to SuperSandro2000 for config snippets:
https://github.com/NuschtOS/nixos-modules/blob/main/modules/nextcloud.nix
2025-02-11 13:15:30 +01:00
c8d82dd827
nextcloud: fix skeleton diretory, add language placeholder
All checks were successful
Flake checks / Check (pull_request) Successful in 19m2s
2025-02-11 13:14:25 +01:00
bf011e79e7
nextcloud: add german version for skeleton files 2025-02-11 13:13:29 +01:00
18819eb405
nextcloud: update skeleton files, use logo with dot,
add useful links to Readme and Example ODT.

Note that currently these skeleton files have to be manually uploaded to
/var/lib/nextcloud/skeleton on nachtigall.
2025-02-11 12:27:41 +01:00
aa93a22577
Merge pull request 'security: update forgejo and keycloak' (#296) from forgejo-security-update into main
Reviewed-on: #296
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2025-02-10 18:17:01 +00:00
727dc8a455
flake.lock: Update
All checks were successful
Flake checks / Check (pull_request) Successful in 23m29s
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/18d0a984cc2bc82cf61df19523a34ad463aa7f54' (2025-01-29)
  → 'github:nix-community/disko/ff3568858c54bd306e9e1f2886f0f781df307dff' (2025-02-05)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/49b807fa7c37568d7fbe2aeaafb9255c185412f9' (2025-01-30)
  → 'github:lnl7/nix-darwin/0b6f96a6b9efcfa8d3cc8023008bcbcd1b9bc1a4' (2025-02-08)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/fecfeb86328381268e29e998ddd3ebc70bbd7f7c' (2025-02-03)
  → 'github:nixos/nixpkgs/a45fa362d887f4d4a7157d95c28ca9ce2899b70e' (2025-02-08)
2025-02-10 18:26:25 +01:00
e50f845bec
Merge pull request 'matrix-authentication-service: use 0.13.0 from nixos-unstable' (#294) from mas-unstable into main
Reviewed-on: #294
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2025-02-09 18:28:47 +00:00
f69fe224ec
Merge pull request 'backups/matrix: add DB dump for matrix-authentication-service' (#293) from mas-backups into main
Reviewed-on: #293
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2025-02-09 18:28:33 +00:00
fd111da14c
Merge pull request 'tankstelle: enable ksm kernel same-page merging' (#292) from tankstelle-enable-ksm into main
Reviewed-on: #292
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2025-02-09 18:09:25 +00:00
5c25ed45c4
Merge pull request 'element-web: enable Element Call by default' (#275) from element-call into main
Reviewed-on: #275
Reviewed-by: Akshay Mankar <axeman@noreply.git.pub.solar>
2025-02-09 18:09:14 +00:00
c03f0c5a2a
Merge pull request 'nextcloud: add recognize app' (#285) from nextcloud-recognize-app into main
Reviewed-on: #285
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2025-02-09 17:59:08 +00:00
da78d2ac23
Merge pull request 'docs/matrix-suspend-account.md: init' (#289) from docs into main
Reviewed-on: #289
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2025-02-09 17:58:17 +00:00
6b6e2d9f6e
matrix-authentication-service: use 0.13.0 from nixos-unstable
Some checks failed
Flake checks / Check (pull_request) Failing after 16m28s
2025-02-09 18:50:35 +01:00
665f8f76de
tankstelle: enable ksm kernel same-page merging
All checks were successful
Flake checks / Check (pull_request) Successful in 20m11s
for potentially lower memory usage
2025-02-07 11:19:46 -03:00
834982f909
backups/matrix: add DB dump of matrix-authentication-service
Some checks failed
Flake checks / Check (pull_request) Has been cancelled
2025-02-07 11:18:26 -03:00
1b8202271d
docs/matrix-suspend-account.md: init
All checks were successful
Flake checks / Check (pull_request) Successful in 19m28s
2025-02-07 11:05:54 -03:00
b950eb79d5
docs/deletion-request.md: update steps for mastodon 2025-02-07 11:05:54 -03:00
4c6911ea6f
overlays: remove unused inputs + rec,
All checks were successful
Flake checks / Check (pull_request) Successful in 14m18s
flake: remove unused master input
2025-02-07 11:03:39 -03:00
c6cbe941c4
nextcloud: add recognize app
based on PR: https://github.com/NixOS/nixpkgs/pull/333545
2025-02-07 11:03:38 -03:00
f0630d0467
Merge pull request 'matrix-authentication-service: early update to 0.13.0' (#291) from update-mas-0.13.0 into main
Reviewed-on: #291
Reviewed-by: Akshay Mankar <axeman@noreply.git.pub.solar>
2025-02-07 13:25:40 +00:00
82f42e8947
ci: use nix-fast-build to build checks
All checks were successful
Flake checks / Check (pull_request) Successful in 18m48s
ci: tests/keycloak: bump cores to 16, memory to 16384
2025-02-06 15:20:24 -03:00
f402be32d4
matrix-authentication-service: early update to 0.13.0
Some checks failed
Flake checks / Check (pull_request) Has been cancelled
https://github.com/NixOS/nixpkgs/pull/374272
2025-02-06 09:58:45 -03:00
bcb454833b
Merge pull request 'maintenance: update matrix-synapse, element-web, mediawiki, bind security update' (#290) from update-2025-02 into main
Reviewed-on: #290
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2025-02-04 17:12:19 +00:00
67c30deb39
flake.lock: Update
Some checks failed
Flake checks / Check (pull_request) Failing after 22m53s
Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/b905f6fc23a9051a6e1b741e1438dbfc0634c6de' (2025-01-06)
  → 'github:hercules-ci/flake-parts/32ea77a06711b758da0ad9bd6a844c5740a87abd' (2025-02-01)
• Updated input 'flake-parts/nixpkgs-lib':
    'e9b5173191.tar.gz?narHash=sha256-CewEm1o2eVAnoqb6Ml%2BQi9Gg/EfNAxbRx1lANGVyoLI%3D' (2025-01-01)
  → '072a6db25e.tar.gz?narHash=sha256-vJzFZGaCpnmo7I6i416HaBLpC%2BhvcURh/BQwROcGIp8%3D' (2025-02-01)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/666e1b3f09c267afd66addebe80fb05a5ef2b554' (2025-01-30)
  → 'github:nixos/nixpkgs/fecfeb86328381268e29e998ddd3ebc70bbd7f7c' (2025-02-03)
• Updated input 'unstable':
    'github:nixos/nixpkgs/9d3ae807ebd2981d593cddd0080856873139aa40' (2025-01-29)
  → 'github:nixos/nixpkgs/c6e957d81b96751a3d5967a0fd73694f303cc914' (2025-02-03)
2025-02-04 09:09:21 -03:00
c15157ca8f
mediawiki: update to v1.42.4
Some checks failed
Flake checks / Check (pull_request) Failing after 33m2s
2025-02-01 16:52:42 -03:00
1fbdb9c939
flake.lock: Update
Some checks failed
Flake checks / Check (pull_request) Failing after 43m6s
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/bf0abfde48f469c256f2b0f481c6281ff04a5db2' (2025-01-16)
  → 'github:nix-community/disko/18d0a984cc2bc82cf61df19523a34ad463aa7f54' (2025-01-29)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/62ba0a22426721c94e08f0779ed8235d5672869b' (2025-01-26)
  → 'github:lnl7/nix-darwin/49b807fa7c37568d7fbe2aeaafb9255c185412f9' (2025-01-30)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/4e96537f163fad24ed9eb317798a79afc85b51b7' (2025-01-26)
  → 'github:nixos/nixpkgs/666e1b3f09c267afd66addebe80fb05a5ef2b554' (2025-01-30)
• Updated input 'unstable':
    'github:nixos/nixpkgs/852ff1d9e153d8875a83602e03fdef8a63f0ecf8' (2025-01-26)
  → 'github:nixos/nixpkgs/9d3ae807ebd2981d593cddd0080856873139aa40' (2025-01-29)
2025-02-01 16:28:28 -03:00
6c0d41024e
Merge pull request 'keycloak/delete-unverified-accounts.md: Delete temp files in the end' (#288) from keycloak-temp-file-del into main
Reviewed-on: #288
Reviewed-by: teutat3s <teutat3s@noreply.git.pub.solar>
2025-02-01 12:56:58 +00:00
253eb7ce4a
Merge pull request 'update to NixOS 24.11' (#278) from nixos-24.11 into main
Reviewed-on: #278
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
Reviewed-by: Akshay Mankar <axeman@noreply.git.pub.solar>
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2025-02-01 00:22:25 +00:00
6e303fabb8
keycloak/delete-unverified-accounts.md: Delete temp files in the end
All checks were successful
Flake checks / Check (pull_request) Successful in 44m7s
2025-01-31 16:41:19 +01:00
c3e61363aa
flake: update to NixOS 24.11
Some checks failed
Flake checks / Check (pull_request) Failing after 39m21s
- fixed our keycloak theme with keycloak 26.1.0 in pub-solar/keycloak-theme#5

- fixed broken NixOS matrix-appservice-irc module in https://github.com/NixOS/nixpkgs/pull/375533

Fix warnings:
trace: evaluation warning: The option `services.forgejo.mailerPasswordFile' defined in `/nix/store/13vqhb5askjgi07wqwxawq4bdm7h0wc7-source/flake.nix, via option flake.nixosModules.forgejo' has been renamed to `services.forgejo.secrets.mailer.PASSWD'.
trace: evaluation warning: Using `services.nextcloud.config.dbtableprefix` is deprecated. Fresh installations with this option set are not allowed anymore since v20. If you have an existing installation with a custom table prefix, make sure it is set correctly in `config.php` and remove the option from your NixOS config.

Fix errors:
- The option definition `services.matrix-sliding-sync' in `/nix/store/wgxgv8rjbd2nhf7y28kfzm4n6kz85dnq-source/flake.nix, via option flake.nixosModules.matrix' no longer has any effect; please remove it.
The matrix-sliding-sync package has been removed, since matrix-synapse incorporated its functionality

- The option `services.keycloak.settings.proxy' has been removed. Set `services.keycloak.settings.proxy-headers` in combination with other hostname options as needed instead.
See [Proxy option removed](https://www.keycloak.org/docs/latest/upgrading/index.html#proxy-option-removed) for more information.

error: The option `services.matrix-appservice-irc.settings.ircService.mediaProxy.publicUrl' was accessed but has no value defined. Try setting the option.
2025-01-27 18:13:30 -03:00
64c2a41fc5
Merge pull request 'admins: add host biolimo for @b12f' (#287) from b12f/biolimo into main
Reviewed-on: #287
Reviewed-by: teutat3s <teutat3s@noreply.git.pub.solar>
2025-01-06 17:46:40 +00:00
fcd48af91b
admins: add host biolimo for @b12f
All checks were successful
Flake checks / Check (pull_request) Successful in 27m6s
2024-12-27 00:25:09 +01:00
0475cfdd6a
Merge pull request 'tests/keycloak: try to reduce flakyness' (#284) from fix-keycloak-test into main
Reviewed-on: #284
Reviewed-by: Akshay Mankar <axeman@noreply.git.pub.solar>
2024-12-18 19:28:38 +00:00
23b81b310a
tests: try to reduce flakyness
All checks were successful
Flake checks / Check (pull_request) Successful in 41m3s
2024-12-18 11:47:12 -03:00
475af2f82f
Merge pull request 'maintenance: update forgejo, matrix-synapse, nextcloud and linux kernel' (#283) from maintenance-updates into main
Reviewed-on: #283
2024-12-17 20:48:23 +00:00
197ba721fe
flake.lock: Update
Some checks failed
Flake checks / Check (pull_request) Has been cancelled
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/785c1e02c7e465375df971949b8dcbde9ec362e5' (2024-12-02)
  → 'github:nix-community/disko/a08bfe06b39e94eec98dd089a2c1b18af01fef19' (2024-12-16)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/7109b680d161993918b0a126f38bc39763e5a709' (2024-12-09)
  → 'github:nixos/nixpkgs/bcba2fbf6963bf6bed3a749f9f4cf5bff4adb96d' (2024-12-14)
• Updated input 'unstable':
    'github:nixos/nixpkgs/a73246e2eef4c6ed172979932bc80e1404ba2d56' (2024-12-09)
  → 'github:nixos/nixpkgs/3566ab7246670a43abd2ffa913cc62dad9cdf7d5' (2024-12-13)
2024-12-16 19:01:08 +01:00
642b35fb06
Merge pull request 'logins: add chocolatebar for b12f' (#282) from b12f/wg-chocolatebar into main
Reviewed-on: #282
Reviewed-by: teutat3s <teutat3s@noreply.git.pub.solar>
2024-12-12 16:42:31 +00:00
d5bbe3d0f5
logins: add chocolatebar for b12f
All checks were successful
Flake checks / Check (pull_request) Successful in 31m51s
2024-12-12 16:41:50 +00:00
161ec7a7d1
Merge pull request 'update element-web' (#281) from update-element into main
Reviewed-on: #281
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-12-10 11:13:20 +00:00
4e1678b1d1
Merge pull request 'bash: ignore leading space + duplicates in history' (#280) from bash-ignore-space into main
Reviewed-on: #280
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-12-10 11:07:55 +00:00
6acc3f7927
flake.lock: Update
All checks were successful
Flake checks / Check (pull_request) Successful in 31m43s
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/190c31a89e5eec80dd6604d7f9e5af3802a58a13' (2024-12-05)
  → 'github:nixos/nixpkgs/7109b680d161993918b0a126f38bc39763e5a709' (2024-12-09)
• Updated input 'unstable':
    'github:nixos/nixpkgs/22c3f2cf41a0e70184334a958e6b124fb0ce3e01' (2024-12-07)
  → 'github:nixos/nixpkgs/a73246e2eef4c6ed172979932bc80e1404ba2d56' (2024-12-09)
2024-12-10 11:33:17 +01:00
386f2b2ba5
bash: ignore leading space + duplicates in history
All checks were successful
Flake checks / Check (pull_request) Successful in 28m23s
2024-12-09 18:49:58 +01:00
6645e10afa
Merge pull request 'security update for synapse, updates for element-web, mastodon' (#279) from security-updates into main
Reviewed-on: #279
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-12-08 20:08:08 +00:00
eef268b21b
style: fix formatting
All checks were successful
Flake checks / Check (pull_request) Successful in 41m25s
2024-12-08 18:59:27 +01:00
5192f382bc
flake.lock: Update
Some checks failed
Flake checks / Check (pull_request) Failing after 27s
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/639d1520df9417ca2761536c3072688569e83c80' (2024-11-18)
  → 'github:nix-community/disko/785c1e02c7e465375df971949b8dcbde9ec362e5' (2024-12-02)
• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/506278e768c2a08bec68eb62932193e341f55c90' (2024-11-01)
  → 'github:hercules-ci/flake-parts/205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9' (2024-12-04)
• Updated input 'flake-parts/nixpkgs-lib':
    'cc2f280002.tar.gz?narHash=sha256-lXvH/vOfb4aGYyvFmZK/HlsNsr/0CVWlwYvo2rxJk3s%3D' (2024-11-01)
  → '5487e69da4.tar.gz?narHash=sha256-1qRH7uAUsyQI7R1Uwl4T%2BXvdNv778H0Nb5njNrqvylY%3D' (2024-12-01)
• Updated input 'maunium-stickerpicker':
    'github:maunium/stickerpicker/333567f481e60443360aa7199d481e1a45b3a523?dir=web' (2024-06-19)
  → 'github:maunium/stickerpicker/89d3aece041c85ebe5a1ad4e620388af5227cbb0?dir=web' (2024-12-02)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/61cee20168a3ebb71a9efd70a55adebaadfbe4d4' (2024-11-19)
  → 'github:lnl7/nix-darwin/a35b08d09efda83625bef267eb24347b446c80b8' (2024-12-07)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/e8c38b73aeb218e27163376a2d617e61a2ad9b59' (2024-11-16)
  → 'github:nixos/nixpkgs/190c31a89e5eec80dd6604d7f9e5af3802a58a13' (2024-12-05)
• Updated input 'unstable':
    'github:nixos/nixpkgs/5e4fbfb6b3de1aa2872b76d49fafc942626e2add' (2024-11-15)
  → 'github:nixos/nixpkgs/22c3f2cf41a0e70184334a958e6b124fb0ce3e01' (2024-12-07)
2024-12-08 18:29:10 +01:00
3e32bfe106
Merge pull request 'auth: add user for each administrator' (#261) from per-admin-user into main
Reviewed-on: #261
Reviewed-by: teutat3s <teutat3s@noreply.git.pub.solar>
Reviewed-by: Akshay Mankar <axeman@noreply.git.pub.solar>
2024-11-28 16:16:35 +00:00
aee317b463
flake: format
Some checks failed
Flake checks / Check (pull_request) Failing after 46m45s
2024-11-26 17:58:30 +01:00
98b546f587
docs: update for per admin user SSH access 2024-11-26 17:58:26 +01:00
42b3052091
deploy: remove hard-coded SSH user barkeeper 2024-11-26 17:56:15 +01:00
b4cfdd1c48
element-web: enable Element Call by default
All checks were successful
Flake checks / Check (pull_request) Successful in 24m3s
2024-11-21 11:15:09 +01:00
6a0b9e7e88
Merge pull request 'matrix: Enable MSC4108 to allow signing in with QR Code' (#274) from matrix-rendezvous-server-attempt-2 into main
Reviewed-on: #274
Reviewed-by: teutat3s <teutat3s@noreply.git.pub.solar>
2024-11-21 09:44:58 +00:00
90c8072f92
matrix: remove long-gone dimension from well-known
All checks were successful
Flake checks / Check (pull_request) Successful in 24m49s
2024-11-21 09:15:10 +01:00
5076266842
matrix: Enable MSC4108 to allow Signing in with QR Code
Enable MSC3266 room summary API to enable room previews

Co-authored-by: teutat3s <teutates@mailbox.org>
2024-11-21 09:14:17 +01:00
eb63779bb6
auth: use all sshPubKeys for disk unlock, fix tests, fix hm config
All checks were successful
Flake checks / Check (pull_request) Successful in 28m11s
2024-11-20 16:49:39 +01:00
acc537decd
hosts: use correct wireguardDevices option 2024-11-20 16:49:39 +01:00
2b72d9a5a8
style: run nix fmt 2024-11-20 16:49:39 +01:00
5366d07d44
auth: add user for each administrator
After this has been tested successfully, root SSH login can be disabled.

The advantages of having a user for each adminstrator:

* Better security analysis: who issued executed what command, who
  touched which file, who used sudo at which time.
* Possibility of granular access, e.g. person X is only allowed to
  manage service Y
2024-11-20 16:49:38 +01:00
10f71b1959
Merge pull request 'maintenance: update element-web, forgejo, nextcloud, matrix-synapse and others' (#269) from flake-updates into main
Reviewed-on: #269
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2024-11-19 16:10:57 +00:00
8b8833e9c9
flake.lock: Update
Some checks failed
Flake checks / Check (pull_request) Has been cancelled
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/486250f404f4a4f4f33f8f669d83ca5f6e6b7dfc' (2024-11-10)
  → 'github:nix-community/disko/639d1520df9417ca2761536c3072688569e83c80' (2024-11-18)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/5c74ab862c8070cbf6400128a1b56abb213656da' (2024-11-09)
  → 'github:lnl7/nix-darwin/61cee20168a3ebb71a9efd70a55adebaadfbe4d4' (2024-11-19)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/9256f7c71a195ebe7a218043d9f93390d49e6884' (2024-11-10)
  → 'github:nixos/nixpkgs/e8c38b73aeb218e27163376a2d617e61a2ad9b59' (2024-11-16)
• Updated input 'unstable':
    'github:nixos/nixpkgs/76612b17c0ce71689921ca12d9ffdc9c23ce40b2' (2024-11-09)
  → 'github:nixos/nixpkgs/5e4fbfb6b3de1aa2872b76d49fafc942626e2add' (2024-11-15)
2024-11-19 16:30:13 +01:00
280dc37aa0
Merge pull request 'matrix-authentication-service: disable changing mail address' (#271) from matrix-mas-disable-email-change into main
Reviewed-on: #271
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2024-11-19 15:29:15 +00:00
3d8fe3cef2
Merge pull request 'prometheus: disable daily e2e notification again' (#270) from alert-disable-e2e into main
Reviewed-on: #270
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2024-11-19 15:29:04 +00:00
213c06ca87
matrix-authentication-service: disable changing mail
All checks were successful
Flake checks / Check (pull_request) Successful in 22m45s
address. This should be done via auth.pub.solar
2024-11-19 13:57:23 +01:00
a491680165
prometheus: disable daily e2e notification again
All checks were successful
Flake checks / Check (pull_request) Successful in 27m35s
2024-11-19 13:56:42 +01:00
1ae1f68ce2
Merge pull request 'modules/forgejo: allow migrations from local networks' (#262) from forgejo/allow-local-migrations into main
Reviewed-on: #262
Reviewed-by: teutat3s <teutat3s@noreply.git.pub.solar>
2024-11-14 11:10:44 +00:00
87f9bc92df
modules/forgejo: allow migrations from local networks 2024-11-14 11:10:44 +00:00
3b29b847b0
Merge pull request 'coturn: fix secret path' (#265) from fix-coturn-secret into main
Reviewed-on: #265
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2024-11-13 20:39:47 +00:00
4923f033f5
coturn: fix secret path
Some checks are pending
Flake checks / Check (pull_request) Waiting to run
this is fallout that was overlooked in #250
2024-11-13 21:25:12 +01:00
2424a3ec8b
Merge pull request 'keycloak: fix registration with pub.solar theme' (#264) from fix-keycloak-theme-for-registration into main
Reviewed-on: #264
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2024-11-13 19:48:15 +00:00
b41edf0cfb
Merge pull request 'core: add activationScript to show closure diff' (#260) from closure-diffs into main
Reviewed-on: #260
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2024-11-13 19:47:17 +00:00
0d6da8d678
Merge pull request 'maintenance: updates for element-web, forgejo, matrix-synapse and others' (#259) from flake-updates into main
Reviewed-on: #259
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2024-11-13 19:47:05 +00:00
b87670d07d
keycloak: fix registration with pub.solar theme
Some checks failed
Flake checks / Check (pull_request) Failing after 56m37s
This pulls in changes from
* pub-solar/keycloak-theme#3
* pub-solar/keycloak-theme#4
2024-11-13 20:34:38 +01:00
73333537a5
Merge pull request 'alertmanager: alert on high load only after 20m' (#255) from alerts-tweak-load into main
Reviewed-on: #255
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2024-11-12 14:47:53 +00:00
45d3b939bf
Merge pull request 'matrix-appservice-irc: reduce logging level to warn' (#256) from irc-reduce-logging into main
Reviewed-on: #256
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2024-11-12 14:47:44 +00:00
904c7ed1e4
Merge pull request 'secrets: remove leftover secret files' (#257) from secrets-cleanup into main
Reviewed-on: #257
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2024-11-12 14:47:35 +00:00
ab85ba751a
alertmanager: enable e2e_dead_man_switch
All checks were successful
Flake checks / Check (pull_request) Successful in 23m13s
2024-11-12 13:41:42 +01:00
a9c5edfeb3
alertmanager: don't alert on high memory page faults
This alert is non actionable, we still monitor high memory usage.
2024-11-12 13:40:46 +01:00
7067d93ee2
flake.lock: Update
All checks were successful
Flake checks / Check (pull_request) Successful in 40m40s
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/09a776702b004fdf9c41a024e1299d575ee18a7d' (2024-10-23)
  → 'github:nix-community/disko/486250f404f4a4f4f33f8f669d83ca5f6e6b7dfc' (2024-11-10)
• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/3d04084d54bedc3d6b8b736c70ef449225c361b1' (2024-10-01)
  → 'github:hercules-ci/flake-parts/506278e768c2a08bec68eb62932193e341f55c90' (2024-11-01)
• Updated input 'flake-parts/nixpkgs-lib':
    'fb192fec7c.tar.gz?narHash=sha256-0xHYkMkeLVQAMa7gvkddbPqpxph%2BhDzdu1XdGPJR%2BOs%3D' (2024-10-01)
  → 'cc2f280002.tar.gz?narHash=sha256-lXvH/vOfb4aGYyvFmZK/HlsNsr/0CVWlwYvo2rxJk3s%3D' (2024-11-01)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/04193f188e4144d7047f83ad1de81d6034d175cd' (2024-10-24)
  → 'github:lnl7/nix-darwin/5c74ab862c8070cbf6400128a1b56abb213656da' (2024-11-09)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/89172919243df199fe237ba0f776c3e3e3d72367' (2024-10-20)
  → 'github:nixos/nixpkgs/9256f7c71a195ebe7a218043d9f93390d49e6884' (2024-11-10)
• Updated input 'unstable':
    'github:nixos/nixpkgs/2768c7d042a37de65bb1b5b3268fc987e534c49d' (2024-10-23)
  → 'github:nixos/nixpkgs/76612b17c0ce71689921ca12d9ffdc9c23ce40b2' (2024-11-09)
2024-11-11 20:05:12 +01:00
e48fe612e2
core: add activationScript to show closure diff
All checks were successful
Flake checks / Check (pull_request) Successful in 23m35s
This is useful when updating a host, by doing a dry-run with deploy-rs
we get a list of changed package versions.
2024-11-11 18:02:47 +01:00
34ce43a5e0
secrets: remove leftover secret files
Some checks failed
Flake checks / Check (pull_request) Has been cancelled
After cleanup:
❯ find ./secrets -type f -name "*.age" | wc -l
64

❯ rg publicKeys secrets/secrets.nix  | wc -l
64
2024-11-07 12:22:27 +01:00
43b0c8d489
matrix-appservice-irc: reduce logging level to warn
All checks were successful
Flake checks / Check (pull_request) Successful in 22m38s
2024-11-06 21:29:27 +01:00
afe52ca6af
alertmanager: alert on high load only after 20m
All checks were successful
Flake checks / Check (pull_request) Successful in 2m8s
2024-11-06 21:28:28 +01:00
da529b023e
Merge pull request 'ci: use treefmt2 with flag --ci' (#248) from ci-treefmt into main
Reviewed-on: #248
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2024-11-06 14:40:03 +00:00
cf39137340
Merge pull request 'docs: more garage CLI usage, avoid leaking secret' (#246) from docs-garage into main
Reviewed-on: #246
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2024-11-06 14:39:53 +00:00
18683d383f
Merge pull request 'docs: add examples for cachix usage' (#230) from docs-cachix into main
Reviewed-on: #230
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2024-11-06 14:39:44 +00:00
d8a793190d
Merge pull request 'matrix-authentication-service: init, test, migrate synapse' (#250) from mas-init into main
Reviewed-on: #250
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-10-30 20:02:53 +00:00
3ec5c9f343
style: fix formatting
All checks were successful
Flake checks / Check (pull_request) Successful in 22m4s
2024-10-30 20:32:47 +01:00
7ba5a7bdd6
matrix: disable sliding-sync proxy, it's built into
Some checks failed
Flake checks / Check (pull_request) Failing after 22s
synapse now, update synapse config to use matrix-authentication-service
2024-10-30 20:31:29 +01:00
041d311bb2
modules/matrix: rename used config options
Some checks failed
Flake checks / Check (pull_request) Failing after 23s
2024-10-30 18:37:47 +01:00
9d9bcf9a15
mas: move to module, add secrets for prod 2024-10-30 18:37:46 +01:00
4434a90136
modules/matrix: rename secrets to not include hostnames 2024-10-30 18:37:46 +01:00
472f9aa68b
dns: list.pub.solar should be A / AAAA records 2024-10-30 18:37:46 +01:00
c9c2d06a98
dns: add CNAME record for mas.pub.solar 2024-10-30 18:37:46 +01:00
8244e605b6
fix: passkey support in pub.solar keycloak theme 2024-10-30 18:37:46 +01:00
9d7d251369
style: fix formatting 2024-10-30 18:37:46 +01:00
7775ad332e
matrix: do not change paths for nachtigall secrets 2024-10-30 18:37:46 +01:00
d6cc9c8164
matrix-authentication-service: init host underground
to test mas, related to #242
2024-10-30 18:37:45 +01:00
4c51eda8b6
Merge pull request 'modules/tt-rss: pin on revision' (#253) from update-tt-rss into main
Reviewed-on: #253
Reviewed-by: teutat3s <teutat3s@noreply.git.pub.solar>
2024-10-30 17:37:10 +00:00
471d7650ff
modules/tt-rss: pin on revision
All checks were successful
Flake checks / Check (pull_request) Successful in 21m25s
2024-10-30 18:35:18 +01:00
9cc50ed678
Merge pull request 'maintenance: updates for mastodon, matrix-synapse' (#249) from flake-updates-2024-10-24 into main
Reviewed-on: #249
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2024-10-24 16:16:06 +00:00
4309cc9cdd
ci: use treefmt2 with flag --ci
All checks were successful
Flake checks / Check (pull_request) Successful in 2m7s
Update treefmt to version 2.

This adds the following flags for CI usage:
"--no-cache, --fail-on-change and adjusting some other settings best suited to a CI".
See: https://treefmt.com/usage
2024-10-24 15:43:00 +02:00
08f5c5ce67
docs: more garage CLI usage, avoid leaking secret
All checks were successful
Flake checks / Check (pull_request) Successful in 2m3s
2024-10-24 15:10:44 +02:00
870e81ee4c
flake.lock: Update
All checks were successful
Flake checks / Check (pull_request) Successful in 25m54s
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/d7d57edb72e54891fa67a6f058a46b2bb405663b' (2024-10-16)
  → 'github:nix-community/disko/09a776702b004fdf9c41a024e1299d575ee18a7d' (2024-10-23)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/a60ac02f9466f85f092e576fd8364dfc4406b5a6' (2024-10-14)
  → 'github:lnl7/nix-darwin/04193f188e4144d7047f83ad1de81d6034d175cd' (2024-10-24)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/dc2e0028d274394f73653c7c90cc63edbb696be1' (2024-10-16)
  → 'github:nixos/nixpkgs/89172919243df199fe237ba0f776c3e3e3d72367' (2024-10-20)
• Updated input 'unstable':
    'github:nixos/nixpkgs/a3c0b3b21515f74fd2665903d4ce6bc4dc81c77c' (2024-10-14)
  → 'github:nixos/nixpkgs/2768c7d042a37de65bb1b5b3268fc987e534c49d' (2024-10-23)
2024-10-24 14:53:39 +02:00
cef7a561f3
Merge pull request 'garage: fix wildcard DNS cert renewal with wildcard CNAME records' (#245) from fix-dns-cert-renewal into main
Reviewed-on: #245
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2024-10-24 12:51:41 +00:00
281701b7b6
Merge pull request 'docs: fix IP for keycloak admin API' (#247) from update-docs into main
Reviewed-on: #247
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2024-10-24 12:51:31 +00:00
90bbaad7b7
Merge pull request 'trinkgenossin: fix network in initrd' (#244) from trinkgenossin-remote-luks into main
Reviewed-on: #244
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2024-10-24 12:51:18 +00:00
6a15c09509
docs: add hint how to get CACHIX_AUTH_TOKEN
All checks were successful
Flake checks / Check (pull_request) Successful in 21m8s
2024-10-23 20:59:07 +02:00
94d7db1331
docs: add examples for cachix usage 2024-10-23 20:59:06 +02:00
633f0a4402
docs: fix IP for keycloak admin API
All checks were successful
Flake checks / Check (pull_request) Successful in 20m57s
2024-10-23 20:28:55 +02:00
9758aeda5d
garage: fix wildcard DNS cert renewal with wildcard
All checks were successful
Flake checks / Check (pull_request) Successful in 20m13s
CNAME records

By usind wildcard CNAME records, we make lego think it needs to validate
challenges using these CNAME records. We actually want regular
_acme-challenge.* records, so use a environment variable to avoid CNAME
detection. This fixes DNS cert renewal. Still curious? See:
https://letsencrypt.org/2019/10/09/onboarding-your-customers-with-lets-encrypt-and-acme/
2024-10-23 20:18:57 +02:00
2c29d27ce7
style: remove redundant brackets
All checks were successful
Flake checks / Check (pull_request) Successful in 21m41s
2024-10-23 20:18:03 +02:00
31a885926b
trinkgenossin: fix network in initrd, virtio_net
kernel module was missing. Also this is a QEMU host, hyperV is not
required.
2024-10-23 20:17:32 +02:00
0ae6bc637b
Merge pull request 'mastodon: host media files on pub.solar garage cluster' (#239) from mastodon-media-on-garage into main
Reviewed-on: #239
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2024-10-23 15:24:28 +00:00
5300f381b0
nginx: use safer request_uri variable
All checks were successful
Flake checks / Check (pull_request) Successful in 21m30s
Fix >> Problem: [http_splitting] Possible HTTP-Splitting vulnerability.
https://github.com/yandex/gixy/blob/master/docs/en/plugins/httpsplitting.md
2024-10-17 21:15:57 +02:00
8a18ee452b
garage: fix s3_api root_domain 2024-10-17 21:15:57 +02:00
666de2c8f4
mastodon: switch files.pub.solar from storj to garage
s3 backend
2024-10-17 21:15:55 +02:00
b1391521b9
Merge pull request 'maintenance: update element-web, keycloak, mastodon, nextcloud' (#240) from flake-updates into main
Reviewed-on: #240
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2024-10-17 19:12:37 +00:00
987c0919ca
style: fix formatting
All checks were successful
Flake checks / Check (pull_request) Successful in 27m37s
2024-10-17 20:31:47 +02:00
c39cf9c0b9
mastodon: update to version 4.3.0 from nixos-unstable
https://github.com/mastodon/mastodon/releases/tag/v4.3.0
https://github.com/NixOS/nixpkgs/pull/337545/files
2024-10-17 20:31:47 +02:00
3943f34c92
flake.lock: Update
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/48ebb577855fb2398653f033b3b2208a9249203d' (2024-10-05)
  → 'github:nix-community/disko/d7d57edb72e54891fa67a6f058a46b2bb405663b' (2024-10-16)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/8c8388ade72e58efdeae71b4cbb79e872c23a56b' (2024-10-03)
  → 'github:lnl7/nix-darwin/a60ac02f9466f85f092e576fd8364dfc4406b5a6' (2024-10-14)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/6e6b3dd395c3b1eb9be9f2d096383a8d05add030' (2024-10-04)
  → 'github:nixos/nixpkgs/dc2e0028d274394f73653c7c90cc63edbb696be1' (2024-10-16)
• Updated input 'unstable':
    'github:nixos/nixpkgs/bc947f541ae55e999ffdb4013441347d83b00feb' (2024-10-04)
  → 'github:nixos/nixpkgs/a3c0b3b21515f74fd2665903d4ce6bc4dc81c77c' (2024-10-14)
2024-10-17 20:31:17 +02:00
e85807a29b
Merge pull request 'nextcloud: docs how to get debug logs' (#238) from nextcloud-fix-logs into main
Reviewed-on: #238
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-10-16 15:29:26 +00:00
c53d48384a
nextcloud: document how to get debugging logs
Some checks failed
Flake checks / Check (pull_request) Has been cancelled
2024-10-16 17:19:49 +02:00
9579f6adde
Merge pull request 'logins: add teutat3s secondary SSH public key' (#237) from teutat3s-add-ssh into main
Reviewed-on: #237
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2024-10-08 22:09:53 +00:00
01ca3b21c2
Merge pull request 'mastodon: actually use opensearch via module option' (#236) from mastodon-full-text-search into main
Reviewed-on: #236
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
2024-10-08 21:03:39 +00:00
d085e49925
logins: add teutat3s secondary SSH public key
Some checks failed
Flake checks / Check (pull_request) Failing after 6m51s
2024-10-08 19:10:20 +02:00
092a45e3bd
mastodon: actually use opensearch via module option
All checks were successful
Flake checks / Check (pull_request) Successful in 19m43s
2024-10-08 19:09:17 +02:00
a8d865bbca
Merge pull request 'maintenance updates for element-web, forgejo, mastodon, matrix-synapse, nextcloud and others' (#235) from flake-updates into main
Reviewed-on: #235
Reviewed-by: hensoko <hensoko@noreply.git.pub.solar>
Reviewed-by: Akshay Mankar <axeman@noreply.git.pub.solar>
2024-10-05 12:30:07 +00:00
df2f0d4442
flake: refactor, bye srid
All checks were successful
Flake checks / Check (pull_request) Successful in 24m21s
Refactor flake to work without nixos-flake and use native NixOS module
system. This is because of recent changes to nixos-flake, like renaming it
to nixos-unified and changing the API without a changelog or guide how
to update.
2024-10-05 14:03:40 +02:00
8c8a757f8f
garage: update to 1.0.1
https://git.deuxfleurs.fr/Deuxfleurs/garage/releases/tag/v1.0.1
2024-10-05 13:03:40 +02:00
8600fc64c5
wireguard: fix trinkgenossin IPv4 address 2024-10-05 13:03:40 +02:00
37f210c96f
security: add libolm to permittedInsecurePackages 2024-10-05 13:03:40 +02:00
d675fd8d00
flake.lock: Update
Flake lock file updates:

• Updated input 'deploy-rs':
    'github:serokell/deploy-rs/3867348fa92bc892eba5d9ddb2d7a97b9e127a8a' (2024-06-12)
  → 'github:serokell/deploy-rs/aa07eb05537d4cd025e2310397a6adcedfe72c76' (2024-09-27)
• Updated input 'disko':
    'github:nix-community/disko/435737144be0259559ca3b43f7d72252b1fdcc1b' (2024-08-22)
  → 'github:nix-community/disko/48ebb577855fb2398653f033b3b2208a9249203d' (2024-10-05)
• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/8471fe90ad337a8074e957b69ca4d0089218391d' (2024-08-01)
  → 'github:hercules-ci/flake-parts/3d04084d54bedc3d6b8b736c70ef449225c361b1' (2024-10-01)
• Updated input 'flake-parts/nixpkgs-lib':
    'a5d394176e.tar.gz?narHash=sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q%3D' (2024-08-01)
  → 'fb192fec7c.tar.gz?narHash=sha256-0xHYkMkeLVQAMa7gvkddbPqpxph%2BhDzdu1XdGPJR%2BOs%3D' (2024-10-01)
• Updated input 'home-manager':
    'github:nix-community/home-manager/e1391fb22e18a36f57e6999c7a9f966dc80ac073' (2024-07-03)
  → 'github:nix-community/home-manager/2f23fa308a7c067e52dfcc30a0758f47043ec176' (2024-09-22)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/a8968d88e5a537b0491f68ce910749cd870bdbef' (2024-08-22)
  → 'github:lnl7/nix-darwin/8c8388ade72e58efdeae71b4cbb79e872c23a56b' (2024-10-03)
• Updated input 'nixos-flake':
    'github:srid/nixos-flake/5734c1d9a5fe0bc8e8beaf389ad6227392ca0108' (2024-07-16)
  → 'github:srid/nixos-flake/47a26bc9118d17500bbe0c4adb5ebc26f776cc36' (2024-10-04)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/224042e9a3039291f22f4f2ded12af95a616cca0' (2024-08-21)
  → 'github:nixos/nixpkgs/6e6b3dd395c3b1eb9be9f2d096383a8d05add030' (2024-10-04)
• Updated input 'unstable':
    'github:nixos/nixpkgs/c374d94f1536013ca8e92341b540eba4c22f9c62' (2024-08-21)
  → 'github:nixos/nixpkgs/bc947f541ae55e999ffdb4013441347d83b00feb' (2024-10-04)
2024-10-05 13:02:20 +02:00
2e5a7bea4b
Merge pull request 'flora-6: remove' (#234) from remove-flora-6-sad-face into main
Reviewed-on: #234
Reviewed-by: teutat3s <teutat3s@noreply.git.pub.solar>
2024-09-10 15:58:58 +00:00
4831430455
chore: run nix fmt
Some checks failed
Flake checks / Check (pull_request) Has been cancelled
2024-09-10 16:02:26 +02:00
663ef8feb1
alerts: fix condition 2024-09-10 16:02:26 +02:00
63fa03e971
alerts.pub.solar: use DNS challenge for cert 2024-09-10 16:02:26 +02:00
faa71b7797
alerts: add check for healthy garage cluster 2024-09-10 16:02:26 +02:00
21a1ae15cb
trinkgenossin: fix duplicate promtail, prometheus-exporter 2024-09-10 16:02:26 +02:00
19723f3812
monitoring: add prometheus-exporter, promtail to
delite, blue-shell

add instance labels to garage scrape jobs
2024-09-10 16:02:26 +02:00
ec5e9896fd
delite: use static IP in initrd, DHCP not working 2024-09-10 16:02:25 +02:00
47b076e0a6
loki: store logs in /var/lib/loki 2024-09-10 16:02:25 +02:00
02a146c507
dns: switch to opentofu + terraform-backend-git,
use opentofu encrypted state feature

https://opentofu.org/docs/language/state/encryption/#new-project
2024-09-10 16:02:25 +02:00
7e48428fb9
dns: remove old, unused DKIM key
We have our own mailserver now
2024-09-10 16:02:25 +02:00
f4f6c14faa
flake: remove triton-vmtools, no longer needed
It was only used on flora-6
2024-09-10 16:02:25 +02:00
1ec5bafa30
flora-6: remove
This commit removes the flora-6 host. All services are moved to
trinkgenossin, with the drone service being removed completely in favour
of forgejo actions.
2024-09-10 16:02:24 +02:00
02629598aa
Merge pull request 'obs-portal: fix backups, docker command does not need a TTY' (#233) from obs-backup-fix into main
Reviewed-on: #233
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-09-09 15:43:14 +00:00
44f708ec76
obs-portal: run backups 1h later to avoid lock conflict
Some checks failed
Flake checks / Check (pull_request) Has been cancelled
2024-09-09 17:28:57 +02:00
cd82b83427
obs-portal: fix backups, docker command does not
All checks were successful
Flake checks / Check (pull_request) Successful in 20m28s
need a TTY
2024-08-31 22:05:11 +02:00
2d94ed5a0d
Merge pull request 'obs-portal: add backups' (#228) from obs-portal-backups into main
Reviewed-on: #228
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-08-31 19:43:10 +00:00
83e4bcd2df
Merge pull request 'mail: add backups' (#226) from mail-backups into main
Reviewed-on: #226
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-08-31 19:39:25 +00:00
09804f5c25
docs: how-to add backups for new hosts
All checks were successful
Flake checks / Check (pull_request) Successful in 3m43s
2024-08-29 16:36:11 +02:00
2eb54a331e
backups: add storagebox to programs.ssh.knownHosts 2024-08-29 16:36:09 +02:00
77b642f646
garage: increase nginx client_body_size to 64m
To make bigger garage uploads work well, avoiding error
HTTP 413 Entity Too Large
2024-08-29 16:24:32 +02:00
2e16c77956
secrets: rename restic-repo-storagebox{,-nachtigall}
To use a restic repository per host
2024-08-29 16:22:58 +02:00
e2ba1aacf4
mail: add backups to garage bucket + storagebox
Restic backups to garage S3 bucket metronom-backups
2024-08-29 16:19:24 +02:00
27dc20dd04
obs-portal: add backups to garage bucket + storagebox
All checks were successful
Flake checks / Check (pull_request) Successful in 23m21s
Restic backups to garage S3 bucket nachtigall-backups
2024-08-29 10:09:04 +02:00
a0fb6a60c3
Merge pull request 'devshell: add terraform-ls' (#227) from terraform-devshell into main
Reviewed-on: #227
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-08-28 15:55:29 +00:00
d2389497c2
Merge pull request 'garage: initial cluster' (#222) from garage-cluster into main
Reviewed-on: #222
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-08-28 15:55:16 +00:00
c056d9c35e
Merge pull request 'mediawiki: add backups' (#225) from mediawiki-backups into main
Reviewed-on: #225
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-08-28 15:54:33 +00:00
4626fd85c0
mediawiki: add backups to garage bucket + storagebox
All checks were successful
Flake checks / Check (pull_request) Successful in 1m56s
Restic backups to garage S3 bucket nachtigall-backups
https://garagehq.deuxfleurs.fr/documentation/connect/backup/#restic
2024-08-28 17:13:34 +02:00
c0a3d90d63
backups: add environmentFile option 2024-08-28 17:13:34 +02:00
1d92ef53ca
backups: storeName -> repoName 2024-08-28 17:13:33 +02:00
751d82f7e3
backups: rename pub-solar-os.backups.backups -> pub-solar-os.backups.restic 2024-08-28 17:12:22 +02:00
fb8ee1278a
Merge pull request 'feat/tests' (#224) from feat/tests into main
Reviewed-on: #224
Reviewed-by: teutat3s <teutat3s@noreply.git.pub.solar>
2024-08-27 10:45:56 +00:00
66ed87e666
ci: avoid garbage collection of checks
All checks were successful
Flake checks / Check (pull_request) Successful in 17m36s
2024-08-27 12:37:37 +02:00
88b76beb5c
keycloak: use backups module
All checks were successful
Flake checks / Check (pull_request) Successful in 19m4s
Co-authored-by: b12f <b12f@noreply.git.pub.solar>
Co-authored-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-08-27 10:09:07 +02:00
e857c6198b
modules/backup: init
Co-authored-by: b12f <b12f@noreply.git.pub.solar>
Co-authored-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-08-27 10:04:10 +02:00
998cf4c63d
website: force HTTPS
Co-authored-by: b12f <b12f@noreply.git.pub.solar>
Co-authored-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-08-27 10:03:43 +02:00
a0b52d51e5
nachtigall: make postgres wait for zfs mount
Co-authored-by: b12f <b12f@noreply.git.pub.solar>
Co-authored-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-08-27 10:00:42 +02:00
701c62dd69
tests: create keycloak test, add working test for website
Co-authored-by: b12f <b12f@noreply.git.pub.solar>
Co-authored-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-08-27 09:55:25 +02:00
711347abe6
docs: add how-to create garage bucket + key
All checks were successful
Flake checks / Check (pull_request) Successful in 6m38s
add new hosts to WireGuard example config
2024-08-26 11:56:45 +02:00
13bf3f5beb
docs: SSH to trinkgenossin for garage command
All checks were successful
Flake checks / Check (pull_request) Successful in 6m45s
2024-08-25 03:27:42 +02:00
f639fbe050
devshell: add terraform-ls
All checks were successful
Flake checks / Check (pull_request) Successful in 5m49s
2024-08-25 02:37:36 +02:00
f236962e17
garage: add monitoring, connect to grafana + loki
All checks were successful
Flake checks / Check (pull_request) Successful in 7m10s
https://garagehq.deuxfleurs.fr/documentation/reference-manual/monitoring/
2024-08-25 00:18:09 +02:00
d32abd7a7f
wireguard: add trinkgenossin, delite, blue-shell 2024-08-25 00:13:53 +02:00
15b507904f
garage: init buckets.pub.solar, use nginx as reverse proxy
https://garagehq.deuxfleurs.fr/documentation/cookbook/reverse-proxy/
2024-08-24 21:48:48 +02:00
b0790876ec
style: format using nixfmt-rfc-style
All checks were successful
Flake checks / Check (pull_request) Successful in 7m42s
2024-08-24 17:39:49 +02:00
b6be95d032
Merge pull request 'Maintenance + security updates for element, forgejo, mastodon, matrix-synapse' (#221) from flake-updates into main
Reviewed-on: #221
Reviewed-by: Akshay Mankar <axeman@noreply.git.pub.solar>
2024-08-24 01:11:41 +00:00
b6070d0f75
docs: initial docs for nixos-anywhere and garage setup
Some checks failed
Flake checks / Check (pull_request) Failing after 2m26s
2024-08-24 03:06:17 +02:00
25827a97d3
modules: add unlock-luks-on-boot 2024-08-24 03:05:28 +02:00
4a3d3ce84b
garage: init module 2024-08-24 03:05:16 +02:00
9eb746313e
flake: add disko
https://github.com/nix-community/disko
And add hosts to deploy-rs
2024-08-24 03:04:19 +02:00
83b7e3e11e
hosts: init blue-shell 2024-08-24 03:02:15 +02:00
4ef9781d10
hosts: init delite 2024-08-24 03:01:46 +02:00
ca8e578b11
hosts: init trinkgenossin 2024-08-24 03:00:01 +02:00
49c21fe740
dns: add trinkgenossin, delite, blue-shell 2024-08-24 02:58:37 +02:00
99308bfe24
Merge pull request 'secrets: ensure no final newline in editorconfig' (#220) from no-newline-for-secrets into main
Reviewed-on: #220
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-08-22 13:13:45 +00:00
50eb1d4f32
flake.lock: Update
All checks were successful
Flake checks / Check (pull_request) Successful in 16m23s
Flake lock file updates:

• Updated input 'agenix':
    'github:ryantm/agenix/3f1dae074a12feb7327b4bf43cbac0d124488bb7' (2024-07-30)
  → 'github:ryantm/agenix/f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41' (2024-08-10)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/91010a5613ffd7ee23ee9263213157a1c422b705' (2024-08-06)
  → 'github:lnl7/nix-darwin/a8968d88e5a537b0491f68ce910749cd870bdbef' (2024-08-22)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/883180e6550c1723395a3a342f830bfc5c371f6b' (2024-08-05)
  → 'github:nixos/nixpkgs/224042e9a3039291f22f4f2ded12af95a616cca0' (2024-08-21)
• Updated input 'unstable':
    'github:nixos/nixpkgs/cb9a96f23c491c081b38eab96d22fa958043c9fa' (2024-08-04)
  → 'github:nixos/nixpkgs/c374d94f1536013ca8e92341b540eba4c22f9c62' (2024-08-21)
2024-08-22 11:59:47 +02:00
c0fcf2352f
secrets: ensure no final newline
All checks were successful
Flake checks / Check (pull_request) Successful in 9m2s
2024-08-21 16:39:14 +02:00
3708d77d9b
Merge pull request 'Update docker, forgejo, systemd and others' (#219) from flake-updates into main
Reviewed-on: #219
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-08-07 11:55:29 +00:00
7f2bfd923f
loki: move data dir to /data disk with more room
All checks were successful
Flake checks / Check (pull_request) Successful in 4m33s
2024-08-07 10:19:53 +02:00
30d18c725a
revert: overlay for element-web and matrix-synapse
both packages now have the desired version available in nixos-24.05
2024-08-07 10:09:37 +02:00
387d97a2ea
flake.lock: Update
Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/9227223f6d922fee3c7b190b2cc238a99527bbb7' (2024-07-03)
  → 'github:hercules-ci/flake-parts/8471fe90ad337a8074e957b69ca4d0089218391d' (2024-08-01)
• Updated input 'flake-parts/nixpkgs-lib':
    '5daf051448.tar.gz?narHash=sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI%3D' (2024-07-01)
  → 'a5d394176e.tar.gz?narHash=sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q%3D' (2024-08-01)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/0413754b3cdb879ba14f6e96915e5fdf06c6aab6' (2024-07-27)
  → 'github:lnl7/nix-darwin/91010a5613ffd7ee23ee9263213157a1c422b705' (2024-08-06)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/12bf09802d77264e441f48e25459c10c93eada2e' (2024-07-29)
  → 'github:nixos/nixpkgs/883180e6550c1723395a3a342f830bfc5c371f6b' (2024-08-05)
• Updated input 'unstable':
    'github:nixos/nixpkgs/52ec9ac3b12395ad677e8b62106f0b98c1f8569d' (2024-07-28)
  → 'github:nixos/nixpkgs/cb9a96f23c491c081b38eab96d22fa958043c9fa' (2024-08-04)
2024-08-06 21:17:23 +02:00
6f2eeeb99e
Merge pull request 'Update element-web, matrix-synapse, nextcloud and misc packages' (#218) from flake-input-updates into main
Reviewed-on: #218
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-07-31 11:33:33 +00:00
21a28e1212
element-web, matrix-synapse: pull in updates early
All checks were successful
Flake checks / Check (pull_request) Successful in 15m10s
element-web 1.11.72 fixes support for Firefox ESR. Also get the latest
matrix-synapse version 1.112.0 while we're at it.
2024-07-31 11:45:58 +02:00
c3bf5df1d8
flake.lock: Update
Flake lock file updates:

• Updated input 'agenix':
    'github:ryantm/agenix/de96bd907d5fbc3b14fc33ad37d1b9a3cb15edc6' (2024-07-09)
  → 'github:ryantm/agenix/3f1dae074a12feb7327b4bf43cbac0d124488bb7' (2024-07-30)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/cf297a8d248db6a455b60133f6c0029c04ebe50e' (2024-07-10)
  → 'github:lnl7/nix-darwin/0413754b3cdb879ba14f6e96915e5fdf06c6aab6' (2024-07-27)
• Updated input 'nixos-flake':
    'github:srid/nixos-flake/cab6539d198792f94fbac029e5a63523604fd172' (2024-07-06)
  → 'github:srid/nixos-flake/5734c1d9a5fe0bc8e8beaf389ad6227392ca0108' (2024-07-16)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/a046c1202e11b62cbede5385ba64908feb7bfac4' (2024-07-11)
  → 'github:nixos/nixpkgs/12bf09802d77264e441f48e25459c10c93eada2e' (2024-07-29)
• Updated input 'unstable':
    'github:nixos/nixpkgs/feb2849fdeb70028c70d73b848214b00d324a497' (2024-07-09)
  → 'github:nixos/nixpkgs/52ec9ac3b12395ad677e8b62106f0b98c1f8569d' (2024-07-28)
2024-07-31 11:43:47 +02:00
563aa9ef46
Merge pull request 'RSS reader' (#217) from feat/tt-rss into main
Reviewed-on: #217
Reviewed-by: teutat3s <teutat3s@noreply.git.pub.solar>
2024-07-18 16:52:54 +00:00
8bf1e1d1a3
tt-rss: remove newlines from secrets
All checks were successful
Flake checks / Check (pull_request) Successful in 4m56s
using :set noeol nofixeol in neovim
2024-07-18 17:55:45 +02:00
79679720ff
tt-rss: lint with treefmt
All checks were successful
Flake checks / Check (pull_request) Successful in 7m11s
2024-07-18 17:49:29 +02:00
2b1a5d6f7f
secrets: revert rekey of non-related secrets
Some checks failed
Flake checks / Check (pull_request) Failing after 19s
2024-07-18 17:43:10 +02:00
5a84628e42
tt-rss: remove newlines from secrets
Some checks failed
Flake checks / Check (pull_request) Failing after 53s
using :set noeol nofixeol in neovim
2024-07-18 17:36:12 +02:00
0fc0c6d595
tt-rss: use git.tt-rss.org instead of gitlab
gitlab repo was throwing HTTP 500 errors
2024-07-18 17:35:05 +02:00
13c381ff3d
rss: fix auth build, fix nginx group rights, log to stdout
Some checks failed
Flake checks / Check (pull_request) Failing after 1m12s
2024-07-17 18:50:06 +02:00
c59fac512e
secrets: rekey for nachtigalls tt-rss secrets 2024-07-17 18:49:36 +02:00
68be6b9303
tt-rss: fix secret paths, add plugin sha 2024-07-17 15:22:59 +02:00
8ce50bb73b
tt-rss: add pub.solar specific configuration 2024-07-17 15:22:58 +02:00
cf830a9770
tt-rss: module init 2024-07-17 15:22:57 +02:00
0685d16d33
Merge pull request 'mediawiki: update to 1.42.1' (#216) from mediawiki-update into main
Reviewed-on: #216
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-07-17 13:09:03 +00:00
e1e0faa592
docs: updates for mediawiki maintenances
All checks were successful
Flake checks / Check (pull_request) Successful in 8m7s
2024-07-15 18:51:15 +02:00
26e96dfac5
mediawiki: update to v1.42.1 2024-07-15 18:51:10 +02:00
730c6ccb61
Merge pull request 'Update element-web, php and misc' (#214) from flake-updates into main
Reviewed-on: #214
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-07-12 12:32:24 +00:00
35c554bbc3
flake.lock: Update
All checks were successful
Flake checks / Check (pull_request) Successful in 11m36s
Flake lock file updates:

• Updated input 'agenix':
    'github:ryantm/agenix/3a56735779db467538fb2e577eda28a9daacaca6' (2024-06-14)
  → 'github:ryantm/agenix/de96bd907d5fbc3b14fc33ad37d1b9a3cb15edc6' (2024-07-09)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/0f89b73f41eaa1dde67b291452c181d9a75f10dd' (2024-07-07)
  → 'github:lnl7/nix-darwin/cf297a8d248db6a455b60133f6c0029c04ebe50e' (2024-07-10)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/194846768975b7ad2c4988bdb82572c00222c0d7' (2024-07-07)
  → 'github:nixos/nixpkgs/a046c1202e11b62cbede5385ba64908feb7bfac4' (2024-07-11)
• Updated input 'unstable':
    'github:nixos/nixpkgs/9f4128e00b0ae8ec65918efeba59db998750ead6' (2024-07-03)
  → 'github:nixos/nixpkgs/feb2849fdeb70028c70d73b848214b00d324a497' (2024-07-09)
2024-07-12 09:47:57 +02:00
5e6784f21a
Merge pull request 'Maintenance updates forgejo, matrix-synapse, nextcloud' (#213) from flake-updates into main
Reviewed-on: #213
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
2024-07-09 07:54:46 +00:00
dfb523133e
mastodon: remove overlay for security update, new
All checks were successful
Flake checks / Check (pull_request) Successful in 17m24s
version landed in NixOS 24.05
2024-07-08 18:36:48 +02:00
70ae84272c
flake.lock: Update
Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8' (2024-06-01)
  → 'github:hercules-ci/flake-parts/9227223f6d922fee3c7b190b2cc238a99527bbb7' (2024-07-03)
• Updated input 'flake-parts/nixpkgs-lib':
    'eb9ceca17d.tar.gz?narHash=sha256-lIbdfCsf8LMFloheeE6N31%2BBMIeixqyQWbSr2vk79EQ%3D' (2024-06-01)
  → '5daf051448.tar.gz?narHash=sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI%3D' (2024-07-01)
• Updated input 'home-manager':
    'github:nix-community/home-manager/a1fddf0967c33754271761d91a3d921772b30d0e' (2024-06-16)
  → 'github:nix-community/home-manager/e1391fb22e18a36f57e6999c7a9f966dc80ac073' (2024-07-03)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/50581970f37f06a4719001735828519925ef8310' (2024-06-23)
  → 'github:lnl7/nix-darwin/0f89b73f41eaa1dde67b291452c181d9a75f10dd' (2024-07-07)
• Updated input 'nixos-flake':
    'github:srid/nixos-flake/8cefa1e7af06d366f5d3fd7c97e9edbf4d38c476' (2024-06-26)
  → 'github:srid/nixos-flake/cab6539d198792f94fbac029e5a63523604fd172' (2024-07-06)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/89c49874fb15f4124bf71ca5f42a04f2ee5825fd' (2024-06-26)
  → 'github:nixos/nixpkgs/194846768975b7ad2c4988bdb82572c00222c0d7' (2024-07-07)
• Updated input 'nixpkgs-head':
    'github:nixos/nixpkgs/f2a40608e6b55661cac28e473e28b6208da53c01' (2024-07-04)
  → 'github:nixos/nixpkgs/acbecbb607c70bddfc5938b61cedbff3cfb1fc39' (2024-07-08)
• Updated input 'unstable':
    'github:nixos/nixpkgs/2893f56de08021cffd9b6b6dfc70fd9ccd51eb60' (2024-06-24)
  → 'github:nixos/nixpkgs/9f4128e00b0ae8ec65918efeba59db998750ead6' (2024-07-03)
2024-07-08 18:35:30 +02:00
9e2d9a06b3
Merge pull request 'security: update mastodon to 4.2.10' (#212) from mastodon-4.2.10 into main
Reviewed-on: #212
Reviewed-by: Hendrik Sokolowski <hensoko@noreply.git.pub.solar>
Reviewed-by: b12f <b12f@noreply.git.pub.solar>
2024-07-05 10:16:39 +00:00
f8f67b8908
security: update mastodon to 4.2.10
All checks were successful
Flake checks / Check (pull_request) Successful in 13m1s
https://github.com/mastodon/mastodon/releases/tag/v4.2.10
* Fix incorrect permission checking on multiple API endpoints (GHSA-58x8-3qxw-6hm7)
* Fix incorrect authorship checking when processing some activities (CVE-2024-37903, GHSA-xjvf-fm67-4qc3)
* Fix ongoing streaming sessions not being invalidated when application tokens get revoked (GHSA-vp5r-5pgw-jwqx)
2024-07-05 12:03:14 +02:00
201 changed files with 7190 additions and 2320 deletions

View file

@ -20,41 +20,8 @@ indent_style = unset
indent_size = unset indent_size = unset
[{.*,secrets}/**] [{.*,secrets}/**]
end_of_line = unset end_of_line = false
insert_final_newline = unset insert_final_newline = false
trim_trailing_whitespace = unset
charset = unset
indent_style = unset
indent_size = unset
[*.rom]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
charset = unset
indent_style = unset
indent_size = unset
[*.py]
indent_size = 4
[*.md]
max_line_length = off
trim_trailing_whitespace = false
# Ignore diffs/patches
[*.{diff,patch}]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
indent_size = unset
charset = unset
indent_style = unset
indent_size = unset
[{.*,secrets}/**]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset trim_trailing_whitespace = unset
charset = unset charset = unset
indent_style = unset indent_style = unset

View file

@ -10,7 +10,7 @@ jobs:
- name: Check formatting - name: Check formatting
run: | run: |
nix --accept-flake-config --access-tokens '' develop --command treefmt --fail-on-change nix --accept-flake-config --access-tokens '' develop --command treefmt --ci
- name: Run flake checks - name: Run flake checks
run: | run: |
@ -18,14 +18,7 @@ jobs:
# Prevent cache garbage collection by creating GC roots # Prevent cache garbage collection by creating GC roots
mkdir -p /var/lib/gitea-runner/tankstelle/.local/state/nix/results mkdir -p /var/lib/gitea-runner/tankstelle/.local/state/nix/results
for target in $(nix flake show --json --all-systems | jq ' sed -i 's/virtualisation.cores .*/virtualisation.cores = 16;/' tests/keycloak.nix
.["nixosConfigurations"] | sed -i 's/virtualisation.memorySize .*/virtualisation.memorySize = 16384;/' tests/keycloak.nix
to_entries[] | # 1 eval-worker needs about 13GB of memory
.key nix --accept-flake-config --access-tokens '' develop --command nix-fast-build --no-nom --skip-cached --systems "x86_64-linux" --max-jobs 10 --eval-workers 2 --out-link /var/lib/gitea-runner/tankstelle/.local/state/nix/results/nix-fast-build
' | tr -d '"'
); do
nix --print-build-logs --verbose --accept-flake-config --access-tokens '' \
build --out-link /var/lib/gitea-runner/tankstelle/.local/state/nix/results/"$target" ".#nixosConfigurations.${target}.config.system.build.toplevel"
done
nix --print-build-logs --verbose --accept-flake-config --access-tokens '' flake check

7
docs/README.md Normal file
View file

@ -0,0 +1,7 @@
# pub.solar documentation
This directory holds a collection of notes and documentation for pub.solar admins.
### Systems Overview
To get a first overview of existing pub.solar systems, please see the [pub.solar systems overview](./systems-overview.md).

View file

@ -28,18 +28,18 @@ People with admin access to the infrastructure are added to [`logins/admins.nix`
SSH is not reachable from the open internet. Instead, SSH Port 22 is protected by a wireguard VPN network. Thus, to get root access on the servers, at least two pieces of information have to be added to the admins config: SSH is not reachable from the open internet. Instead, SSH Port 22 is protected by a wireguard VPN network. Thus, to get root access on the servers, at least two pieces of information have to be added to the admins config:
1. **SSH Public key**: self-explanatory. Add your public key to your user attrset under `sshPubKeys`. 1. **SSH Public key**: self-explanatory. Add your public key to your user attrset under `sshPubKeys`.
2. **Wireguard device**: each wireguard device has two parts: the public key and the IP addresses it should have in the wireguard network. The pub.solar wireguard network is spaced under `10.7.6.0/24` and `fd00:fae:fae:fae:fae::/80`. To add your device, it's best to choose a free number between 200 and 255 and use that in both the ipv4 and ipv6 ranges: `10.7.6.<ip-address>/32` `fd00:fae:fae:fae:fae:<ip-address>::/96`. For more information on how to generate keypairs, see [the NixOS Wireguard docs](https://nixos.wiki/wiki/WireGuard#Generate_keypair). 2. **Wireguard device**: each wireguard device has two parts: the public key and the IP addresses it should have in the wireguard network. The pub.solar wireguard network uses the subnets `10.7.6.0/24` and `fd00:fae:fae:fae:fae::/80`. To add your device, it's best to choose a free number between 200 and 255 and use that in both the ipv4 and ipv6 ranges: `10.7.6.<ip-address>/32` `fd00:fae:fae:fae:fae:<ip-address>::/96`. For more information on how to generate keypairs, see [the NixOS Wireguard docs](https://nixos.wiki/wiki/WireGuard#Generate_keypair).
One can access our hosts using this domain scheme: One can access our hosts using this domain scheme:
``` ```
ssh barkeeper@<hostname>.wg.pub.solar ssh <unix-username>@<hostname>.wg.pub.solar
``` ```
So, for example for `nachtigall`: So, for example for `nachtigall`:
``` ```
ssh barkeeper@nachtigall.wg.pub.solar ssh teutat3s@nachtigall.wg.pub.solar
``` ```
Example NixOS snippet for WireGuard client config Example NixOS snippet for WireGuard client config
@ -63,12 +63,6 @@ Example NixOS snippet for WireGuard client config
#endpoint = "138.201.80.102:51820"; #endpoint = "138.201.80.102:51820";
persistentKeepalive = 15; persistentKeepalive = 15;
} }
{ # flora-6.pub.solar
publicKey = "jtSR5G2P/nm9s8WrVc26Xc/SQLupRxyXE+5eIeqlsTU=";
allowedIPs = [ "10.7.6.2/32" "fd00:fae:fae:fae:fae:2::/96" ];
endpoint = "80.71.153.210:51820";
persistentKeepalive = 15;
}
{ # metronom.pub.solar { # metronom.pub.solar
publicKey = "zOSYGO7MfnOOUnzaTcWiKRQM0qqxR3JQrwx/gtEtHmo="; publicKey = "zOSYGO7MfnOOUnzaTcWiKRQM0qqxR3JQrwx/gtEtHmo=";
allowedIPs = [ "10.7.6.3/32" "fd00:fae:fae:fae:fae:3::/96" ]; allowedIPs = [ "10.7.6.3/32" "fd00:fae:fae:fae:fae:3::/96" ];
@ -85,6 +79,39 @@ Example NixOS snippet for WireGuard client config
#endpoint = "80.244.242.5:51820"; #endpoint = "80.244.242.5:51820";
persistentKeepalive = 15; persistentKeepalive = 15;
} }
{
# trinkgenossin.pub.solar
publicKey = "QWgHovHxtqiQhnHLouSWiT6GIoQDmuvnThYL5c/rvU4=";
allowedIPs = [
"10.7.6.5/32"
"fd00:fae:fae:fae:fae:5::/96"
];
#endpoint = "85.215.152.22:51820";
endpoint = "[2a01:239:35d:f500::1]:51820";
persistentKeepalive = 15;
}
{
# delite.pub.solar
publicKey = "ZT2qGWgMPwHRUOZmTQHWCRX4m14YwOsiszjsA5bpc2k=";
allowedIPs = [
"10.7.6.6/32"
"fd00:fae:fae:fae:fae:6::/96"
];
#endpoint = "5.255.119.132:51820";
endpoint = "[2a04:52c0:124:9d8c::2]:51820";
persistentKeepalive = 15;
}
{
# blue-shell.pub.solar
publicKey = "bcrIpWrKc1M+Hq4ds3aN1lTaKE26f2rvXhd+93QrzR8=";
allowedIPs = [
"10.7.6.7/32"
"fd00:fae:fae:fae:fae:7::/96"
];
#endpoint = "194.13.83.205:51820";
endpoint = "[2a03:4000:43:24e::1]:51820";
persistentKeepalive = 15;
}
]; ];
}; };
}; };

36
docs/backups.md Normal file
View file

@ -0,0 +1,36 @@
# Backups
We use [Restic](https://restic.readthedocs.io/en/stable/) to create backups and push them to two repositories.
Check `./modules/backups.nix` and `./hosts/nachtigall/backups.nix` for working examples.
### Hetzner Storagebox
- Uses SFTP for transfer of backups
Adding a new host SSH public key to the storagebox:
First, [SSH to nachtigall](./administrative-access.md#ssh-access), then become root and add the new SSH public key
```
sudo -i
echo '<ssh-public-key>' | ssh -p23 u377325@u377325.your-storagebox.de install-ssh-key
```
[Link to Hetzner storagebox docs](https://docs.hetzner.com/robot/storage-box/backup-space-ssh-keys).
### Garage S3 buckets
- Uses S3 for transfer of backups
- One bucket per host, e.g. `nachtigall-backups`, `metronom-backups`
To start transfering backups from a new hosts, this is how to create a new bucket:
First, [SSH to trinkgenossin](./administrative-access.md#ssh-access), then use the `garage` CLI to create a new key and bucket:
```
export GARAGE_RPC_SECRET=<secret-in-keepass>
garage bucket create <hostname>-backups
garage key create <hostname>-backups-key
garage bucket allow <hostname>-backups --read --write --key <hostname>-backups-key
```

55
docs/cachix.md Normal file
View file

@ -0,0 +1,55 @@
# Cachix usage
URL: https://pub-solar.cachix.org
Requirements:
- [Install cachix](https://docs.cachix.org/installation)
- Optional: To push to the cache, you need to set `CACHIX_AUTH_TOKEN` in your environment. To generate one for you, follow the [Getting Started](https://docs.cachix.org/getting-started#authenticating) docs and login with your GitHub account.
- Add our binary cache [to your nix config](https://docs.cachix.org/faq#cachix-use-effects). To add the pub-solar cache, run:
```
cachix use pub-solar
```
Example to build and push a custom package of a host in this flake (e.g. after creating an overlay):
```
nix build --json -f . '.#nixosConfigurations.nachtigall.pkgs.keycloak^*' \
| jq -r '.[].outputs | to_entries[].value' \
| cachix push pub-solar
```
Example to build and push a package in the `nixpkgs` repo:
```
cd nixpkgs
nix build --json -f . 'pkgs.lix^*' \
| jq -r '.[].outputs | to_entries[].value' \
| cachix push pub-solar
```
Checking if a package has been correctly pushed to the cache:
```
nix build --json '/nix/store/f76xi83z4xk9sn6pbh38rh97yvqhb5m0-noto-fonts-color-emoji-png-2.042.drv^*' | jq -r '.[].outputs | to_entries[].value' | cachix push pub-solar
Pushing 1 paths (0 are already present) using zstd to cache pub-solar ⏳
✓ /nix/store/xpgpi84765dxqja3gd5pldj49xx2v0xl-noto-fonts-color-emoji-png-2.042 (10.30 MiB)
All done.
curl -I https://pub-solar.cachix.org/xpgpi84765dxqja3gd5pldj49xx2v0xl.narinfo
HTTP/2 200
date: Mon, 26 Aug 2024 09:31:10 GMT
content-type: text/x-nix-narinfo
traceparent: 00-b99db37cc9c2581b8d226cdf81e54507-794fc49193659c03-01
tracestate:
cache-control: public, max-age=14400
last-modified: Mon, 26 Aug 2024 09:31:10 GMT
cf-cache-status: EXPIRED
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=A67KGsCIsYjoFdvndxJ0rkmb7BZ5ztIpm8WUJKAiUPRVWvbYeXU9gU27P7zryiUtArbwrLzHhhMija0yyXk0kwNa3suz8gNzKK6z1CX1FWDZiiP07rnq7zAg8nZbSBiEU%2FZrU9nSrR6mhuL9ihbmW1Hf"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
cf-ray: 8b92ceab0d19c80e-DUS
```

View file

@ -34,13 +34,27 @@ Docs: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server
### Mastodon ### Mastodon
``` ```
mkdir /tmp/tootctl
sudo chown mastodon /tmp/tootctl
cd /tmp/tootctl
sudo -u mastodon mastodon-tootctl accounts delete --email <mail-address> sudo -u mastodon mastodon-tootctl accounts delete --email <mail-address>
rm -r /tmp/tootctl
``` ```
Docs: https://docs.joinmastodon.org/admin/tootctl/#accounts-delete Docs: https://docs.joinmastodon.org/admin/tootctl/#accounts-delete
### Forgejo ### Forgejo
Make sure you have access to the gitea/forgejo command:
```
nix shell nixpkgs#forgejo
```
Then, delete the user:
``` ```
sudo -u gitea gitea admin user delete --config /var/lib/forgejo/custom/conf/app.ini --purge --email <mail-address> sudo -u gitea gitea admin user delete --config /var/lib/forgejo/custom/conf/app.ini --purge --email <mail-address>
``` ```
@ -50,11 +64,37 @@ Docs: https://forgejo.org/docs/latest/admin/command-line/#delete
### Matrix ### Matrix
``` ```
curl --header "Authorization: Bearer <admin-access-token>" --request POST http://172.18.0.3:8008/_synapse/admin/v1/deactivate/@<username>:pub.solar --data '{"erase": true}' curl --header "Authorization: Bearer <admin-access-token>" --request POST http://127.0.0.1:8008/_synapse/admin/v1/deactivate/@<username>:pub.solar --data '{"erase": true}'
``` ```
Docs: https://matrix-org.github.io/synapse/latest/admin_api/user_admin_api.html#deactivate-account Docs: https://element-hq.github.io/synapse/latest/admin_api/user_admin_api.html#deactivate-account
The authentication token should be in the keepass. If it is expired, you can get a new one by running the following:
```
# get full path to mas-cli command with current --config flags from
# sudo systemctl cat matrix-authentication-service
sudo -u matrix-authentication-service mas-cli --config nix-store-config --config /run/agenix/matrix-authentication-service-secret-config.yml manage issue-compatibility-token --yes-i-want-to-grant-synapse-admin-privileges crew
```
### OpenBikeSensor ### OpenBikeSensor
Not implemented, see: https://github.com/openbikesensor/portal/issues/95 Not implemented, see: https://github.com/openbikesensor/portal/issues/95
## Notifying the user
Make sure to send an e-mail to the specified address notifying the user of the accounts deletion.
You can use this template:
```
Hello,
Your pub.solar ID has been deactivated. Associated data in pub.solar services has been deleted.
Please note that the username is now blocked to prevent impersonation attempts.
Best,
@<name> for the pub.solar crew
```

View file

@ -7,22 +7,29 @@ be manually deployed.
To deploy, make sure you have a [working development shell](./development-shell.md). To deploy, make sure you have a [working development shell](./development-shell.md).
Then, run `deploy-rs` with the hostname of the server you want to deploy: Then, run `deploy-rs` with the hostname of the server you want to deploy:
### Dry-run
Use `--dry-activate` to show a diff of updated packages and all services that
would be restarted by the update. This will also put all files in place without
switching to the new generation, enabling a quick switch to the new config at a
later moment.
For nachtigall.pub.solar: For nachtigall.pub.solar:
``` ```
deploy --targets '.#nachtigall' --magic-rollback false --auto-rollback false --keep-result --result-path ./results deploy --targets '.#nachtigall' --ssh-user <unix-username> --magic-rollback false --auto-rollback false --keep-result --result-path ./results --dry-activate
``` ```
For flora-6.pub.solar: After reviewing the changes, apply the update with:
``` ```
deploy --targets '.#flora-6' --magic-rollback false --auto-rollback false --keep-result --result-path ./results deploy --targets '.#nachtigall' --ssh-user <unix-username> --magic-rollback false --auto-rollback false --keep-result --result-path ./results
``` ```
For metronom.pub.solar (aarch64-linux): For metronom.pub.solar (aarch64-linux):
``` ```
deploy --targets '.#metronom' --magic-rollback false --auto-rollback false --keep-result --result-path ./results --remote-build deploy --targets '.#metronom' --ssh-user <unix-username> --magic-rollback false --auto-rollback false --keep-result --result-path ./results --remote-build
``` ```
Usually we skip all rollback functionality, but if you want to deploy a change Usually we skip all rollback functionality, but if you want to deploy a change
@ -31,9 +38,6 @@ that might lock you out, e.g. to SSH, it might make sense to set these to `true`
To skip flake checks, e.g. because you already ran them manually before To skip flake checks, e.g. because you already ran them manually before
deployment, add the flag `--skip-checks` at the end of the command. deployment, add the flag `--skip-checks` at the end of the command.
`--dry-activate` can be used to only put all files in place without switching,
to enable switching to the new config quickly at a later moment.
We use `--keep-result --result-path ./results` to keep the last `result` We use `--keep-result --result-path ./results` to keep the last `result`
symlink of each `deploy` from being garbage collected. That way, we keep builds symlink of each `deploy` from being garbage collected. That way, we keep builds
cached in the Nix store. This is optional and both flags can be removed if disk cached in the Nix store. This is optional and both flags can be removed if disk

View file

@ -1,18 +1,10 @@
# Changing DNS entries # Changing DNS entries
Our current DNS provider is [namecheap](https://www.namecheap.com/). Our current DNS provider is [namecheap](https://www.namecheap.com/).
We use [Terraform](https://www.terraform.io) to declaratively manage our pub.solar DNS records. We use [OpenTofu](https://opentofu.org) to declaratively manage our pub.solar DNS records.
### Initial setup ### Initial setup
Skip this step if you already have a `triton` profile setup.
```
triton profile create
```
Please follow https://docs.greenbaum.cloud/en/devops/triton-cli.html for the details.
You will need to setup the following [namecheap API credentials](https://www.namecheap.com/support/api/intro), You will need to setup the following [namecheap API credentials](https://www.namecheap.com/support/api/intro),
look for "namecheap API key" in the pub.solar Keepass database. look for "namecheap API key" in the pub.solar Keepass database.
@ -28,13 +20,15 @@ You will probably also need to add your external IP to the [API allow list](http
dig -4 ip @dns.toys dig -4 ip @dns.toys
``` ```
Now, change into the terraform directory and initialize the terraform providers. Now, change into the terraform directory and initialize the terraform providers. To decrypt existing state,
search for "terraform state passphrase" in the pub.solar Keepass database.
``` ```
cd terraform cd terraform
export TRITON_KEY_ID=$(cat ~/.config/triton/profiles.d/lev-1-pub_solar.json | jq --raw-output .keyId) export TF_VAR_state_passphrase=$(secret-tool lookup pub.solar terraform-state-passphrase-dns)
terraform init alias tofu="terraform-backend-git --access-logs --tf tofu git terraform"
tofu init
``` ```
Make your changes, e.g. in `dns.tf`. Make your changes, e.g. in `dns.tf`.
@ -46,20 +40,21 @@ $EDITOR dns.tf
Plan your changes using: Plan your changes using:
``` ```
terraform plan -out pub-solar-infra.plan tofu plan -out pub-solar-infra.plan
``` ```
After verification, apply your changes with: After verification, apply your changes with:
``` ```
terraform apply "pub-solar-infra.plan" tofu apply "pub-solar-infra.plan"
``` ```
### Useful links ### Useful links
We use the Manta remote backend to save the terraform state for collaboration. We use terraform-backend-git remote backend with opentofu state encryption for collaboration.
- https://www.terraform.io/language/v1.2.x/settings/backends/manta - https://github.com/plumber-cd/terraform-backend-git
- https://opentofu.org/docs/language/state/encryption
Namecheap Terraform provider docs: Namecheap Terraform provider docs:

View file

@ -1,19 +0,0 @@
# Drone CI
We currently use two CI systems, [drone CI](https://drone.io), reachable via
https://ci.pub.solar and [Forgejo Actions](https://forgejo.org/docs/latest/user/actions/),
which UI is integrated into https://git.pub.solar, for example
https://git.pub.solar/pub-solar/infra/actions.
### Signing the `.drone.yml` file
Login to https://ci.pub.solar by clicking on the user icon in the bottom left.
After logging in, you can view your personal API token by clicking on the same
icon. If you're using the nix [development-shell](./development-shell.md), the
`drone` command will already be installed.
```
export DRONE_TOKEN=<your-drone-api-token>
drone --token $DRONE_TOKEN sign --save pub-solar/os
```

84
docs/garage.md Normal file
View file

@ -0,0 +1,84 @@
# Garage
### How-To create a new bucket + keys
Requirements:
- `garage` RPC credentials, in the shared keepass, search for 'garage rpc secret'.
- [Setup WireGuard](./administrative-access.md#ssh-access) for hosts: `trinkgenossin`, optionally: `delite`, `blue-shell`
```
ssh <unix-username>@trinkgenossin.wg.pub.solar
```
```
# Add a few spaces to avoid leaking the secret to the shell history
export GARAGE_RPC_SECRET=<secret-in-keepass>
```
Now, you can run the following command to check the cluster status:
```
garage status
```
Command to list all existing buckets:
```
garage bucket list
```
Creating a new bucket and access keys:
```
garage bucket create <bucket-name>
garage key create <bucket-name>-key
garage bucket allow <bucket-name> --read --write --key <bucket-name>-key
```
Full example for `mastodon` bucket:
```
garage bucket create mastodon
garage key create mastodon-key
garage bucket allow mastodon --read --write --key mastodon-key
```
Then [setup your favourite S3 client](https://garagehq.deuxfleurs.fr/documentation/connect/cli/)
or use the bucket with any [S3 compatible software](https://garagehq.deuxfleurs.fr/documentation/connect/).
Further reading:
- https://garagehq.deuxfleurs.fr/documentation/quick-start/
- https://garagehq.deuxfleurs.fr/documentation/connect/
- https://garagehq.deuxfleurs.fr/documentation/connect/apps/#mastodon
### Notes on manual setup steps
```
ssh <unix-username>@trinkgenossin.wg.pub.solar
# Add a few spaces to avoid leaking the secret to the shell history
export GARAGE_RPC_SECRET=<secret-in-keepass>
# Uses the default config /etc/garage.toml
garage node id
garage node connect <node-id2>
garage node connect <node-id3>
garage status
#Zones
#DE-1 DE-2 NL-1
garage layout assign fdaa -z DE-1 -c 800G -t trinkgenossin
garage layout assign 8835 -z DE-2 -c 800G -t blue-shell
garage layout assign 73da -z NL-1 -c 800G -t delite
garage layout show
garage layout apply --version 1
```
Source: https://garagehq.deuxfleurs.fr/documentation/cookbook/real-world/#creating-a-cluster-layout

View file

@ -12,7 +12,7 @@ Run following after SSH'ing to `nachtigall`.
Credentials for the following command are in keepass. Create a keycloak Credentials for the following command are in keepass. Create a keycloak
config/credentials file at `/tmp/kcadm.config`: config/credentials file at `/tmp/kcadm.config`:
``` ```bash
sudo --user keycloak kcadm.sh config credentials \ sudo --user keycloak kcadm.sh config credentials \
--config /tmp/kcadm.config \ --config /tmp/kcadm.config \
--server https://auth.pub.solar \ --server https://auth.pub.solar \
@ -22,7 +22,7 @@ sudo --user keycloak kcadm.sh config credentials \
Get list of accounts without a verified email address: Get list of accounts without a verified email address:
``` ```bash
sudo --user keycloak kcadm.sh get \ sudo --user keycloak kcadm.sh get \
--config /tmp/kcadm.config \ --config /tmp/kcadm.config \
users \ users \
@ -35,7 +35,7 @@ Review list of accounts, especially check `createdTimestamp` if any accounts
were created in the past 2 days. If so, delete those from the were created in the past 2 days. If so, delete those from the
`/tmp/keycloak-unverified-accounts` file. `/tmp/keycloak-unverified-accounts` file.
``` ```bash
createdTimestamps=( $( nix run nixpkgs#jq -- -r '.[].createdTimestamp' < /tmp/keycloak-unverified-accounts ) ) createdTimestamps=( $( nix run nixpkgs#jq -- -r '.[].createdTimestamp' < /tmp/keycloak-unverified-accounts ) )
# timestamps are in nanoseconds since epoch, so we need to strip the last three digits # timestamps are in nanoseconds since epoch, so we need to strip the last three digits
@ -46,17 +46,17 @@ vim /tmp/keycloak-unverified-accounts
Check how many accounts are going to be deleted: Check how many accounts are going to be deleted:
``` ```bash
jq -r '.[].id' < /tmp/keycloak-unverified-accounts | wc -l jq -r '.[].id' < /tmp/keycloak-unverified-accounts | wc -l
``` ```
``` ```bash
jq -r '.[].id' < /tmp/keycloak-unverified-accounts > /tmp/keycloak-unverified-account-ids jq -r '.[].id' < /tmp/keycloak-unverified-accounts > /tmp/keycloak-unverified-account-ids
``` ```
Final check before deletion (dry-run): Final check before deletion (dry-run):
``` ```bash
for id in $(cat /tmp/keycloak-unverified-account-ids) for id in $(cat /tmp/keycloak-unverified-account-ids)
do do
echo sudo --user keycloak kcadm.sh delete \ echo sudo --user keycloak kcadm.sh delete \
@ -68,7 +68,7 @@ for id in $(cat /tmp/keycloak-unverified-account-ids)
THIS WILL DELETE ACCOUNTS: THIS WILL DELETE ACCOUNTS:
``` ```bash
for id in $(cat /tmp/keycloak-unverified-account-ids) for id in $(cat /tmp/keycloak-unverified-account-ids)
do do
sudo --user keycloak kcadm.sh delete \ sudo --user keycloak kcadm.sh delete \
@ -77,3 +77,9 @@ for id in $(cat /tmp/keycloak-unverified-account-ids)
--realm pub.solar --realm pub.solar
done done
``` ```
Delete the temp files:
```bash
sudo rm /tmp/kcadm.config /tmp/keycloak-unverified-accounts /tmp/keycloak-unverified-account-ids
```

View file

@ -0,0 +1,27 @@
# Matrix account suspension
> Unlike [account locking](https://spec.matrix.org/v1.12/client-server-api/#account-locking),
> [suspension](https://github.com/matrix-org/matrix-spec-proposals/blob/main/proposals/3823-code-for-account-suspension.md)
> allows the user to have a (largely) readonly view of their account.
> Homeserver administrators and moderators may use this functionality to
> temporarily deactivate an account, or place conditions on the account's
> experience. Critically, like locking, account suspension is reversible, unlike
> the deactivation mechanism currently available in Matrix - a destructive,
> irreversible, action.
Required:
- `matrix-synapse admin token`
- [SSH access to host `nachtigall`](./administrative-access.md#ssh-access)
## Suspending an account
```bash
curl --header "Authorization: Bearer <admin-access-token>" --request PUT http://127.0.0.1:8008/_synapse/admin/v1/suspend/@<username>:pub.solar --data '{"suspend": true}'
```
## Unsuspending an account
```bash
curl --header "Authorization: Bearer <admin-access-token>" --request PUT http://127.0.0.1:8008/_synapse/admin/v1/suspend/@<username>:pub.solar --data '{"suspend": false}'
```

View file

@ -4,7 +4,7 @@ See the [mediawiki-oidc-docker repository](https://git.pub.solar/pub-solar/media
for instructions on updating our customized mediawiki docker image. for instructions on updating our customized mediawiki docker image.
To deploy a new docker image to `nachtigall`, first bump the mediawiki version To deploy a new docker image to `nachtigall`, first bump the mediawiki version
of the docker image tag in `hosts/nachtigall/apps/mediawiki.nix` (search for of the docker image tag in `modules/mediawiki/default.nix` (search for
`image`). `image`).
Next, push your changes to https://git.pub.solar and get them reviewed and Next, push your changes to https://git.pub.solar and get them reviewed and
@ -19,7 +19,7 @@ exit
``` ```
``` ```
deploy --targets '.#nachtigall' deploy --targets '.#nachtigall' --magic-rollback false --auto-rollback false --keep-result --result-path ./results
``` ```
Then, finalize the update by running the database migration script (in a [SSH](./administrative-access.md#ssh-access) shell on `nachtigall`): Then, finalize the update by running the database migration script (in a [SSH](./administrative-access.md#ssh-access) shell on `nachtigall`):

View file

@ -0,0 +1,348 @@
# Notes on adding two disks to server nachtigall
Status after Hetzner support added two additional 1TB NVMe disks:
```
teutat3s in 🌐 nachtigall in ~
lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
nvme0n1
├─nvme0n1p1
├─nvme0n1p2 vfat FAT16 5494-BA1E 385M 21% /boot2
└─nvme0n1p3 zfs_member 5000 root_pool 8287701206764130981
nvme1n1
├─nvme1n1p1
├─nvme1n1p2 vfat FAT32 5493-EFF5 1.8G 5% /boot1
└─nvme1n1p3 zfs_member 5000 root_pool 8287701206764130981
nvme2n1
nvme3n1
teutat3s in 🌐 nachtigall in ~
sudo fdisk -l /dev/nvme0n1
Disk /dev/nvme0n1: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: KXG60ZNV1T02 TOSHIBA
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 28F8681A-4559-4801-BF3F-BFEC8058236B
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 4095 2048 1M BIOS boot
/dev/nvme0n1p2 4096 999423 995328 486M EFI System
/dev/nvme0n1p3 999424 2000408575 1999409152 953.4G Linux filesystem
teutat3s in 🌐 nachtigall in ~
sudo fdisk -l /dev/nvme1n1
Disk /dev/nvme1n1: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: SAMSUNG MZVL21T0HCLR-00B00
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: A143A806-69C5-4EFC-8E34-20C35574D990
Device Start End Sectors Size Type
/dev/nvme1n1p1 2048 4095 2048 1M BIOS boot
/dev/nvme1n1p2 4096 3905535 3901440 1.9G EFI System
/dev/nvme1n1p3 3905536 2000408575 1996503040 952G Linux filesystem
teutat3s in 🌐 nachtigall in ~
sudo fdisk -l /dev/nvme2n1
Disk /dev/nvme2n1: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: SAMSUNG MZVL21T0HDLU-00B07
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
teutat3s in 🌐 nachtigall in ~
sudo fdisk -l /dev/nvme3n1
Disk /dev/nvme3n1: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: SAMSUNG MZVL21T0HCLR-00B00
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
```
Partitioning and formatting the new disks `/dev/nvme2n1` and `/dev/nvme3n1`:
```
teutat3s in 🌐 nachtigall in ~
sudo fdisk /dev/nvme2n1
Welcome to fdisk (util-linux 2.39.4).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table.
Created a new DOS (MBR) disklabel with disk identifier 0x0852470c.
Command (m for help): p
Disk /dev/nvme2n1: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: SAMSUNG MZVL21T0HDLU-00B07
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0852470c
Command (m for help): m
Help:
DOS (MBR)
a toggle a bootable flag
b edit nested BSD disklabel
c toggle the dos compatibility flag
Generic
d delete a partition
F list free unpartitioned space
l list known partition types
n add a new partition
p print the partition table
t change a partition type
v verify the partition table
i print information about a partition
Misc
m print this menu
u change display/entry units
x extra functionality (experts only)
Script
I load disk layout from sfdisk script file
O dump disk layout to sfdisk script file
Save & Exit
w write table to disk and exit
q quit without saving changes
Create a new label
g create a new empty GPT partition table
G create a new empty SGI (IRIX) partition table
o create a new empty MBR (DOS) partition table
s create a new empty Sun partition table
Command (m for help): g
Created a new GPT disklabel (GUID: 8CC98E3F-20A8-4A2D-8D50-9CD769EE4C65).
Command (m for help): p
Disk /dev/nvme2n1: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: SAMSUNG MZVL21T0HDLU-00B07
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 8CC98E3F-20A8-4A2D-8D50-9CD769EE4C65
Command (m for help): n
Partition number (1-128, default 1):
First sector (2048-2000409230, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-2000409230, default 2000408575): 4095
Created a new partition 1 of type 'Linux filesystem' and of size 1 MiB.
Command (m for help): t
Selected partition 1
Partition type or alias (type L to list all): L
1 EFI System C12A7328-F81F-11D2-BA4B-00A0C93EC93B
2 MBR partition scheme 024DEE41-33E7-11D3-9D69-0008C781F39F
3 Intel Fast Flash D3BFE2DE-3DAF-11DF-BA40-E3A556D89593
4 BIOS boot 21686148-6449-6E6F-744E-656564454649
5 Sony boot partition F4019732-066E-4E12-8273-346C5641494F
6 Lenovo boot partition BFBFAFE7-A34F-448A-9A5B-6213EB736C22
7 PowerPC PReP boot 9E1A2D38-C612-4316-AA26-8B49521E5A8B
8 ONIE boot 7412F7D5-A156-4B13-81DC-867174929325
9 ONIE config D4E6E2CD-4469-46F3-B5CB-1BFF57AFC149
10 Microsoft reserved E3C9E316-0B5C-4DB8-817D-F92DF00215AE
11 Microsoft basic data EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
12 Microsoft LDM metadata 5808C8AA-7E8F-42E0-85D2-E1E90434CFB3
13 Microsoft LDM data AF9B60A0-1431-4F62-BC68-3311714A69AD
14 Windows recovery environment DE94BBA4-06D1-4D40-A16A-BFD50179D6AC
15 IBM General Parallel Fs 37AFFC90-EF7D-4E96-91C3-2D7AE055B174
16 Microsoft Storage Spaces E75CAF8F-F680-4CEE-AFA3-B001E56EFC2D
17 HP-UX data 75894C1E-3AEB-11D3-B7C1-7B03A0000000
18 HP-UX service E2A1E728-32E3-11D6-A682-7B03A0000000
19 Linux swap 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F
20 Linux filesystem 0FC63DAF-8483-4772-8E79-3D69D8477DE4
...
Partition type or alias (type L to list all): 4
Changed type of partition 'Linux filesystem' to 'BIOS boot'.
Command (m for help): n
Partition number (2-128, default 2):
First sector (4096-2000409230, default 4096):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (4096-2000409230, default 2000408575): 3901440
Created a new partition 2 of type 'Linux filesystem' and of size 1.9 GiB.
Command (m for help): t
Partition number (1,2, default 2): 2
Partition type or alias (type L to list all): 1
Changed type of partition 'Linux filesystem' to 'EFI System'.
Command (m for help): n
Partition number (3-128, default 3):
First sector (3901441-2000409230, default 3903488):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (3903488-2000409230, default 2000408575):
Created a new partition 3 of type 'Linux filesystem' and of size 952 GiB.
Command (m for help): p
Disk /dev/nvme2n1: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: SAMSUNG MZVL21T0HDLU-00B07
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 8CC98E3F-20A8-4A2D-8D50-9CD769EE4C65
Device Start End Sectors Size Type
/dev/nvme2n1p1 2048 4095 2048 1M BIOS boot
/dev/nvme2n1p2 4096 3901440 3897345 1.9G EFI System
/dev/nvme2n1p3 3903488 2000408575 1996505088 952G Linux filesystem
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
teutat3s in 🌐 nachtigall in ~ took 5m41s
sudo fdisk /dev/nvme3n1
Welcome to fdisk (util-linux 2.39.4).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table.
Created a new DOS (MBR) disklabel with disk identifier 0xa77eb504.
Command (m for help): g
Created a new GPT disklabel (GUID: 56B64CEE-5E0C-4EAA-AE2F-5BF4356183A5).
Command (m for help): n
Partition number (1-128, default 1):
First sector (2048-2000409230, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-2000409230, default 2000408575): 4095
Created a new partition 1 of type 'Linux filesystem' and of size 1 MiB.
Command (m for help): t
Selected partition 1
Partition type or alias (type L to list all): 4
Changed type of partition 'Linux filesystem' to 'BIOS boot'.
Command (m for help): n
Partition number (2-128, default 2):
First sector (4096-2000409230, default 4096):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (4096-2000409230, default 2000408575): 3901440
Created a new partition 2 of type 'Linux filesystem' and of size 1.9 GiB.
Command (m for help): t
Partition number (1,2, default 2): 2
Partition type or alias (type L to list all): 1
Changed type of partition 'Linux filesystem' to 'EFI System'.
Command (m for help): n
Partition number (3-128, default 3):
First sector (3901441-2000409230, default 3903488):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (3903488-2000409230, default 2000408575):
Created a new partition 3 of type 'Linux filesystem' and of size 952 GiB.
Command (m for help): p
Disk /dev/nvme3n1: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: SAMSUNG MZVL21T0HCLR-00B00
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 56B64CEE-5E0C-4EAA-AE2F-5BF4356183A5
Device Start End Sectors Size Type
/dev/nvme3n1p1 2048 4095 2048 1M BIOS boot
/dev/nvme3n1p2 4096 3901440 3897345 1.9G EFI System
/dev/nvme3n1p3 3903488 2000408575 1996505088 952G Linux filesystem
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
teutat3s in 🌐 nachtigall in ~
sudo mkfs.vfat /dev/nvme2n1p2
mkfs.fat 4.2 (2021-01-31)
teutat3s in 🌐 nachtigall in ~
sudo mkfs.vfat /dev/nvme3n1p2
mkfs.fat 4.2 (2021-01-31)
teutat3s in 🌐 nachtigall in ~
lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
nvme0n1
├─nvme0n1p1
├─nvme0n1p2 vfat FAT16 5494-BA1E 385M 21% /boot2
└─nvme0n1p3 zfs_member 5000 root_pool 8287701206764130981
nvme1n1
├─nvme1n1p1
├─nvme1n1p2 vfat FAT32 5493-EFF5 1.8G 5% /boot1
└─nvme1n1p3 zfs_member 5000 root_pool 8287701206764130981
nvme2n1
├─nvme2n1p1
├─nvme2n1p2 vfat FAT32 E4E4-88C7
└─nvme2n1p3
nvme3n1
├─nvme3n1p1
├─nvme3n1p2 vfat FAT32 E76C-A8A0
└─nvme3n1p3
```
Finally, adding the new drives to the ZFS zpool `root_pool` to extend available disk space:
```
teutat3s in 🌐 nachtigall in ~
sudo zpool status
pool: root_pool
state: ONLINE
scan: scrub repaired 0B in 00:17:47 with 0 errors on Sat Mar 1 03:35:20 2025
config:
NAME STATE READ WRITE CKSUM
root_pool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
nvme-SAMSUNG_MZVL21T0HCLR-00B00_S676NF0R517371-part3 ONLINE 0 0 0
nvme-KXG60ZNV1T02_TOSHIBA_Z9NF704ZF9ZL-part3 ONLINE 0 0 0
errors: No known data errors
teutat3s in 🌐 nachtigall in ~
sudo zpool add root_pool mirror nvme-SAMSUNG_MZVL21T0HDLU-00B07_S77WNF0XA01902-part3 nvme-SAMSUNG_MZVL21T0HCLR-00B00_S676NU0W623944-part3
teutat3s in 🌐 nachtigall in ~
sudo zpool status
pool: root_pool
state: ONLINE
scan: scrub repaired 0B in 00:17:47 with 0 errors on Sat Mar 1 03:35:20 2025
config:
NAME STATE READ WRITE CKSUM
root_pool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
nvme-SAMSUNG_MZVL21T0HCLR-00B00_S676NF0R517371-part3 ONLINE 0 0 0
nvme-KXG60ZNV1T02_TOSHIBA_Z9NF704ZF9ZL-part3 ONLINE 0 0 0
mirror-1 ONLINE 0 0 0
nvme-SAMSUNG_MZVL21T0HDLU-00B07_S77WNF0XA01902-part3 ONLINE 0 0 0
nvme-SAMSUNG_MZVL21T0HCLR-00B00_S676NU0W623944-part3 ONLINE 0 0 0
teutat3s in 🌐 nachtigall in ~
sudo zfs list root_pool
NAME USED AVAIL REFER MOUNTPOINT
root_pool 782G 1.04T 192K none
```

19
docs/nextcloud.md Normal file
View file

@ -0,0 +1,19 @@
# Nextcloud debugging
Set loglevel to `0` for debug logs:
```nix
services.nextcloud.settings.loglevel = 0;
```
Then, logs appear in the `phpfpm-nextcloud.service` logs:
```bash
sudo journalctl -fu phpfpm-nextcloud
```
Make sure to set the loglevel back to the default `2` warning after debugging:
```nix
services.nextcloud.settings.loglevel = 2;
```

View file

@ -41,3 +41,7 @@ wrapped-ruby-mastodon-gems: 4.2.1 → 4.2.3
zfs-kernel: 2.2.1-6.1.64 → 2.2.2-6.1.66 zfs-kernel: 2.2.1-6.1.64 → 2.2.2-6.1.66
zfs-user: 2.2.1 → 2.2.2 zfs-user: 2.2.1 → 2.2.2
``` ```
### Deploying updates
See [deploying.md](./deploying.md).

29
docs/nixos-anywhere.md Normal file
View file

@ -0,0 +1,29 @@
# Deploying with nixos-anywhere
## On Target: Enter NixOS from non-NixOS host
In case you cannot boot easily into a nixos-installer image you can download the kexec installer image of NixOS and kexec into it:
```
curl -L https://github.com/nix-community/nixos-images/releases/download/nixos-unstable/nixos-kexec-installer-noninteractive-x86_64-linux.tar.gz | tar -xzf- -C /root
/root/kexec/run
```
## Run Disko
```
nix run github:nix-community/nixos-anywhere -- --flake .#<hostname> --target-host root@<host> --phases disko
```
## On Target: Create inital ssh host key used in initrd
```
mkdir -p /mnt/etc/secrets/initrd
ssh-keygen -t ed25519 -f /mnt/etc/secrets/initrd/ssh_host_ed25519_key
```
## Run NixOS Anywhere
```
nix run github:nix-community/nixos-anywhere -- --flake .#<hostname> --target-host root@<host> --phases install,reboot
```

179
docs/systems-overview.md Normal file
View file

@ -0,0 +1,179 @@
# pub.solar Systems Overview
Last updated: 2025-03-11
Jump to:
1. [Server nachtigall](#server-nachtigall)
2. [Server metronom](#server-metronom)
3. [Server trinkgenossin](#server-trinkgenossin)
4. [Server blue-shell](#server-blue-shell)
5. [Server delite](#server-delite)
6. [Server tankstelle](#server-tankstelle)
7. [Server underground](#server-underground)
8. [Hetzner 1TB storagebox](#hetzner-1tb-storagebox)
### Server nachtigall
**Specs:**
- AMD Ryzen 7 3700X 8-Core Processor
- 64 GB RAM
- 4x 1TB NVMe disks
**Disk layout:**
- Encrypted ZFS mirror vdevs
**Operating System:**
- NixOS 24.11 `linux-x86_64`
**Usage:**
Main pub.solar server. Hosts the majority of pub.solar services. Non-exhaustive list:
- collabora
- coturn
- forgejo
- keycloak
- mailman
- mastodon
- matrix-synapse (homeserver)
- mediawiki
- nextcloud
- owncast
- searx
- tmate
- tt-rss
- obs-portal
### Server metronom
**Specs:**
- Hetzner VPS type: CAX11
- 2 vCPU
- 4 GB RAM
- 40GB disk
**Disk layout:**
- Encrypted ZFS single disk (stripe)
**Operating System:**
- NixOS 24.11 `linux-aach64`
**Usage:**
pub.solar mail server. Note this is an ARM server.
### Server trinkgenossin
**Specs:**
- Strato VPS type: VPS Linux VC8-32
- 8 core AMD EPYC-Milan Processor
- 32 GB RAM
- 1TB NVMe disk
**Disk layout:**
- Encrypted LUKS single disk
**Operating System:**
- NixOS 24.11 `linux-x86_64`
**Usage:**
Monitor, garage cluster node. Services:
- grafana
- loki
- prometheus
- garage
- forgejo-actions-runner (docker)
### Server blue-shell
**Specs:**
- netcup VPS type: VPS 1000 G11
- 4 core AMD EPYC-Rome Processor
- 8 GB RAM
- 256 GB SSD disk
- 850GB mechanical disk
**Disk layout:**
- Encrypted LVM on LUKS single disk and encrypted LUKS garage data disk
**Operating System:**
- NixOS 24.11 `linux-x86_64`
**Usage:**
Garage cluster node.
### Server delite
**Specs:**
- liteserver VPS type: HDD Storage VPS - HDD-2G
- 1 core AMD EPYC 7452
- 2 GB RAM
- 1TB mechanical disk
**Disk layout:**
- Encrypted LVM on LUKS single disk
**Operating System:**
- NixOS 24.11 `linux-x86_64`
**Usage:**
Garage cluster node.
### Server tankstelle
**Specs:**
- 24 core Intel Xeon E5-2670 v2 @ 2.50GHz
- 40 GB RAM
- 80GB SSD disk
**Disk layout:**
- LVM
**Operating System:**
- NixOS 24.11 `linux-x86_64`
**Usage:**
- forgejo-actions-runner (selfhosted, NixOS)
### Server underground
**Specs:**
- 8 core Intel Xeon E5-2670 v2 @ 2.50GHz
- 16 GB RAM
- 40 GB SSD disk
**Disk layout:**
- LVM on LUKS, single disk
**Operating System:**
- NixOS 24.11 `linux-x86_64`
**Usage:**
Testing server.
### Hetzner 1TB storagebox
**Usage:**
Backups get pushed to a Hetzner storagebox every night.

19
docs/zfs-quickstart.md Normal file
View file

@ -0,0 +1,19 @@
# ZFS Quick Start
View current status of the ZFS pool (zpool):
```
sudo zpool status
```
View available disk space of the pool, replace `<pool-name>` with the pool name from the output above:
```
sudo zfs list <pool-name>
```
List all snapshots:
```
sudo zfs list -t snapshot
```

235
flake.lock generated
View file

@ -14,11 +14,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1718371084, "lastModified": 1736955230,
"narHash": "sha256-abpBi61mg0g+lFFU0zY4C6oP6fBwPzbHPKBGw676xsA=", "narHash": "sha256-uenf8fv2eG5bKM8C/UvFaiJMZ4IpUFaQxk9OH5t/1gA=",
"owner": "ryantm", "owner": "ryantm",
"repo": "agenix", "repo": "agenix",
"rev": "3a56735779db467538fb2e577eda28a9daacaca6", "rev": "e600439ec4c273cf11e06fe4d9d906fb98fa097c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -52,11 +52,11 @@
"utils": "utils" "utils": "utils"
}, },
"locked": { "locked": {
"lastModified": 1718194053, "lastModified": 1727447169,
"narHash": "sha256-FaGrf7qwZ99ehPJCAwgvNY5sLCqQ3GDiE/6uLhxxwSY=", "narHash": "sha256-3KyjMPUKHkiWhwR91J1YchF6zb6gvckCAY1jOE+ne0U=",
"owner": "serokell", "owner": "serokell",
"repo": "deploy-rs", "repo": "deploy-rs",
"rev": "3867348fa92bc892eba5d9ddb2d7a97b9e127a8a", "rev": "aa07eb05537d4cd025e2310397a6adcedfe72c76",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -87,6 +87,26 @@
"type": "github" "type": "github"
} }
}, },
"disko": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1741786315,
"narHash": "sha256-VT65AE2syHVj6v/DGB496bqBnu1PXrrzwlw07/Zpllc=",
"owner": "nix-community",
"repo": "disko",
"rev": "0d8c6ad4a43906d14abd5c60e0ffe7b587b213de",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "disko",
"type": "github"
}
},
"element-stickers": { "element-stickers": {
"inputs": { "inputs": {
"maunium-stickerpicker": [ "maunium-stickerpicker": [
@ -165,11 +185,11 @@
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": { "locked": {
"lastModified": 1717285511, "lastModified": 1741352980,
"narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", "narHash": "sha256-+u2UunDA4Cl5Fci3m7S643HzKmIDAe+fiXrLqYsR2fs=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", "rev": "f4330d22f1c5d2ba72d3d22df5597d123fdb60a9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -214,18 +234,19 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_3": { "fork": {
"locked": { "locked": {
"lastModified": 1653893745, "lastModified": 1741180627,
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", "narHash": "sha256-NM2X42gtXuYT7EG+zYcvNTZ/6+CTc3fSiIwdcQcp0dk=",
"owner": "numtide", "owner": "teutat3s",
"repo": "flake-utils", "repo": "nixpkgs",
"rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", "rev": "8a43eb74ac149c080d57d8c80d647fef74df84d8",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "numtide", "owner": "teutat3s",
"repo": "flake-utils", "ref": "init-matrix-authentication-service-module-0.13.0",
"repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
@ -236,16 +257,16 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1718530513, "lastModified": 1742655702,
"narHash": "sha256-BmO8d0r+BVlwWtMLQEYnwmngqdXIuyFzMwvmTcLMee8=", "narHash": "sha256-jbqlw4sPArFtNtA1s3kLg7/A4fzP4GLk9bGbtUJg0JQ=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "a1fddf0967c33754271761d91a3d921772b30d0e", "rev": "0948aeedc296f964140d9429223c7e4a0702a1ff",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-24.05", "ref": "release-24.11",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@ -259,11 +280,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1707424749, "lastModified": 1738012343,
"narHash": "sha256-eTvts5E3zmD4/DoAI9KedQjRwica0cg36wwIVp1NWbM=", "narHash": "sha256-agMgWwVxXII+RtCqok8ROjzpKJung/5N5f2BVDmMC5Q=",
"ref": "main", "ref": "main",
"rev": "1202a23c205b3c07a5feb5caf6813f21b3c69307", "rev": "4ffd7bc8ea032991756c5e8e8a37b039789045bc",
"revCount": 30, "revCount": 38,
"type": "git", "type": "git",
"url": "https://git.pub.solar/pub-solar/keycloak-theme" "url": "https://git.pub.solar/pub-solar/keycloak-theme"
}, },
@ -277,11 +298,11 @@
"flake": false, "flake": false,
"locked": { "locked": {
"dir": "web", "dir": "web",
"lastModified": 1718796561, "lastModified": 1733177811,
"narHash": "sha256-RKAAHve17lrJokgAPkM2k/E+f9djencwwg3Xcd70Yfw=", "narHash": "sha256-1n7bPSCRw7keTCIu4tJGnUlkoId6H1+dPsTPzKo3Rrk=",
"owner": "maunium", "owner": "maunium",
"repo": "stickerpicker", "repo": "stickerpicker",
"rev": "333567f481e60443360aa7199d481e1a45b3a523", "rev": "89d3aece041c85ebe5a1ad4e620388af5227cbb0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -299,11 +320,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1719128254, "lastModified": 1742741935,
"narHash": "sha256-I7jMpq0CAOZA/i70+HDQO/ulLttyQu/K70cSESiMX7A=", "narHash": "sha256-ZCNvPYWkL9hxzgWn1gmYCZItqBU4ujsWjwWNpcwCjfQ=",
"owner": "lnl7", "owner": "lnl7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "50581970f37f06a4719001735828519925ef8310", "rev": "ebb88c3428dcdd95c06dca4d49b9791a65ab777b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -313,98 +334,52 @@
"type": "github" "type": "github"
} }
}, },
"nixos-flake": {
"locked": {
"lastModified": 1719437091,
"narHash": "sha256-UIZasVC36DS5dli1VimK0VgL6JKuxDG9cMxKq1I6OQ0=",
"owner": "srid",
"repo": "nixos-flake",
"rev": "8cefa1e7af06d366f5d3fd7c97e9edbf4d38c476",
"type": "github"
},
"original": {
"owner": "srid",
"repo": "nixos-flake",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1719426051, "lastModified": 1742751704,
"narHash": "sha256-yJL9VYQhaRM7xs0M867ZFxwaONB9T2Q4LnGo1WovuR4=", "narHash": "sha256-rBfc+H1dDBUQ2mgVITMGBPI1PGuCznf9rcWX/XIULyE=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "89c49874fb15f4124bf71ca5f42a04f2ee5825fd", "rev": "f0946fa5f1fb876a9dc2e1850d9d3a4e3f914092",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-24.05", "ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-2205": {
"locked": {
"lastModified": 1685573264,
"narHash": "sha256-Zffu01pONhs/pqH07cjlF10NnMDLok8ix5Uk4rhOnZQ=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "380be19fbd2d9079f677978361792cb25e8a3635",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-22.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-draupnir": {
"locked": {
"lastModified": 1720089221,
"narHash": "sha256-8abrPKFI9eqopZ/ewSeSPen4X9bs6xoyvFsfirvbJmk=",
"owner": "teutat3s",
"repo": "nixpkgs",
"rev": "078583b84242644a668ee29e995bce02192dbd16",
"type": "github"
},
"original": {
"owner": "teutat3s",
"ref": "draupnir-pr",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"nixpkgs-lib": { "nixpkgs-lib": {
"locked": { "locked": {
"lastModified": 1717284937, "lastModified": 1740877520,
"narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=", "narHash": "sha256-oiwv/ZK/2FhGxrCkQkB83i7GnWXPPLzoqFHpDD3uYpk=",
"type": "tarball", "owner": "nix-community",
"url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" "repo": "nixpkgs.lib",
"rev": "147dee35aab2193b174e4c0868bd80ead5ce755c",
"type": "github"
}, },
"original": { "original": {
"type": "tarball", "owner": "nix-community",
"url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" "repo": "nixpkgs.lib",
"type": "github"
} }
}, },
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
"deploy-rs": "deploy-rs", "deploy-rs": "deploy-rs",
"disko": "disko",
"element-stickers": "element-stickers", "element-stickers": "element-stickers",
"element-themes": "element-themes", "element-themes": "element-themes",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"fork": "fork",
"home-manager": "home-manager", "home-manager": "home-manager",
"keycloak-theme-pub-solar": "keycloak-theme-pub-solar", "keycloak-theme-pub-solar": "keycloak-theme-pub-solar",
"maunium-stickerpicker": "maunium-stickerpicker", "maunium-stickerpicker": "maunium-stickerpicker",
"nix-darwin": "nix-darwin", "nix-darwin": "nix-darwin",
"nixos-flake": "nixos-flake",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-2205": "nixpkgs-2205",
"nixpkgs-draupnir": "nixpkgs-draupnir",
"simple-nixos-mailserver": "simple-nixos-mailserver", "simple-nixos-mailserver": "simple-nixos-mailserver",
"triton-vmtools": "triton-vmtools",
"unstable": "unstable" "unstable": "unstable"
} }
}, },
@ -415,22 +390,21 @@
"nixpkgs": [ "nixpkgs": [
"unstable" "unstable"
], ],
"nixpkgs-24_05": [ "nixpkgs-24_11": [
"nixpkgs" "nixpkgs"
], ]
"utils": "utils_2"
}, },
"locked": { "locked": {
"lastModified": 1718084203, "lastModified": 1734884447,
"narHash": "sha256-Cx1xoVfSMv1XDLgKg08CUd1EoTYWB45VmB9XIQzhmzI=", "narHash": "sha256-HA9fAmGNGf0cOYrhgoa+B6BxNVqGAYXfLyx8zIS0ZBY=",
"owner": "simple-nixos-mailserver", "owner": "simple-nixos-mailserver",
"repo": "nixos-mailserver", "repo": "nixos-mailserver",
"rev": "29916981e7b3b5782dc5085ad18490113f8ff63b", "rev": "63209b1def2c9fc891ad271f474a3464a5833294",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
"owner": "simple-nixos-mailserver", "owner": "simple-nixos-mailserver",
"ref": "nixos-24.05", "ref": "nixos-24.11",
"repo": "nixos-mailserver", "repo": "nixos-mailserver",
"type": "gitlab" "type": "gitlab"
} }
@ -495,52 +469,13 @@
"type": "github" "type": "github"
} }
}, },
"systems_5": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"triton-vmtools": {
"inputs": {
"flake-utils": "flake-utils_3",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"dir": "vmtools",
"lastModified": 1698443513,
"narHash": "sha256-wX2JIJ3JmJn6MAurdyjwZU+FZjLCwBArMrVSeeCb/ZU=",
"ref": "main",
"rev": "0d039dcf06afb8cbddd7ac54bae4d0d185f3e88e",
"revCount": 85,
"type": "git",
"url": "https://git.pub.solar/pub-solar/infra-vintage?dir=vmtools"
},
"original": {
"dir": "vmtools",
"ref": "main",
"type": "git",
"url": "https://git.pub.solar/pub-solar/infra-vintage?dir=vmtools"
}
},
"unstable": { "unstable": {
"locked": { "locked": {
"lastModified": 1719254875, "lastModified": 1742669843,
"narHash": "sha256-ECni+IkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko=", "narHash": "sha256-G5n+FOXLXcRx+3hCJ6Rt6ZQyF1zqQ0DL0sWAMn2Nk0w=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "2893f56de08021cffd9b6b6dfc70fd9ccd51eb60", "rev": "1e5b653dff12029333a6546c11e108ede13052eb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -567,24 +502,6 @@
"repo": "flake-utils", "repo": "flake-utils",
"type": "github" "type": "github"
} }
},
"utils_2": {
"inputs": {
"systems": "systems_5"
},
"locked": {
"lastModified": 1709126324,
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "d465f4819400de7c8d874d50b982301f28a84605",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

100
flake.nix
View file

@ -1,24 +1,24 @@
{ {
inputs = { inputs = {
# Track channels with commits tested and built by hydra # Track channels with commits tested and built by hydra
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
unstable.url = "github:nixos/nixpkgs/nixos-unstable"; unstable.url = "github:nixos/nixpkgs/nixos-unstable";
fork.url = "github:teutat3s/nixpkgs/init-matrix-authentication-service-module-0.13.0";
nixpkgs-2205.url = "github:nixos/nixpkgs/nixos-22.05";
nixpkgs-draupnir.url = "github:teutat3s/nixpkgs/draupnir-pr";
nix-darwin.url = "github:lnl7/nix-darwin/master"; nix-darwin.url = "github:lnl7/nix-darwin/master";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager/release-24.05"; home-manager.url = "github:nix-community/home-manager/release-24.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
nixos-flake.url = "github:srid/nixos-flake";
deploy-rs.url = "github:serokell/deploy-rs"; deploy-rs.url = "github:serokell/deploy-rs";
deploy-rs.inputs.nixpkgs.follows = "nixpkgs"; deploy-rs.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
agenix.url = "github:ryantm/agenix"; agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs"; agenix.inputs.nixpkgs.follows = "nixpkgs";
agenix.inputs.darwin.follows = "nix-darwin"; agenix.inputs.darwin.follows = "nix-darwin";
@ -27,9 +27,6 @@
keycloak-theme-pub-solar.url = "git+https://git.pub.solar/pub-solar/keycloak-theme?ref=main"; keycloak-theme-pub-solar.url = "git+https://git.pub.solar/pub-solar/keycloak-theme?ref=main";
keycloak-theme-pub-solar.inputs.nixpkgs.follows = "nixpkgs"; keycloak-theme-pub-solar.inputs.nixpkgs.follows = "nixpkgs";
triton-vmtools.url = "git+https://git.pub.solar/pub-solar/infra-vintage?ref=main&dir=vmtools";
triton-vmtools.inputs.nixpkgs.follows = "nixpkgs";
element-themes.url = "github:aaronraimist/element-themes/master"; element-themes.url = "github:aaronraimist/element-themes/master";
element-themes.flake = false; element-themes.flake = false;
@ -40,8 +37,8 @@
element-stickers.inputs.maunium-stickerpicker.follows = "maunium-stickerpicker"; element-stickers.inputs.maunium-stickerpicker.follows = "maunium-stickerpicker";
element-stickers.inputs.nixpkgs.follows = "nixpkgs"; element-stickers.inputs.nixpkgs.follows = "nixpkgs";
simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.05"; simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.11";
simple-nixos-mailserver.inputs.nixpkgs-24_05.follows = "nixpkgs"; simple-nixos-mailserver.inputs.nixpkgs-24_11.follows = "nixpkgs";
simple-nixos-mailserver.inputs.nixpkgs.follows = "unstable"; simple-nixos-mailserver.inputs.nixpkgs.follows = "unstable";
}; };
@ -54,7 +51,6 @@
]; ];
imports = [ imports = [
inputs.nixos-flake.flakeModule
./logins ./logins
./lib ./lib
./overlays ./overlays
@ -66,6 +62,7 @@
system, system,
pkgs, pkgs,
config, config,
lib,
... ...
}: }:
{ {
@ -76,12 +73,51 @@
overlays = [ inputs.agenix.overlays.default ]; overlays = [ inputs.agenix.overlays.default ];
}; };
unstable = import inputs.unstable { inherit system; }; unstable = import inputs.unstable { inherit system; };
master = import inputs.master { inherit system; };
}; };
checks =
let
machinesPerSystem = {
aarch64-linux = [
"metronom"
];
x86_64-linux = [
"blue-shell"
"delite"
"nachtigall"
"tankstelle"
"trinkgenossin"
"underground"
];
};
nixosMachines = inputs.nixpkgs.lib.mapAttrs' (n: inputs.nixpkgs.lib.nameValuePair "nixos-${n}") (
inputs.nixpkgs.lib.genAttrs (machinesPerSystem.${system} or [ ]) (
name: self.nixosConfigurations.${name}.config.system.build.toplevel
)
);
nixos-lib = import (inputs.nixpkgs + "/nixos/lib") { };
testDir = builtins.attrNames (builtins.readDir ./tests);
testFiles = builtins.filter (n: builtins.match "^.*.nix$" n != null) testDir;
in
builtins.listToAttrs (
map (x: {
name = "test-${lib.strings.removeSuffix ".nix" x}";
value = nixos-lib.runTest (
import (./tests + "/${x}") {
inherit self;
inherit pkgs;
inherit lib;
inherit config;
}
);
}) testFiles
)
// nixosMachines;
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [ buildInputs = with pkgs; [
deploy-rs deploy-rs
nixpkgs-fmt nix-fast-build
agenix agenix
age-plugin-yubikey age-plugin-yubikey
cachix cachix
@ -90,22 +126,19 @@
nvfetcher nvfetcher
shellcheck shellcheck
shfmt shfmt
treefmt treefmt2
nixos-generators nixos-generators
inputs.nixpkgs-2205.legacyPackages.${system}.terraform opentofu
terraform-backend-git
terraform-ls
jq jq
]; ];
}; };
devShells.ci = pkgs.mkShell { buildInputs = with pkgs; [ nodejs ]; }; devShells.ci = pkgs.mkShell { buildInputs = with pkgs; [ nodejs ]; };
}; };
flake = flake = {
let
username = "barkeeper";
in
{
inherit username;
nixosModules = builtins.listToAttrs ( nixosModules = builtins.listToAttrs (
map (x: { map (x: {
name = x; name = x;
@ -117,24 +150,29 @@
system: deployLib: deployLib.deployChecks self.deploy system: deployLib: deployLib.deployChecks self.deploy
) inputs.deploy-rs.lib; ) inputs.deploy-rs.lib;
formatter."x86_64-linux" = inputs.unstable.legacyPackages."x86_64-linux".nixfmt-rfc-style; formatter."x86_64-linux" = inputs.nixpkgs.legacyPackages."x86_64-linux".nixfmt-rfc-style;
deploy.nodes = self.lib.deploy.mkDeployNodes self.nixosConfigurations { deploy.nodes = self.lib.deploy.mkDeployNodes self.nixosConfigurations {
nachtigall = { nachtigall = {
hostname = "nachtigall.wg.pub.solar"; hostname = "nachtigall.wg.pub.solar";
sshUser = username;
};
flora-6 = {
hostname = "flora-6.wg.pub.solar";
sshUser = username;
}; };
metronom = { metronom = {
hostname = "metronom.wg.pub.solar"; hostname = "metronom.wg.pub.solar";
sshUser = username;
}; };
tankstelle = { tankstelle = {
hostname = "tankstelle.wg.pub.solar"; hostname = "tankstelle.wg.pub.solar";
sshUser = username; };
underground = {
hostname = "80.244.242.3";
};
trinkgenossin = {
hostname = "trinkgenossin.wg.pub.solar";
};
delite = {
hostname = "delite.wg.pub.solar";
};
blue-shell = {
hostname = "blue-shell.wg.pub.solar";
}; };
}; };
}; };

View file

@ -0,0 +1,33 @@
{
config,
lib,
pkgs,
...
}:
{
boot.loader.grub.enable = true;
boot.kernelParams = [
"boot.shell_on_fail=1"
"ip=dhcp"
];
# This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
#
# Most users should NEVER change this value after the initial install, for any reason,
# even if you've upgraded your system to a new NixOS release.
#
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
# to actually do that.
#
# This value being lower than the current NixOS release does NOT mean your system is
# out of date, out of support, or vulnerable.
#
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "24.05"; # Did you read the comment?
}

View file

@ -1,11 +1,13 @@
{ ... }: { flake, ... }:
{ {
imports = [ imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
./configuration.nix ./configuration.nix
./triton-vmtools.nix ./disk-config.nix
./networking.nix
./wireguard.nix ./wireguard.nix
#./backups.nix
]; ];
} }

View file

@ -0,0 +1,101 @@
{
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/vdb";
content = {
type = "gpt";
partitions = {
bios = {
size = "1M";
type = "EF02"; # for grub MBR
};
boot = {
size = "1G";
type = "8300";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/boot";
mountOptions = [ "defaults" ];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "cryptroot";
extraOpenArgs = [ ];
# if you want to use the key for interactive login be sure there is no trailing newline
# for example use `echo -n "password" > /tmp/secret.key`
passwordFile = "/tmp/luks-password";
content = {
type = "lvm_pv";
vg = "vg0";
};
};
};
};
};
};
data = {
type = "disk";
device = "/dev/vdc";
content = {
type = "gpt";
partitions = {
luks = {
size = "100%";
content = {
type = "luks";
name = "cryptdata";
extraOpenArgs = [ ];
# if you want to use the key for interactive login be sure there is no trailing newline
# for example use `echo -n "password" > /tmp/secret.key`
passwordFile = "/tmp/luks-password";
content = {
type = "filesystem";
format = "xfs";
mountpoint = "/var/lib/garage/data";
mountOptions = [ "defaults" ];
};
};
};
};
};
};
};
lvm_vg = {
vg0 = {
type = "lvm_vg";
lvs = {
root = {
size = "100G";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
mountOptions = [ "defaults" ];
};
};
swap = {
size = "16G";
content = {
type = "swap";
};
};
metadata = {
size = "50G";
content = {
type = "filesystem";
format = "btrfs";
mountpoint = "/var/lib/garage/meta";
mountOptions = [ "defaults" ];
};
};
};
};
};
};
}

View file

@ -0,0 +1,27 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"virtio_pci"
"sr_mod"
"virtio_blk"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

View file

@ -0,0 +1,26 @@
{
config,
pkgs,
flake,
...
}:
{
services.garage.settings.rpc_public_addr = "[2a03:4000:43:24e::1]:3901";
networking.hostName = "blue-shell";
networking.hostId = "00000005";
networking.useDHCP = false;
systemd.network.enable = true;
systemd.network.networks."10-wan" = {
matchConfig.Name = "ens3";
address = [
"194.13.83.205/22"
"2a03:4000:43:24e::1/64"
];
gateway = [
"194.13.80.1"
"fe80::1"
];
};
}

View file

@ -0,0 +1,51 @@
{
config,
pkgs,
flake,
...
}:
let
wireguardIPv4 = "10.7.6.7";
wireguardIPv6 = "fd00:fae:fae:fae:fae:7::";
in
{
networking.firewall.allowedUDPPorts = [ 51820 ];
age.secrets.wg-private-key.file = "${flake.self}/secrets/blue-shell-wg-private-key.age";
networking.wireguard.interfaces = {
wg-ssh = {
listenPort = 51820;
mtu = 1300;
ips = [
"${wireguardIPv4}/32"
"${wireguardIPv6}/96"
];
privateKeyFile = config.age.secrets.wg-private-key.path;
peers = flake.self.logins.wireguardDevices ++ [
{
# trinkgenossin.pub.solar
publicKey = "QWgHovHxtqiQhnHLouSWiT6GIoQDmuvnThYL5c/rvU4=";
allowedIPs = [
"10.7.6.5/32"
"fd00:fae:fae:fae:fae:5::/96"
];
#endpoint = "85.215.152.22:51820";
endpoint = "[2a01:239:35d:f500::1]:51820";
persistentKeepalive = 15;
}
];
};
};
services.openssh.listenAddresses = [
{
addr = wireguardIPv4;
port = 22;
}
{
addr = "[${wireguardIPv6}]";
port = 22;
}
];
}

View file

@ -1,9 +1,35 @@
{ self, ... }: {
self,
inputs,
config,
...
}:
{ {
flake = { flake = {
nixosConfigurations = { nixosModules = {
nachtigall = self.nixos-flake.lib.mkLinuxSystem { home-manager = {
imports = [ imports = [
inputs.home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
flake = {
inherit self inputs config;
};
};
}
];
};
};
nixosConfigurations = {
nachtigall = self.inputs.nixpkgs.lib.nixosSystem {
specialArgs = {
flake = {
inherit self inputs config;
};
};
modules = [
self.inputs.agenix.nixosModules.default self.inputs.agenix.nixosModules.default
self.nixosModules.home-manager self.nixosModules.home-manager
./nachtigall ./nachtigall
@ -11,6 +37,7 @@
self.nixosModules.unlock-zfs-on-boot self.nixosModules.unlock-zfs-on-boot
self.nixosModules.core self.nixosModules.core
self.nixosModules.docker self.nixosModules.docker
self.nixosModules.backups
self.nixosModules.nginx self.nixosModules.nginx
self.nixosModules.collabora self.nixosModules.collabora
@ -33,41 +60,29 @@
self.nixosModules.promtail self.nixosModules.promtail
self.nixosModules.searx self.nixosModules.searx
self.nixosModules.tmate self.nixosModules.tmate
self.nixosModules.tt-rss
self.nixosModules.obs-portal self.nixosModules.obs-portal
self.nixosModules.matrix self.nixosModules.matrix
self.nixosModules.matrix-draupnir
self.nixosModules.matrix-irc self.nixosModules.matrix-irc
self.nixosModules.matrix-telegram self.nixosModules.matrix-telegram
self.nixosModules.nginx-matrix self.nixosModules.nginx-matrix
]; ];
}; };
flora-6 = self.nixos-flake.lib.mkLinuxSystem { metronom = self.inputs.nixpkgs.lib.nixosSystem {
imports = [ specialArgs = {
self.inputs.agenix.nixosModules.default flake = {
self.nixosModules.home-manager inherit self inputs config;
./flora-6
self.nixosModules.overlays
self.nixosModules.core
self.nixosModules.keycloak
self.nixosModules.caddy
self.nixosModules.drone
self.nixosModules.forgejo-actions-runner
self.nixosModules.grafana
self.nixosModules.prometheus
self.nixosModules.loki
];
}; };
};
metronom = self.nixos-flake.lib.mkLinuxSystem { modules = [
imports = [
self.inputs.agenix.nixosModules.default self.inputs.agenix.nixosModules.default
self.nixosModules.home-manager self.nixosModules.home-manager
./metronom ./metronom
self.nixosModules.overlays self.nixosModules.overlays
self.nixosModules.unlock-zfs-on-boot self.nixosModules.unlock-zfs-on-boot
self.nixosModules.core self.nixosModules.core
self.nixosModules.backups
self.nixosModules.mail self.nixosModules.mail
self.nixosModules.prometheus-exporters self.nixosModules.prometheus-exporters
self.nixosModules.promtail self.nixosModules.promtail
@ -76,17 +91,117 @@
]; ];
}; };
tankstelle = self.nixos-flake.lib.mkLinuxSystem { tankstelle = self.inputs.nixpkgs.lib.nixosSystem {
imports = [ specialArgs = {
flake = {
inherit self inputs config;
};
};
modules = [
self.inputs.agenix.nixosModules.default self.inputs.agenix.nixosModules.default
self.nixosModules.home-manager self.nixosModules.home-manager
./tankstelle ./tankstelle
self.nixosModules.overlays self.nixosModules.overlays
self.nixosModules.core self.nixosModules.core
self.nixosModules.backups
self.nixosModules.prometheus-exporters self.nixosModules.prometheus-exporters
self.nixosModules.promtail self.nixosModules.promtail
]; ];
}; };
trinkgenossin = self.inputs.nixpkgs.lib.nixosSystem {
specialArgs = {
flake = {
inherit self inputs config;
};
};
modules = [
self.inputs.agenix.nixosModules.default
self.nixosModules.home-manager
./trinkgenossin
self.nixosModules.backups
self.nixosModules.overlays
self.nixosModules.unlock-luks-on-boot
self.nixosModules.core
self.nixosModules.garage
self.nixosModules.nginx
# This module is already using options, and those options are used by the grafana module
self.nixosModules.keycloak
self.nixosModules.grafana
self.nixosModules.prometheus
self.nixosModules.loki
];
};
delite = self.inputs.nixpkgs.lib.nixosSystem {
specialArgs = {
flake = {
inherit self inputs config;
};
};
modules = [
self.inputs.agenix.nixosModules.default
self.inputs.disko.nixosModules.disko
self.nixosModules.home-manager
./delite
self.nixosModules.overlays
self.nixosModules.unlock-luks-on-boot
self.nixosModules.core
self.nixosModules.prometheus-exporters
self.nixosModules.promtail
self.nixosModules.garage
self.nixosModules.nginx
];
};
blue-shell = self.inputs.nixpkgs.lib.nixosSystem {
specialArgs = {
flake = {
inherit self inputs config;
};
};
modules = [
self.inputs.agenix.nixosModules.default
self.inputs.disko.nixosModules.disko
self.nixosModules.home-manager
./blue-shell
self.nixosModules.overlays
self.nixosModules.unlock-luks-on-boot
self.nixosModules.core
self.nixosModules.prometheus-exporters
self.nixosModules.promtail
self.nixosModules.garage
self.nixosModules.nginx
];
};
underground = self.inputs.nixpkgs.lib.nixosSystem {
specialArgs = {
flake = {
inherit self inputs config;
};
};
modules = [
self.inputs.agenix.nixosModules.default
self.nixosModules.home-manager
./underground
self.nixosModules.overlays
self.nixosModules.unlock-luks-on-boot
self.nixosModules.core
self.nixosModules.backups
self.nixosModules.keycloak
self.nixosModules.postgresql
self.nixosModules.matrix
self.nixosModules.matrix-irc
self.nixosModules.nginx
self.nixosModules.nginx-matrix
];
};
}; };
}; };
} }

View file

@ -0,0 +1,33 @@
{
flake,
config,
pkgs,
...
}:
{
boot.loader.grub.enable = true;
boot.kernelParams = [
"boot.shell_on_fail=1"
"ip=5.255.119.132::5.255.119.1:255.255.255.0:delite::off"
];
# This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
#
# Most users should NEVER change this value after the initial install, for any reason,
# even if you've upgraded your system to a new NixOS release.
#
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
# to actually do that.
#
# This value being lower than the current NixOS release does NOT mean your system is
# out of date, out of support, or vulnerable.
#
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "24.05"; # Did you read the comment?
}

13
hosts/delite/default.nix Normal file
View file

@ -0,0 +1,13 @@
{ flake, ... }:
{
imports = [
./hardware-configuration.nix
./configuration.nix
./disk-config.nix
./networking.nix
./wireguard.nix
#./backups.nix
];
}

View file

@ -0,0 +1,84 @@
{
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/vda";
content = {
type = "gpt";
partitions = {
bios = {
size = "1M";
type = "EF02"; # for grub MBR
};
boot = {
size = "1G";
type = "8300";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/boot";
mountOptions = [ "defaults" ];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "cryptroot";
extraOpenArgs = [ ];
# if you want to use the key for interactive login be sure there is no trailing newline
# for example use `echo -n "password" > /tmp/secret.key`
passwordFile = "/tmp/luks-password";
content = {
type = "lvm_pv";
vg = "vg0";
};
};
};
};
};
};
};
lvm_vg = {
vg0 = {
type = "lvm_vg";
lvs = {
root = {
size = "40G";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
mountOptions = [ "defaults" ];
};
};
swap = {
size = "8G";
content = {
type = "swap";
};
};
data = {
size = "800G";
content = {
type = "filesystem";
format = "xfs";
mountpoint = "/var/lib/garage/data";
mountOptions = [ "defaults" ];
};
};
metadata = {
size = "50G";
content = {
type = "filesystem";
format = "btrfs";
mountpoint = "/var/lib/garage/meta";
mountOptions = [ "defaults" ];
};
};
};
};
};
};
}

View file

@ -0,0 +1,26 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot.initrd.availableKernelModules = [
"ata_piix"
"uhci_hcd"
"virtio_pci"
"virtio_blk"
];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

View file

@ -0,0 +1,26 @@
{
config,
pkgs,
flake,
...
}:
{
services.garage.settings.rpc_public_addr = "[2a04:52c0:124:9d8c::2]:3901";
networking.hostName = "delite";
networking.hostId = "00000004";
networking.useDHCP = false;
systemd.network.enable = true;
systemd.network.networks."10-wan" = {
matchConfig.Name = "ens3";
address = [
"5.255.119.132/24"
"2a04:52c0:124:9d8c::2/48"
];
gateway = [
"5.255.119.1"
"2a04:52c0:124::1"
];
};
}

View file

@ -0,0 +1,51 @@
{
config,
pkgs,
flake,
...
}:
let
wireguardIPv4 = "10.7.6.6";
wireguardIPv6 = "fd00:fae:fae:fae:fae:6::";
in
{
networking.firewall.allowedUDPPorts = [ 51820 ];
age.secrets.wg-private-key.file = "${flake.self}/secrets/delite-wg-private-key.age";
networking.wireguard.interfaces = {
wg-ssh = {
listenPort = 51820;
mtu = 1300;
ips = [
"${wireguardIPv4}/32"
"${wireguardIPv6}/96"
];
privateKeyFile = config.age.secrets.wg-private-key.path;
peers = flake.self.logins.wireguardDevices ++ [
{
# trinkgenossin.pub.solar
publicKey = "QWgHovHxtqiQhnHLouSWiT6GIoQDmuvnThYL5c/rvU4=";
allowedIPs = [
"10.7.6.5/32"
"fd00:fae:fae:fae:fae:5::/96"
];
#endpoint = "85.215.152.22:51820";
endpoint = "[2a01:239:35d:f500::1]:51820";
persistentKeepalive = 15;
}
];
};
};
services.openssh.listenAddresses = [
{
addr = wireguardIPv4;
port = 22;
}
{
addr = "[${wireguardIPv6}]";
port = 22;
}
];
}

View file

@ -1,72 +0,0 @@
{
config,
lib,
pkgs,
flake,
...
}:
let
psCfg = config.pub-solar;
in
{
config = {
# Override nix.conf for more agressive garbage collection
nix.extraOptions = lib.mkForce ''
experimental-features = flakes nix-command
min-free = 536870912
keep-outputs = false
keep-derivations = false
fallback = true
'';
# # #
# # # Triton host specific options
# # # DO NOT ALTER below this line, changes might render system unbootable
# # #
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Force getting the hostname from cloud-init
networking.hostName = lib.mkDefault "";
# We use cloud-init to configure networking, this option should fix
# systemd-networkd-wait-online timeouts
#systemd.services."systemd-networkd".environment.SYSTEMD_LOG_LEVEL = "debug";
systemd.network.wait-online.ignoredInterfaces = [
"docker0"
"wg-ssh"
];
# List services that you want to enable:
services.cloud-init.enable = true;
services.cloud-init.ext4.enable = true;
services.cloud-init.network.enable = true;
# use the default NixOS cloud-init config, but add some SmartOS customization to it
environment.etc."cloud/cloud.cfg.d/90_smartos.cfg".text = ''
datasource_list: [ SmartOS ]
# Do not create the centos/ubuntu/debian user
users: [ ]
# mount second disk with label ephemeral0, gets formated by cloud-init
# this will fail to get added to /etc/fstab as it's read-only, but should
# mount at boot anyway
mounts:
- [ vdb, /data, auto, "defaults,nofail" ]
'';
# We manage the firewall with nix, too
# altough triton can also manage firewall rules via the triton fwrule subcommand
networking.firewall.enable = true;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.05"; # Did you read the comment?
};
}

View file

@ -1,6 +0,0 @@
{ pkgs, flake, ... }:
{
environment.systemPackages = with pkgs; [
flake.inputs.triton-vmtools.packages.${pkgs.system}.default
];
}

View file

@ -1,13 +1,29 @@
{ flake, ... }: { config, flake, ... }:
{ {
age.secrets."restic-repo-droppie" = { age.secrets."restic-repo-storagebox-metronom" = {
file = "${flake.self}/secrets/restic-repo-droppie.age"; file = "${flake.self}/secrets/restic-repo-storagebox-metronom.age";
mode = "400"; mode = "400";
owner = "root"; owner = "root";
}; };
age.secrets."restic-repo-storagebox" = { age.secrets.restic-repo-garage-metronom = {
file = "${flake.self}/secrets/restic-repo-storagebox.age"; file = "${flake.self}/secrets/restic-repo-garage-metronom.age";
mode = "400"; mode = "400";
owner = "root"; owner = "root";
}; };
age.secrets.restic-repo-garage-metronom-env = {
file = "${flake.self}/secrets/restic-repo-garage-metronom-env.age";
mode = "400";
owner = "root";
};
pub-solar-os.backups.repos.storagebox = {
passwordFile = config.age.secrets."restic-repo-storagebox-metronom".path;
repository = "sftp:u377325@u377325.your-storagebox.de:/metronom-backups";
};
pub-solar-os.backups.repos.garage = {
passwordFile = config.age.secrets."restic-repo-garage-metronom".path;
environmentFile = config.age.secrets."restic-repo-garage-metronom-env".path;
repository = "s3:https://buckets.pub.solar/metronom-backups";
};
} }

View file

@ -23,6 +23,14 @@
pools = [ "root_pool" ]; pools = [ "root_pool" ];
}; };
# Declarative SSH private key
age.secrets."metronom-root-ssh-key" = {
file = "${flake.self}/secrets/metronom-root-ssh-key.age";
path = "/root/.ssh/id_ed25519";
mode = "400";
owner = "root";
};
# Declarative SSH private key # Declarative SSH private key
#age.secrets."metronom-root-ssh-key" = { #age.secrets."metronom-root-ssh-key" = {
# file = "${flake.self}/secrets/metronom-root-ssh-key.age"; # file = "${flake.self}/secrets/metronom-root-ssh-key.age";

View file

@ -7,6 +7,6 @@
./networking.nix ./networking.nix
./wireguard.nix ./wireguard.nix
#./backups.nix ./backups.nix
]; ];
} }

View file

@ -18,16 +18,7 @@
"fd00:fae:fae:fae:fae:3::/96" "fd00:fae:fae:fae:fae:3::/96"
]; ];
privateKeyFile = config.age.secrets.wg-private-key.path; privateKeyFile = config.age.secrets.wg-private-key.path;
peers = flake.self.logins.admins.wireguardDevices ++ [ peers = flake.self.logins.wireguardDevices ++ [
{
# flora-6.pub.solar
endpoint = "80.71.153.210:51820";
publicKey = "jtSR5G2P/nm9s8WrVc26Xc/SQLupRxyXE+5eIeqlsTU=";
allowedIPs = [
"10.7.6.2/32"
"fd00:fae:fae:fae:fae:2::/96"
];
}
{ {
# nachtigall.pub.solar # nachtigall.pub.solar
endpoint = "138.201.80.102:51820"; endpoint = "138.201.80.102:51820";
@ -37,6 +28,17 @@
"fd00:fae:fae:fae:fae:1::/96" "fd00:fae:fae:fae:fae:1::/96"
]; ];
} }
{
# trinkgenossin.pub.solar
publicKey = "QWgHovHxtqiQhnHLouSWiT6GIoQDmuvnThYL5c/rvU4=";
allowedIPs = [
"10.7.6.5/32"
"fd00:fae:fae:fae:fae:5::/96"
];
#endpoint = "85.215.152.22:51820";
endpoint = "[2a01:239:35d:f500::1]:51820";
persistentKeepalive = 15;
}
]; ];
}; };
}; };

View file

@ -1,13 +1,34 @@
{ flake, ... }: { config, flake, ... }:
{ {
age.secrets."restic-repo-droppie" = { age.secrets."restic-repo-droppie" = {
file = "${flake.self}/secrets/restic-repo-droppie.age"; file = "${flake.self}/secrets/restic-repo-droppie.age";
mode = "400"; mode = "400";
owner = "root"; owner = "root";
}; };
age.secrets."restic-repo-storagebox" = { age.secrets."restic-repo-storagebox-nachtigall" = {
file = "${flake.self}/secrets/restic-repo-storagebox.age"; file = "${flake.self}/secrets/restic-repo-storagebox-nachtigall.age";
mode = "400"; mode = "400";
owner = "root"; owner = "root";
}; };
age.secrets.restic-repo-garage-nachtigall = {
file = "${flake.self}/secrets/restic-repo-garage-nachtigall.age";
mode = "400";
owner = "root";
};
age.secrets.restic-repo-garage-nachtigall-env = {
file = "${flake.self}/secrets/restic-repo-garage-nachtigall-env.age";
mode = "400";
owner = "root";
};
pub-solar-os.backups.repos.storagebox = {
passwordFile = config.age.secrets."restic-repo-storagebox-nachtigall".path;
repository = "sftp:u377325@u377325.your-storagebox.de:/backups";
};
pub-solar-os.backups.repos.garage = {
passwordFile = config.age.secrets."restic-repo-garage-nachtigall".path;
environmentFile = config.age.secrets."restic-repo-garage-nachtigall-env".path;
repository = "s3:https://buckets.pub.solar/nachtigall-backups";
};
} }

View file

@ -20,6 +20,14 @@
devices = [ "/dev/disk/by-id/nvme-KXG60ZNV1T02_TOSHIBA_Z9NF704ZF9ZL" ]; devices = [ "/dev/disk/by-id/nvme-KXG60ZNV1T02_TOSHIBA_Z9NF704ZF9ZL" ];
path = "/boot2"; path = "/boot2";
} }
{
devices = [ "/dev/disk/by-id/nvme-SAMSUNG_MZVL21T0HDLU-00B07_S77WNF0XA01902" ];
path = "/boot3";
}
{
devices = [ "/dev/disk/by-id/nvme-SAMSUNG_MZVL21T0HCLR-00B00_S676NU0W623944" ];
path = "/boot4";
}
]; ];
copyKernels = true; copyKernels = true;
}; };
@ -48,9 +56,79 @@
owner = "root"; owner = "root";
}; };
pub-solar-os.auth.enable = true; # keycloak
age.secrets.keycloak-database-password = {
file = "${flake.self}/secrets/keycloak-database-password.age";
mode = "600";
#owner = "keycloak";
};
nixpkgs.config.permittedInsecurePackages = [ "keycloak-23.0.6" ]; pub-solar-os.auth = {
enable = true;
database-password-file = config.age.secrets.keycloak-database-password.path;
};
# matrix-synapse
age.secrets."matrix-synapse-signing-key" = {
file = "${flake.self}/secrets/matrix-synapse-signing-key.age";
mode = "400";
owner = "matrix-synapse";
};
age.secrets."matrix-synapse-secret-config.yaml" = {
file = "${flake.self}/secrets/matrix-synapse-secret-config.yaml.age";
mode = "400";
owner = "matrix-synapse";
};
age.secrets."matrix-authentication-service-secret-config.yml" = {
file = "${flake.self}/secrets/matrix-authentication-service-secret-config.yml.age";
mode = "400";
owner = "matrix-authentication-service";
};
# matrix-appservice-irc
age.secrets."matrix-appservice-irc-mediaproxy-signing-key" = {
file = "${flake.self}/secrets/matrix-appservice-irc-mediaproxy-signing-key.jwk.age";
mode = "400";
owner = "matrix-appservice-irc";
};
pub-solar-os.matrix = {
enable = true;
appservice-irc.mediaproxy.signingKeyPath =
config.age.secrets."matrix-appservice-irc-mediaproxy-signing-key".path;
synapse = {
signing_key_path = config.age.secrets."matrix-synapse-signing-key".path;
extra-config-files = [
config.age.secrets."matrix-synapse-secret-config.yaml".path
# The registration file is automatically generated after starting the
# appservice for the first time.
# cp /var/lib/mautrix-telegram/telegram-registration.yaml \
# /var/lib/matrix-synapse/
# chown matrix-synapse:matrix-synapse \
# /var/lib/matrix-synapse/telegram-registration.yaml
"/var/lib/matrix-synapse/telegram-registration.yaml"
];
app-service-config-files = [
"/var/lib/matrix-synapse/telegram-registration.yaml"
"/var/lib/matrix-appservice-irc/registration.yml"
# "/matrix-appservice-slack-registration.yaml"
# "/hookshot-registration.yml"
# "/matrix-mautrix-signal-registration.yaml"
# "/matrix-mautrix-telegram-registration.yaml"
];
};
matrix-authentication-service.extra-config-files = [
config.age.secrets."matrix-authentication-service-secret-config.yml".path
];
};
systemd.services.postgresql = {
after = [ "var-lib-postgresql.mount" ];
requisite = [ "var-lib-postgresql.mount" ];
};
# This value determines the NixOS release with which your system is to be # This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database # compatible, in order to avoid breaking some software such as database

View file

@ -9,5 +9,10 @@
./networking.nix ./networking.nix
./wireguard.nix ./wireguard.nix
./backups.nix ./backups.nix
"${flake.inputs.fork}/nixos/modules/services/matrix/matrix-authentication-service.nix"
];
disabledModules = [
"services/matrix/matrix-authentication-service.nix"
]; ];
} }

View file

@ -50,6 +50,16 @@
fsType = "vfat"; fsType = "vfat";
}; };
fileSystems."/boot3" = {
device = "/dev/disk/by-uuid/E4E4-88C7";
fsType = "vfat";
};
fileSystems."/boot4" = {
device = "/dev/disk/by-uuid/E76C-A8A0";
fsType = "vfat";
};
swapDevices = [ ]; swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking

View file

@ -18,16 +18,7 @@
"fd00:fae:fae:fae:fae:1::/96" "fd00:fae:fae:fae:fae:1::/96"
]; ];
privateKeyFile = config.age.secrets.wg-private-key.path; privateKeyFile = config.age.secrets.wg-private-key.path;
peers = flake.self.logins.admins.wireguardDevices ++ [ peers = flake.self.logins.wireguardDevices ++ [
{
# flora-6.pub.solar
endpoint = "80.71.153.210:51820";
publicKey = "jtSR5G2P/nm9s8WrVc26Xc/SQLupRxyXE+5eIeqlsTU=";
allowedIPs = [
"10.7.6.2/32"
"fd00:fae:fae:fae:fae:2::/96"
];
}
{ {
# tankstelle.pub.solar # tankstelle.pub.solar
endpoint = "80.244.242.5:51820"; endpoint = "80.244.242.5:51820";
@ -37,6 +28,17 @@
"fd00:fae:fae:fae:fae:4::/96" "fd00:fae:fae:fae:fae:4::/96"
]; ];
} }
{
# trinkgenossin.pub.solar
publicKey = "QWgHovHxtqiQhnHLouSWiT6GIoQDmuvnThYL5c/rvU4=";
allowedIPs = [
"10.7.6.5/32"
"fd00:fae:fae:fae:fae:5::/96"
];
#endpoint = "85.215.152.22:51820";
endpoint = "[2a01:239:35d:f500::1]:51820";
persistentKeepalive = 15;
}
]; ];
}; };
}; };

View file

@ -5,8 +5,8 @@
mode = "400"; mode = "400";
owner = "root"; owner = "root";
}; };
age.secrets."restic-repo-storagebox" = { age.secrets."restic-repo-storagebox-tankstelle" = {
file = "${flake.self}/secrets/restic-repo-storagebox.age"; file = "${flake.self}/secrets/restic-repo-storagebox-tankstelle.age";
mode = "400"; mode = "400";
owner = "root"; owner = "root";
}; };

View file

@ -10,6 +10,9 @@
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
# kernel same-page merging
hardware.ksm.enable = true;
boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
system.stateVersion = "23.11"; system.stateVersion = "23.11";

View file

@ -18,7 +18,7 @@
"fd00:fae:fae:fae:fae:4::/96" "fd00:fae:fae:fae:fae:4::/96"
]; ];
privateKeyFile = config.age.secrets.wg-private-key.path; privateKeyFile = config.age.secrets.wg-private-key.path;
peers = flake.self.logins.admins.wireguardDevices ++ [ peers = flake.self.logins.wireguardDevices ++ [
{ {
# nachtigall.pub.solar # nachtigall.pub.solar
endpoint = "138.201.80.102:51820"; endpoint = "138.201.80.102:51820";
@ -29,13 +29,15 @@
]; ];
} }
{ {
# flora-6.pub.solar # trinkgenossin.pub.solar
endpoint = "80.71.153.210:51820"; publicKey = "QWgHovHxtqiQhnHLouSWiT6GIoQDmuvnThYL5c/rvU4=";
publicKey = "jtSR5G2P/nm9s8WrVc26Xc/SQLupRxyXE+5eIeqlsTU=";
allowedIPs = [ allowedIPs = [
"10.7.6.2/32" "10.7.6.5/32"
"fd00:fae:fae:fae:fae:2::/96" "fd00:fae:fae:fae:fae:5::/96"
]; ];
#endpoint = "85.215.152.22:51820";
endpoint = "[2a01:239:35d:f500::1]:51820";
persistentKeepalive = 15;
} }
]; ];
}; };

View file

@ -0,0 +1,35 @@
{
flake,
config,
lib,
pkgs,
...
}:
{
boot.loader.grub.enable = true;
boot.loader.grub.devices = [ "/dev/vda" ];
boot.kernelParams = [
"boot.shell_on_fail=1"
"ip=dhcp"
];
# This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
#
# Most users should NEVER change this value after the initial install, for any reason,
# even if you've upgraded your system to a new NixOS release.
#
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
# to actually do that.
#
# This value being lower than the current NixOS release does NOT mean your system is
# out of date, out of support, or vulnerable.
#
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "24.05"; # Did you read the comment?
}

View file

@ -0,0 +1,13 @@
{ flake, ... }:
{
imports = [
./hardware-configuration.nix
./configuration.nix
./networking.nix
./wireguard.nix
./forgejo-actions-runner.nix
#./backups.nix
];
}

View file

@ -1,57 +1,54 @@
{ {
config, config,
lib,
pkgs, pkgs,
lib,
flake, flake,
... ...
}: }:
let
hostname = config.networking.hostName;
in
{ {
age.secrets.forgejo-actions-runner-token = { age.secrets."forgejo-actions-runner-token.age" = {
file = "${flake.self}/secrets/forgejo-actions-runner-token.age"; file = "${flake.self}/secrets/trinkgenossin-forgejo-actions-runner-token.age";
owner = "gitea-runner";
mode = "440"; mode = "440";
}; };
# Label configuration on gitea-actions-runner instance requires either docker or podman
virtualisation.docker.enable = true;
# Trust docker bridge interface traffic # Trust docker bridge interface traffic
# Needed for the docker runner to communicate with the act_runner cache # Needed for the docker runner to communicate with the act_runner cache
networking.firewall.trustedInterfaces = [ "br-+" ]; networking.firewall.trustedInterfaces = [ "br-+" ];
users.users.gitea-runner = { users.users.gitea-runner = {
home = "/var/lib/gitea-runner/flora-6"; home = "/var/lib/gitea-runner/${hostname}";
useDefaultShell = true; useDefaultShell = true;
group = "gitea-runner"; group = "gitea-runner";
# Required to interact with nix daemon
extraGroups = [ "wheel" ];
isSystemUser = true; isSystemUser = true;
}; };
users.groups.gitea-runner = { }; users.groups.gitea-runner = { };
systemd.services."gitea-runner-flora\\x2d6".serviceConfig = { systemd.tmpfiles.rules = [ "d '/var/lib/gitea-runner' 0750 gitea-runner gitea-runner - -" ];
DynamicUser = lib.mkForce false;
};
systemd.tmpfiles.rules = [ systemd.services."gitea-runner-${hostname}" = {
"d '/data/gitea-actions-runner' 0750 gitea-runner gitea-runner - -" serviceConfig.DynamicUser = lib.mkForce false;
"d '/var/lib/gitea-runner' 0750 gitea-runner gitea-runner - -" };
];
# forgejo actions runner # forgejo actions runner
# https://forgejo.org/docs/latest/admin/actions/ # https://forgejo.org/docs/latest/admin/actions/
# https://docs.gitea.com/usage/actions/quickstart # https://docs.gitea.com/usage/actions/quickstart
services.gitea-actions-runner = { services.gitea-actions-runner = {
package = pkgs.forgejo-runner; package = pkgs.forgejo-runner;
instances."flora-6" = { instances."${hostname}" = {
enable = true; enable = true;
name = config.networking.hostName; name = hostname;
url = "https://git.pub.solar"; url = "https://git.pub.solar";
tokenFile = config.age.secrets.forgejo-actions-runner-token.path; tokenFile = config.age.secrets."forgejo-actions-runner-token.age".path;
settings = {
cache = {
enabled = true;
dir = "/data/gitea-actions-runner/actcache";
host = "";
port = 0;
external_server = "";
};
};
labels = [ labels = [
# provide a debian 12 bookworm base with Node.js for actions # provide a debian 12 bookworm base with Node.js for actions
"debian-latest:docker://git.pub.solar/pub-solar/actions-base-image:20-bookworm" "debian-latest:docker://git.pub.solar/pub-solar/actions-base-image:20-bookworm"
@ -59,8 +56,6 @@
"ubuntu-latest:docker://git.pub.solar/pub-solar/actions-base-image:20-bookworm" "ubuntu-latest:docker://git.pub.solar/pub-solar/actions-base-image:20-bookworm"
# alpine with Node.js # alpine with Node.js
"alpine-latest:docker://node:20-alpine" "alpine-latest:docker://node:20-alpine"
# nix flakes enabled image with Node.js
"nix-flakes:docker://git.pub.solar/pub-solar/nix-flakes-node:latest"
]; ];
}; };
}; };

View file

@ -8,45 +8,47 @@
modulesPath, modulesPath,
... ...
}: }:
{ {
imports = [ ]; imports = [ ];
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = [
"ahci" "ata_piix"
"uhci_hcd"
"virtio_pci" "virtio_pci"
"xhci_pci"
"sr_mod" "sr_mod"
"virtio_blk" "virtio_blk"
"virtio_net"
]; ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
boot.initrd.luks.devices."cryptroot" = {
device = "/dev/disk/by-uuid/52a1fd17-63d7-4d0a-b7ff-74aceaf6085a";
};
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-label/nixos"; device = "/dev/disk/by-label/nixos";
autoResize = true;
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = { fileSystems."/boot" = {
device = "/dev/disk/by-label/boot"; device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
fileSystems."/data" = {
device = "/dev/disk/by-label/ephemeral0";
fsType = "ext4"; fsType = "ext4";
options = [
"defaults"
"nofail"
];
}; };
swapDevices = [ ]; fileSystems."/var/lib/garage/data" = {
device = "/dev/disk/by-label/data";
fsType = "xfs";
};
networking.useDHCP = lib.mkDefault false; fileSystems."/var/lib/garage/meta" = {
networking.networkmanager.enable = lib.mkForce false; device = "/dev/disk/by-label/metadata";
fsType = "btrfs";
};
swapDevices = [ { device = "/dev/disk/by-label/swap"; } ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
} }

View file

@ -0,0 +1,15 @@
{
config,
pkgs,
flake,
...
}:
{
services.garage.settings.rpc_public_addr = "[2a01:239:35d:f500::1]:3901";
networking.hostName = "trinkgenossin";
networking.hostId = "00000003";
networking.enableIPv6 = true;
networking.useDHCP = true;
}

View file

@ -4,21 +4,25 @@
flake, flake,
... ...
}: }:
let
wireguardIPv4 = "10.7.6.5";
wireguardIPv6 = "fd00:fae:fae:fae:fae:5::";
in
{ {
networking.firewall.allowedUDPPorts = [ 51820 ]; networking.firewall.allowedUDPPorts = [ 51820 ];
age.secrets.wg-private-key.file = "${flake.self}/secrets/flora6-wg-private-key.age"; age.secrets.wg-private-key.file = "${flake.self}/secrets/trinkgenossin-wg-private-key.age";
networking.wireguard.interfaces = { networking.wireguard.interfaces = {
wg-ssh = { wg-ssh = {
listenPort = 51820; listenPort = 51820;
mtu = 1300; mtu = 1300;
ips = [ ips = [
"10.7.6.2/32" "${wireguardIPv4}/32"
"fd00:fae:fae:fae:fae:2::/96" "${wireguardIPv6}/96"
]; ];
privateKeyFile = config.age.secrets.wg-private-key.path; privateKeyFile = config.age.secrets.wg-private-key.path;
peers = flake.self.logins.admins.wireguardDevices ++ [ peers = flake.self.logins.wireguardDevices ++ [
{ {
# nachtigall.pub.solar # nachtigall.pub.solar
endpoint = "138.201.80.102:51820"; endpoint = "138.201.80.102:51820";
@ -47,17 +51,35 @@
"fd00:fae:fae:fae:fae:4::/96" "fd00:fae:fae:fae:fae:4::/96"
]; ];
} }
{
# delite.pub.solar
endpoint = "5.255.119.132:51820";
publicKey = "ZT2qGWgMPwHRUOZmTQHWCRX4m14YwOsiszjsA5bpc2k=";
allowedIPs = [
"10.7.6.6/32"
"fd00:fae:fae:fae:fae:6::/96"
];
}
{
# blue-shell.pub.solar
endpoint = "194.13.83.205:51820";
publicKey = "bcrIpWrKc1M+Hq4ds3aN1lTaKE26f2rvXhd+93QrzR8=";
allowedIPs = [
"10.7.6.7/32"
"fd00:fae:fae:fae:fae:7::/96"
];
}
]; ];
}; };
}; };
services.openssh.listenAddresses = [ services.openssh.listenAddresses = [
{ {
addr = "10.7.6.2"; addr = wireguardIPv4;
port = 22; port = 22;
} }
{ {
addr = "[fd00:fae:fae:fae:fae:2::]"; addr = "[${wireguardIPv6}]";
port = 22; port = 22;
} }
]; ];

View file

@ -0,0 +1,81 @@
{
flake,
config,
pkgs,
...
}:
{
# Use GRUB2 as the boot loader.
boot.loader.grub = {
enable = true;
devices = [ "/dev/vda" ];
};
pub-solar-os.networking.domain = "test.pub.solar";
systemd.tmpfiles.rules = [ "f /tmp/dbf 1777 root root 10d password" ];
# keycloak
pub-solar-os.auth = {
enable = true;
database-password-file = "/tmp/dbf";
};
services.keycloak.database.createLocally = true;
# matrix-synapse
# test.pub.solar /.well-known is required for federation
services.nginx.virtualHosts."${config.pub-solar-os.networking.domain}" = {
default = true;
enableACME = true;
forceSSL = true;
};
age.secrets."staging-matrix-synapse-secret-config.yaml" = {
file = "${flake.self}/secrets/staging-matrix-synapse-secret-config.yaml.age";
mode = "400";
owner = "matrix-synapse";
};
age.secrets."staging-matrix-authentication-service-secret-config.yml" = {
file = "${flake.self}/secrets/staging-matrix-authentication-service-secret-config.yml.age";
mode = "400";
owner = "matrix-authentication-service";
};
# matrix-appservice-irc
age.secrets."matrix-appservice-irc-mediaproxy-signing-key" = {
file = "${flake.self}/secrets/staging-matrix-appservice-irc-mediaproxy-signing-key.jwk.age";
mode = "400";
owner = "matrix-appservice-irc";
};
pub-solar-os.matrix = {
enable = true;
appservice-irc.mediaproxy.signingKeyPath =
config.age.secrets."matrix-appservice-irc-mediaproxy-signing-key".path;
synapse = {
extra-config-files = [
config.age.secrets."staging-matrix-synapse-secret-config.yaml".path
# The registration file is automatically generated after starting the
# appservice for the first time.
# cp /var/lib/mautrix-telegram/telegram-registration.yaml \
# /var/lib/matrix-synapse/
# chown matrix-synapse:matrix-synapse \
# /var/lib/matrix-synapse/telegram-registration.yaml
#"/var/lib/matrix-synapse/telegram-registration.yaml"
];
app-service-config-files = [
"/var/lib/matrix-appservice-irc/registration.yml"
#"/var/lib/matrix-synapse/telegram-registration.yaml"
];
};
matrix-authentication-service.extra-config-files = [
config.age.secrets."staging-matrix-authentication-service-secret-config.yml".path
];
};
services.openssh.openFirewall = true;
system.stateVersion = "24.05";
}

View file

@ -0,0 +1,16 @@
{ flake, ... }:
{
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
./configuration.nix
./networking.nix
"${flake.inputs.fork}/nixos/modules/services/matrix/matrix-authentication-service.nix"
];
disabledModules = [
"services/matrix/matrix-authentication-service.nix"
];
}

View file

@ -0,0 +1,47 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [
"ahci"
"xhci_pci"
"virtio_pci"
"virtio_scsi"
"sd_mod"
"sr_mod"
];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.initrd.luks.devices."cryptroot" = {
device = "/dev/disk/by-label/cryptroot";
};
fileSystems."/" = {
device = "/dev/disk/by-label/root";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "ext4";
};
swapDevices = [
{ device = "/dev/disk/by-label/swap"; }
];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

View file

@ -0,0 +1,30 @@
{
config,
pkgs,
flake,
...
}:
{
networking.hostName = "underground";
networking = {
defaultGateway = {
address = "80.244.242.1";
interface = "enp1s0";
};
nameservers = [
"95.129.51.51"
"80.244.244.244"
];
interfaces.enp1s0 = {
useDHCP = false;
ipv4.addresses = [
{
address = "80.244.242.3";
prefixLength = 29;
}
];
};
};
}

View file

@ -38,6 +38,22 @@
"fd00:fae:fae:fae:fae:200::/96" "fd00:fae:fae:fae:fae:200::/96"
]; ];
} }
{
# chocolatebar
publicKey = "AS9w0zDUFLcH6IiF6T1vsyZPWPJ3p5fKsjIsM2AoZz8=";
allowedIPs = [
"10.7.6.205/32"
"fd00:fae:fae:fae:fae:205::/96"
];
}
{
# biolimo
publicKey = "gnLq6KikFVVGxLxPW+3ZnreokEKLDoso+cUepPOZsBA=";
allowedIPs = [
"10.7.6.206/32"
"fd00:fae:fae:fae:fae:206::/96"
];
}
]; ];
}; };
@ -63,6 +79,7 @@
teutat3s = { teutat3s = {
sshPubKeys = { sshPubKeys = {
teutat3s-1 = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFro/k4Mgqyh8yV/7Zwjc0dv60ZM7bROBU9JNd99P/4co6fxPt1pJiU/pEz2Dax/HODxgcO+jFZfvPEuLMCeAl0= YubiKey #10593996 PIV Slot 9a"; teutat3s-1 = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFro/k4Mgqyh8yV/7Zwjc0dv60ZM7bROBU9JNd99P/4co6fxPt1pJiU/pEz2Dax/HODxgcO+jFZfvPEuLMCeAl0= YubiKey #10593996 PIV Slot 9a";
teutat3s-2 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHcU6KPy4b1MQXd6EJhcYwbJu7E+0IrBZF/IP6T7gbMf teutat3s@dumpyourvms";
}; };
secretEncryptionKeys = { secretEncryptionKeys = {

View file

@ -6,19 +6,16 @@ in
{ {
flake = { flake = {
logins = { logins = {
admins = admins = admins;
lib.lists.foldl wireguardDevices = lib.lists.foldl (
(logins: adminConfig: { wireguardDevices: adminConfig:
sshPubKeys = logins.sshPubKeys ++ (lib.attrsets.attrValues adminConfig.sshPubKeys); wireguardDevices ++ (if adminConfig ? "wireguardDevices" then adminConfig.wireguardDevices else [ ])
wireguardDevices = ) [ ] (lib.attrsets.attrValues admins);
logins.wireguardDevices sshPubKeys = lib.lists.foldl (
++ (if adminConfig ? "wireguardDevices" then adminConfig.wireguardDevices else [ ]); sshPubKeys: adminConfig:
}) sshPubKeys
{ ++ (if adminConfig ? "sshPubKeys" then lib.attrsets.attrValues adminConfig.sshPubKeys else [ ])
sshPubKeys = [ ]; ) [ ] (lib.attrsets.attrValues admins);
wireguardDevices = [ ];
}
(lib.attrsets.attrValues admins);
robots.sshPubKeys = lib.attrsets.attrValues robots; robots.sshPubKeys = lib.attrsets.attrValues robots;
}; };
}; };

View file

@ -1,7 +1,8 @@
{ {
# Used for restic backups to droppie, a server run by @b12f # Used for restic backups to droppie, a server run by @b12f
"root@droppie" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBZQSephFJU0NMbVbhwvVJ2/m6jcPYo1IsWCsoarqKin root@droppie"; "root@droppie" =
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBZQSephFJU0NMbVbhwvVJ2/m6jcPYo1IsWCsoarqKin root@droppie";
# robot user on flora-6 "hakkonaut" =
"hakkonaut@flora-6" = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGP5MvCwNRtCcP1pSDrn0XZTNlpOqYnjHDm9/OI4hECW hakkonaut@flora-6"; "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGP5MvCwNRtCcP1pSDrn0XZTNlpOqYnjHDm9/OI4hECW hakkonaut";
} }

292
modules/backups/default.nix Normal file
View file

@ -0,0 +1,292 @@
{
flake,
config,
lib,
pkgs,
...
}:
let
utils = import "${flake.inputs.nixpkgs}/nixos/lib/utils.nix" {
inherit lib;
inherit config;
inherit pkgs;
};
# Type for a valid systemd unit option. Needed for correctly passing "timerConfig" to "systemd.timers"
inherit (utils.systemdUtils.unitOptions) unitOption;
inherit (lib)
literalExpression
mkOption
mkPackageOption
types
;
in
{
options.pub-solar-os.backups = {
repos = mkOption {
description = ''
Configuration of Restic repositories.
'';
type = types.attrsOf (
types.submodule (
{ name, ... }:
{
options = {
passwordFile = mkOption {
type = types.str;
description = ''
Read the repository password from a file.
'';
example = "/etc/nixos/restic-password";
};
environmentFile = mkOption {
type = with types; nullOr str;
default = null;
description = ''
Read repository secrets as environment variables from a file.
'';
example = "/etc/nixos/restic-env";
};
repository = mkOption {
type = with types; nullOr str;
default = null;
description = ''
repository to backup to.
'';
example = "sftp:backup@192.168.1.100:/backups/${name}";
};
};
}
)
);
default = { };
example = {
remotebackup = {
repository = "sftp:backup@host:/backups/home";
passwordFile = "/etc/nixos/secrets/restic-password";
environmentFile = "/etc/nixos/secrets/restic-env";
};
};
};
restic = mkOption {
description = ''
Periodic backups to create with Restic.
'';
type = types.attrsOf (
types.submodule (
{ name, ... }:
{
options = {
paths = mkOption {
# This is nullable for legacy reasons only. We should consider making it a pure listOf
# after some time has passed since this comment was added.
type = types.nullOr (types.listOf types.str);
default = [ ];
description = ''
Which paths to backup, in addition to ones specified via
`dynamicFilesFrom`. If null or an empty array and
`dynamicFilesFrom` is also null, no backup command will be run.
This can be used to create a prune-only job.
'';
example = [
"/var/lib/postgresql"
"/home/user/backup"
];
};
exclude = mkOption {
type = types.listOf types.str;
default = [ ];
description = ''
Patterns to exclude when backing up. See
https://restic.readthedocs.io/en/latest/040_backup.html#excluding-files for
details on syntax.
'';
example = [
"/var/cache"
"/home/*/.cache"
".git"
];
};
timerConfig = mkOption {
type = types.nullOr (types.attrsOf unitOption);
default = {
OnCalendar = "daily";
Persistent = true;
};
description = ''
When to run the backup. See {manpage}`systemd.timer(5)` for
details. If null no timer is created and the backup will only
run when explicitly started.
'';
example = {
OnCalendar = "00:05";
RandomizedDelaySec = "5h";
Persistent = true;
};
};
user = mkOption {
type = types.str;
default = "root";
description = ''
As which user the backup should run.
'';
example = "postgresql";
};
extraBackupArgs = mkOption {
type = types.listOf types.str;
default = [ ];
description = ''
Extra arguments passed to restic backup.
'';
example = [ "--exclude-file=/etc/nixos/restic-ignore" ];
};
extraOptions = mkOption {
type = types.listOf types.str;
default = [ ];
description = ''
Extra extended options to be passed to the restic --option flag.
'';
example = [ "sftp.command='ssh backup@192.168.1.100 -i /home/user/.ssh/id_rsa -s sftp'" ];
};
initialize = mkOption {
type = types.bool;
default = false;
description = ''
Create the repository if it doesn't exist.
'';
};
pruneOpts = mkOption {
type = types.listOf types.str;
default = [ ];
description = ''
A list of options (--keep-\* et al.) for 'restic forget
--prune', to automatically prune old snapshots. The
'forget' command is run *after* the 'backup' command, so
keep that in mind when constructing the --keep-\* options.
'';
example = [
"--keep-daily 7"
"--keep-weekly 5"
"--keep-monthly 12"
"--keep-yearly 75"
];
};
runCheck = mkOption {
type = types.bool;
default = (builtins.length config.pub-solar-os.backups.restic.${name}.checkOpts > 0);
defaultText = literalExpression ''builtins.length config.services.backups.${name}.checkOpts > 0'';
description = "Whether to run the `check` command with the provided `checkOpts` options.";
example = true;
};
checkOpts = mkOption {
type = types.listOf types.str;
default = [ ];
description = ''
A list of options for 'restic check'.
'';
example = [ "--with-cache" ];
};
dynamicFilesFrom = mkOption {
type = with types; nullOr str;
default = null;
description = ''
A script that produces a list of files to back up. The
results of this command are given to the '--files-from'
option. The result is merged with paths specified via `paths`.
'';
example = "find /home/matt/git -type d -name .git";
};
backupPrepareCommand = mkOption {
type = with types; nullOr str;
default = null;
description = ''
A script that must run before starting the backup process.
'';
};
backupCleanupCommand = mkOption {
type = with types; nullOr str;
default = null;
description = ''
A script that must run after finishing the backup process.
'';
};
package = mkPackageOption pkgs "restic" { };
createWrapper = lib.mkOption {
type = lib.types.bool;
default = true;
description = ''
Whether to generate and add a script to the system path, that has the same environment variables set
as the systemd service. This can be used to e.g. mount snapshots or perform other opterations, without
having to manually specify most options.
'';
};
};
}
)
);
default = { };
example = {
localbackup = {
paths = [ "/home" ];
exclude = [ "/home/*/.cache" ];
initialize = true;
};
remotebackup = {
paths = [ "/home" ];
extraOptions = [
"sftp.command='ssh backup@host -i /etc/nixos/secrets/backup-private-key -s sftp'"
];
timerConfig = {
OnCalendar = "00:05";
RandomizedDelaySec = "5h";
};
};
};
};
};
config = {
services.restic.backups =
let
repos = config.pub-solar-os.backups.repos;
restic = config.pub-solar-os.backups.restic;
repoNames = builtins.attrNames repos;
backupNames = builtins.attrNames restic;
createBackups =
backupName:
map (repoName: {
name = "${backupName}-${repoName}";
value = repos."${repoName}" // restic."${backupName}";
}) repoNames;
in
builtins.listToAttrs (lib.lists.flatten (map createBackups backupNames));
# Used for pub-solar-os.backups.repos.storagebox
programs.ssh.knownHosts = {
"u377325.your-storagebox.de".publicKey =
"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5EB5p/5Hp3hGW1oHok+PIOH9Pbn7cnUiGmUEBrCVjnAw+HrKyN8bYVV0dIGllswYXwkG/+bgiBlE6IVIBAq+JwVWu1Sss3KarHY3OvFJUXZoZyRRg/Gc/+LRCE7lyKpwWQ70dbelGRyyJFH36eNv6ySXoUYtGkwlU5IVaHPApOxe4LHPZa/qhSRbPo2hwoh0orCtgejRebNtW5nlx00DNFgsvn8Svz2cIYLxsPVzKgUxs8Zxsxgn+Q/UvR7uq4AbAhyBMLxv7DjJ1pc7PJocuTno2Rw9uMZi1gkjbnmiOh6TTXIEWbnroyIhwc8555uto9melEUmWNQ+C+PwAK+MPw==";
"[u377325.your-storagebox.de]:23".publicKey =
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIICf9svRenC/PLKIL9nk6K/pxQgoiFC41wTNvoIncOxs";
};
};
}

View file

@ -54,9 +54,5 @@
}; };
time.timeZone = "Etc/UTC"; time.timeZone = "Etc/UTC";
home-manager.users.${config.pub-solar-os.authentication.username} = {
home.stateVersion = "23.05";
};
}; };
} }

View file

@ -31,13 +31,17 @@
networking.hosts = { networking.hosts = {
"10.7.6.1" = [ "nachtigall.wg.${config.pub-solar-os.networking.domain}" ]; "10.7.6.1" = [ "nachtigall.wg.${config.pub-solar-os.networking.domain}" ];
"10.7.6.2" = [ "flora-6.wg.${config.pub-solar-os.networking.domain}" ];
"10.7.6.3" = [ "metronom.wg.${config.pub-solar-os.networking.domain}" ]; "10.7.6.3" = [ "metronom.wg.${config.pub-solar-os.networking.domain}" ];
"10.7.6.4" = [ "tankstelle.wg.${config.pub-solar-os.networking.domain}" ]; "10.7.6.4" = [ "tankstelle.wg.${config.pub-solar-os.networking.domain}" ];
"10.7.6.5" = [ "trinkgenossin.wg.${config.pub-solar-os.networking.domain}" ];
"10.7.6.6" = [ "delite.wg.${config.pub-solar-os.networking.domain}" ];
"10.7.6.7" = [ "blue-shell.wg.${config.pub-solar-os.networking.domain}" ];
"fd00:fae:fae:fae:fae:1::" = [ "nachtigall.wg.${config.pub-solar-os.networking.domain}" ]; "fd00:fae:fae:fae:fae:1::" = [ "nachtigall.wg.${config.pub-solar-os.networking.domain}" ];
"fd00:fae:fae:fae:fae:2::" = [ "flora-6.wg.${config.pub-solar-os.networking.domain}" ];
"fd00:fae:fae:fae:fae:3::" = [ "metronom.wg.${config.pub-solar-os.networking.domain}" ]; "fd00:fae:fae:fae:fae:3::" = [ "metronom.wg.${config.pub-solar-os.networking.domain}" ];
"fd00:fae:fae:fae:fae:4::" = [ "tankstelle.wg.${config.pub-solar-os.networking.domain}" ]; "fd00:fae:fae:fae:fae:4::" = [ "tankstelle.wg.${config.pub-solar-os.networking.domain}" ];
"fd00:fae:fae:fae:fae:5::" = [ "trinkgenossin.wg.${config.pub-solar-os.networking.domain}" ];
"fd00:fae:fae:fae:fae:6::" = [ "delite.wg.${config.pub-solar-os.networking.domain}" ];
"fd00:fae:fae:fae:fae:7::" = [ "blue-shell.wg.${config.pub-solar-os.networking.domain}" ];
}; };
services.openssh = { services.openssh = {

View file

@ -6,7 +6,21 @@
... ...
}: }:
{ {
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ ]; nixpkgs.config = lib.mkDefault {
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ ];
permittedInsecurePackages = [ "olm-3.2.16" ];
};
system.activationScripts.diff-closures = {
text = ''
if [[ -e /run/current-system ]]; then
${config.nix.package}/bin/nix store diff-closures \
/run/current-system "$systemConfig" \
--extra-experimental-features nix-command
fi
'';
supportsDryActivation = true;
};
nix = { nix = {
# Use default version alias for nix package # Use default version alias for nix package

View file

@ -1,9 +1,20 @@
{ flake, config, ... }: { flake, lib, ... }:
{ {
home-manager.users.${config.pub-solar-os.authentication.username} = { home-manager.users = (
lib.attrsets.foldlAttrs (
acc: name: value:
acc
// {
${name} = {
programs.git.enable = true; programs.git.enable = true;
programs.starship.enable = true; programs.starship.enable = true;
programs.bash.enable = true; programs.bash = {
enable = true;
historyControl = [
"ignoredups"
"ignorespace"
];
};
programs.neovim = { programs.neovim = {
enable = true; enable = true;
vimAlias = true; vimAlias = true;
@ -17,3 +28,6 @@
}; };
}; };
} }
) { } flake.self.logins.admins
);
}

View file

@ -11,18 +11,6 @@
inherit (lib) mkOption types; inherit (lib) mkOption types;
in in
{ {
username = mkOption {
description = "Username for the adminstrative user";
type = types.str;
default = flake.self.username;
};
sshPubKeys = mkOption {
description = "SSH Keys that should have administrative root access";
type = types.listOf types.str;
default = flake.self.logins.admins.sshPubKeys;
};
root.initialHashedPassword = mkOption { root.initialHashedPassword = mkOption {
description = "Hashed password of the root account"; description = "Hashed password of the root account";
type = types.str; type = types.str;
@ -43,22 +31,29 @@
}; };
config = { config = {
users.users.${config.pub-solar-os.authentication.username} = { users.users =
name = config.pub-solar-os.authentication.username; (lib.attrsets.foldlAttrs (
group = config.pub-solar-os.authentication.username; acc: name: value:
acc
// {
${name} = {
name = name;
group = name;
extraGroups = [ extraGroups = [
"wheel" "wheel"
"docker" "docker"
]; ];
isNormalUser = true; isNormalUser = true;
openssh.authorizedKeys.keys = config.pub-solar-os.authentication.sshPubKeys; openssh.authorizedKeys.keys = lib.attrsets.attrValues value.sshPubKeys;
}; };
users.groups.${config.pub-solar-os.authentication.username} = { }; }
) { } flake.self.logins.admins)
// {
# TODO: Remove when we stop locking ourselves out. # TODO: Remove when we stop locking ourselves out.
users.users.root.openssh.authorizedKeys.keys = config.pub-solar-os.authentication.sshPubKeys; root.openssh.authorizedKeys.keys = flake.self.logins.sshPubKeys;
root.initialHashedPassword = config.pub-solar-os.authentication.root.initialHashedPassword;
users.users.${config.pub-solar-os.authentication.robot.username} = { ${config.pub-solar-os.authentication.robot.username} = {
description = "CI and automation user"; description = "CI and automation user";
home = "/home/${config.pub-solar-os.authentication.robot.username}"; home = "/home/${config.pub-solar-os.authentication.robot.username}";
createHome = true; createHome = true;
@ -68,11 +63,28 @@
isSystemUser = true; isSystemUser = true;
openssh.authorizedKeys.keys = config.pub-solar-os.authentication.robot.sshPubKeys; openssh.authorizedKeys.keys = config.pub-solar-os.authentication.robot.sshPubKeys;
}; };
};
users.groups.${config.pub-solar-os.authentication.robot.username} = { }; home-manager.users = (
lib.attrsets.foldlAttrs (
acc: name: value:
acc
// {
${name} = {
home.stateVersion = "23.05";
};
}
) { } flake.self.logins.admins
);
users.users.root.initialHashedPassword = users.groups =
config.pub-solar-os.authentication.root.initialHashedPassword; (lib.attrsets.foldlAttrs (
acc: name: value:
acc // { "${name}" = { }; }
) { } flake.self.logins.admins)
// {
${config.pub-solar-os.authentication.robot.username} = { };
};
security.sudo.wheelNeedsPassword = false; security.sudo.wheelNeedsPassword = false;
}; };

View file

@ -18,7 +18,7 @@
min-port = 49000; min-port = 49000;
max-port = 50000; max-port = 50000;
use-auth-secret = true; use-auth-secret = true;
static-auth-secret-file = "/run/agenix/coturn-static-auth-secret"; static-auth-secret-file = config.age.secrets."coturn-static-auth-secret".path;
realm = "turn.${config.pub-solar-os.networking.domain}"; realm = "turn.${config.pub-solar-os.networking.domain}";
cert = "${config.security.acme.certs.${realm}.directory}/full.pem"; cert = "${config.security.acme.certs.${realm}.directory}/full.pem";
pkey = "${config.security.acme.certs.${realm}.directory}/key.pem"; pkey = "${config.security.acme.certs.${realm}.directory}/key.pem";

View file

@ -1,114 +0,0 @@
{
config,
lib,
pkgs,
flake,
...
}:
{
age.secrets.drone-secrets = {
file = "${flake.self}/secrets/drone-secrets.age";
mode = "600";
owner = "drone";
};
age.secrets.drone-db-secrets = {
file = "${flake.self}/secrets/drone-db-secrets.age";
mode = "600";
owner = "drone";
};
users.users.drone = {
description = "Drone Service";
home = "/var/lib/drone";
useDefaultShell = true;
uid = 994;
group = "drone";
isSystemUser = true;
};
users.groups.drone = { };
systemd.tmpfiles.rules = [ "d '/var/lib/drone-db' 0750 drone drone - -" ];
services.caddy.virtualHosts."ci.${config.pub-solar-os.networking.domain}" = {
logFormat = lib.mkForce ''
output discard
'';
extraConfig = ''
reverse_proxy :4000
'';
};
systemd.services."docker-network-drone" =
let
docker = config.virtualisation.oci-containers.backend;
dockerBin = "${pkgs.${docker}}/bin/${docker}";
in
{
serviceConfig.Type = "oneshot";
before = [ "docker-drone-server.service" ];
script = ''
${dockerBin} network inspect drone-net >/dev/null 2>&1 || ${dockerBin} network create drone-net --subnet 172.20.0.0/24
'';
};
virtualisation = {
docker = {
enable = true; # sadly podman is not supported rightnow
extraOptions = ''
--data-root /data/docker
'';
};
oci-containers = {
backend = "docker";
containers."drone-db" = {
image = "postgres:14";
autoStart = true;
user = "994";
volumes = [ "/var/lib/drone-db:/var/lib/postgresql/data" ];
extraOptions = [ "--network=drone-net" ];
environmentFiles = [ config.age.secrets.drone-db-secrets.path ];
};
containers."drone-server" = {
image = "drone/drone:2";
autoStart = true;
user = "994";
ports = [ "127.0.0.1:4000:80" ];
dependsOn = [ "drone-db" ];
extraOptions = [
"--network=drone-net"
"--pull=always"
"--add-host=nachtigall.${config.pub-solar-os.networking.domain}:10.7.6.1"
];
environment = {
DRONE_GITEA_SERVER = "https://git.${config.pub-solar-os.networking.domain}";
DRONE_SERVER_HOST = "ci.${config.pub-solar-os.networking.domain}";
DRONE_SERVER_PROTO = "https";
DRONE_DATABASE_DRIVER = "postgres";
};
environmentFiles = [ config.age.secrets.drone-secrets.path ];
};
containers."drone-docker-runner" = {
image = "drone/drone-runner-docker:1";
autoStart = true;
# needs to run as root
#user = "994";
volumes = [ "/var/run/docker.sock:/var/run/docker.sock" ];
dependsOn = [ "drone-db" ];
extraOptions = [
"--network=drone-net"
"--pull=always"
"--add-host=nachtigall.${config.pub-solar-os.networking.domain}:10.7.6.1"
];
environment = {
DRONE_RPC_HOST = "ci.${config.pub-solar-os.networking.domain}";
DRONE_RPC_PROTO = "https";
DRONE_RUNNER_CAPACITY = "2";
DRONE_RUNNER_NAME = "flora-6-docker-runner";
};
environmentFiles = [ config.age.secrets.drone-secrets.path ];
};
};
};
}

View file

@ -65,6 +65,7 @@
services.forgejo = { services.forgejo = {
enable = true; enable = true;
package = pkgs.forgejo;
user = "gitea"; user = "gitea";
group = "gitea"; group = "gitea";
database = { database = {
@ -75,7 +76,7 @@
}; };
stateDir = "/var/lib/forgejo"; stateDir = "/var/lib/forgejo";
lfs.enable = true; lfs.enable = true;
mailerPasswordFile = config.age.secrets.forgejo-mailer-password.path; secrets.mailer.PASSWD = config.age.secrets.forgejo-mailer-password.path;
settings = { settings = {
DEFAULT.APP_NAME = "pub.solar git server"; DEFAULT.APP_NAME = "pub.solar git server";
@ -141,6 +142,12 @@
LOGIN_REMEMBER_DAYS = 365; LOGIN_REMEMBER_DAYS = 365;
}; };
# See https://docs.gitea.com/administration/config-cheat-sheet#migrations-migrations
migrations = {
# This allows migrations from the same forgejo instance
ALLOW_LOCALNETWORKS = true;
};
# https://forgejo.org/docs/next/admin/config-cheat-sheet/#indexer-indexer # https://forgejo.org/docs/next/admin/config-cheat-sheet/#indexer-indexer
indexer = { indexer = {
REPO_INDEXER_ENABLED = true; REPO_INDEXER_ENABLED = true;
@ -179,10 +186,10 @@
"/tmp/forgejo-backup.sql" "/tmp/forgejo-backup.sql"
]; ];
timerConfig = { timerConfig = {
OnCalendar = "*-*-* 00:00:00 Etc/UTC"; OnCalendar = "*-*-* 23:00:00 Etc/UTC";
}; };
initialize = true; initialize = true;
passwordFile = config.age.secrets."restic-repo-storagebox".path; passwordFile = config.age.secrets."restic-repo-storagebox-nachtigall".path;
repository = "sftp:u377325@u377325.your-storagebox.de:/backups"; repository = "sftp:u377325@u377325.your-storagebox.de:/backups";
backupPrepareCommand = '' backupPrepareCommand = ''
${pkgs.sudo}/bin/sudo -u postgres ${pkgs.postgresql}/bin/pg_dump -d gitea > /tmp/forgejo-backup.sql ${pkgs.sudo}/bin/sudo -u postgres ${pkgs.postgresql}/bin/pg_dump -d gitea > /tmp/forgejo-backup.sql

142
modules/garage/default.nix Normal file
View file

@ -0,0 +1,142 @@
{
config,
lib,
pkgs,
flake,
...
}:
{
age.secrets."garage-rpc-secret" = {
file = "${flake.self}/secrets/garage-rpc-secret.age";
mode = "400";
};
age.secrets."garage-admin-token" = {
file = "${flake.self}/secrets/garage-admin-token.age";
mode = "400";
};
age.secrets."acme-namecheap-env" = {
file = "${flake.self}/secrets/acme-namecheap-env.age";
mode = "400";
};
networking.firewall.allowedTCPPorts = [
3900
3901
3902
];
networking.firewall.interfaces.wg-ssh.allowedTCPPorts = [ 3903 ];
security.acme = {
defaults = {
# LEGO_DISABLE_CNAME_SUPPORT=true set here to fix issues with CNAME
# detection, as we use wildcard DNS for garage
environmentFile = config.age.secrets.acme-namecheap-env.path;
};
certs = {
# Wildcard certificate gets created automatically
"buckets.${config.pub-solar-os.networking.domain}" = {
# disable http challenge
webroot = null;
# enable dns challenge
dnsProvider = "namecheap";
};
# Wildcard certificate gets created automatically
"web.${config.pub-solar-os.networking.domain}" = {
# disable http challenge
webroot = null;
# enable dns challenge
dnsProvider = "namecheap";
};
};
};
services.nginx = {
upstreams.s3_backend.servers = {
"[::1]:3900" = { };
};
upstreams.web_backend.servers = {
"[::1]:3902" = { };
};
virtualHosts."buckets.${config.pub-solar-os.networking.domain}" = {
serverAliases = [ "*.buckets.${config.pub-solar-os.networking.domain}" ];
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://s3_backend";
extraConfig = ''
client_max_body_size 64m;
proxy_max_temp_file_size 0;
'';
};
};
virtualHosts."web.${config.pub-solar-os.networking.domain}" = {
serverAliases = [ "*.web.${config.pub-solar-os.networking.domain}" ];
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://web_backend";
};
};
};
services.garage = {
enable = true;
package = pkgs.garage_1_1_0;
settings = {
data_dir = "/var/lib/garage/data";
metadata_dir = "/var/lib/garage/meta";
db_engine = "lmdb";
replication_factor = 3;
compression_level = 2;
rpc_bind_addr = "[::]:3901";
s3_api = {
s3_region = "eu-central";
api_bind_addr = "[::]:3900";
root_domain = ".buckets.${config.pub-solar-os.networking.domain}";
};
s3_web = {
bind_addr = "[::]:3902";
root_domain = ".web.${config.pub-solar-os.networking.domain}";
index = "index.html";
};
admin = {
api_bind_addr = "[::]:3903";
};
};
};
users.users.garage = {
isSystemUser = true;
home = "/var/lib/garage";
group = "garage";
};
users.groups.garage = { };
# Adapted from https://git.clan.lol/clan/clan-core/src/commit/23a9e35c665ff531fe1193dcc47056432fbbeacf/clanModules/garage/default.nix
# Disabled DynamicUser https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/services/web-servers/garage.nix
# for mounts + permissions to work
systemd.services.garage = {
serviceConfig = {
user = "garage";
group = "garage";
DynamicUser = false;
LoadCredential = [
"rpc_secret_path:${config.age.secrets.garage-rpc-secret.path}"
"admin_token_path:${config.age.secrets.garage-admin-token.path}"
];
Environment = [
"GARAGE_ALLOW_WORLD_READABLE_SECRETS=true"
"GARAGE_RPC_SECRET_FILE=%d/rpc_secret_path"
"GARAGE_ADMIN_TOKEN_FILE=%d/admin_token_path"
];
};
};
}

View file

@ -33,15 +33,18 @@
group = "grafana"; group = "grafana";
user = "grafana"; user = "grafana";
}; };
"grafana-dashboards/grafana-garage-dashboard-prometheus.json" = {
source = ./grafana-dashboards/grafana-garage-dashboard-prometheus.json;
group = "grafana";
user = "grafana";
};
}; };
services.caddy.virtualHosts."grafana.${config.pub-solar-os.networking.domain}" = { services.nginx.virtualHosts."grafana.${config.pub-solar-os.networking.domain}" = {
logFormat = lib.mkForce '' enableACME = true;
output discard forceSSL = true;
''; locations."/".proxyPass =
extraConfig = '' "http://127.0.0.1:${toString config.services.grafana.settings.server.http_port}";
reverse_proxy :${toString config.services.grafana.settings.server.http_port}
'';
}; };
services.grafana = { services.grafana = {
@ -64,7 +67,7 @@
password = "\$__file{${config.age.secrets.grafana-smtp-password.path}}"; password = "\$__file{${config.age.secrets.grafana-smtp-password.path}}";
from_address = "no-reply@pub.solar"; from_address = "no-reply@pub.solar";
from_name = "grafana.pub.solar"; from_name = "grafana.pub.solar";
ehlo_identity = "flora-6.pub.solar"; ehlo_identity = "grafana.pub.solar";
}; };
security = { security = {
admin_email = "crew@pub.solar"; admin_email = "crew@pub.solar";

File diff suppressed because it is too large Load diff

View file

@ -6,23 +6,22 @@
... ...
}: }:
{ {
options.pub-solar-os.auth = { options.pub-solar-os.auth = with lib; {
enable = lib.mkEnableOption "Enable keycloak to run on the node"; enable = mkEnableOption "Enable keycloak to run on the node";
realm = lib.mkOption { realm = mkOption {
description = "Name of the realm"; description = "Name of the realm";
type = lib.types.str; type = types.str;
default = config.pub-solar-os.networking.domain; default = config.pub-solar-os.networking.domain;
}; };
database-password-file = mkOption {
description = "Database password file path";
type = types.str;
};
}; };
config = lib.mkIf config.pub-solar-os.auth.enable { config = lib.mkIf config.pub-solar-os.auth.enable {
age.secrets.keycloak-database-password = {
file = "${flake.self}/secrets/keycloak-database-password.age";
mode = "600";
#owner = "keycloak";
};
services.nginx.virtualHosts."auth.${config.pub-solar-os.networking.domain}" = { services.nginx.virtualHosts."auth.${config.pub-solar-os.networking.domain}" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
@ -46,12 +45,13 @@
# keycloak # keycloak
services.keycloak = { services.keycloak = {
enable = true; enable = true;
database.passwordFile = config.age.secrets.keycloak-database-password.path; database.passwordFile = config.pub-solar-os.auth.database-password-file;
settings = { settings = {
hostname = "auth.${config.pub-solar-os.networking.domain}"; hostname = "auth.${config.pub-solar-os.networking.domain}";
http-host = "127.0.0.1"; http-host = "127.0.0.1";
http-port = 8080; http-port = 8080;
proxy = "edge"; proxy-headers = "xforwarded";
http-enabled = true;
}; };
themes = { themes = {
"pub.solar" = "pub.solar" =
@ -59,14 +59,12 @@
}; };
}; };
services.restic.backups.keycloak-storagebox = { pub-solar-os.backups.restic.keycloak = {
paths = [ "/tmp/keycloak-backup.sql" ]; paths = [ "/tmp/keycloak-backup.sql" ];
timerConfig = { timerConfig = {
OnCalendar = "*-*-* 03:00:00 Etc/UTC"; OnCalendar = "*-*-* 03:00:00 Etc/UTC";
}; };
initialize = true; initialize = true;
passwordFile = config.age.secrets."restic-repo-storagebox".path;
repository = "sftp:u377325@u377325.your-storagebox.de:/backups";
backupPrepareCommand = '' backupPrepareCommand = ''
${pkgs.sudo}/bin/sudo -u postgres ${pkgs.postgresql}/bin/pg_dump -d keycloak > /tmp/keycloak-backup.sql ${pkgs.sudo}/bin/sudo -u postgres ${pkgs.postgresql}/bin/pg_dump -d keycloak > /tmp/keycloak-backup.sql
''; '';

View file

@ -108,7 +108,7 @@
}; };
clients = [ clients = [
{ {
url = "http://flora-6.wg.pub.solar:${toString config.services.loki.configuration.server.http_listen_port}/loki/api/v1/push"; url = "http://trinkgenossin.wg.pub.solar:${toString config.services.loki.configuration.server.http_listen_port}/loki/api/v1/push";
} }
]; ];
scrape_configs = [ scrape_configs = [
@ -118,7 +118,7 @@
max_age = "24h"; max_age = "24h";
labels = { labels = {
job = "systemd-journal"; job = "systemd-journal";
host = "flora-6"; host = "trinkgenossin";
}; };
}; };
relabel_configs = [ relabel_configs = [

View file

@ -67,4 +67,20 @@
}; };
security.acme.acceptTerms = true; security.acme.acceptTerms = true;
security.acme.defaults.email = "security@pub.solar"; security.acme.defaults.email = "security@pub.solar";
pub-solar-os.backups.restic.mail = {
paths = [
"/var/vmail"
"/var/dkim"
];
timerConfig = {
OnCalendar = "*-*-* 02:00:00 Etc/UTC";
};
initialize = true;
pruneOpts = [
"--keep-daily 7"
"--keep-weekly 4"
"--keep-monthly 3"
];
};
} }

View file

@ -91,7 +91,7 @@
OnCalendar = "*-*-* 02:00:00 Etc/UTC"; OnCalendar = "*-*-* 02:00:00 Etc/UTC";
}; };
initialize = true; initialize = true;
passwordFile = config.age.secrets."restic-repo-storagebox".path; passwordFile = config.age.secrets."restic-repo-storagebox-nachtigall".path;
repository = "sftp:u377325@u377325.your-storagebox.de:/backups"; repository = "sftp:u377325@u377325.your-storagebox.de:/backups";
pruneOpts = [ pruneOpts = [
"--keep-daily 7" "--keep-daily 7"

View file

@ -7,6 +7,21 @@
}: }:
{ {
age.secrets."mastodon-active-record-encryption-deterministic-key" = {
file = "${flake.self}/secrets//mastodon-active-record-encryption-deterministic-key.age";
mode = "400";
owner = config.services.mastodon.user;
};
age.secrets."mastodon-active-record-encryption-key-derivation-salt" = {
file = "${flake.self}/secrets//mastodon-active-record-encryption-key-derivation-salt.age";
mode = "400";
owner = config.services.mastodon.user;
};
age.secrets."mastodon-active-record-encryption-primary-key" = {
file = "${flake.self}/secrets//mastodon-active-record-encryption-primary-key.age";
mode = "400";
owner = config.services.mastodon.user;
};
age.secrets."mastodon-secret-key-base" = { age.secrets."mastodon-secret-key-base" = {
file = "${flake.self}/secrets/mastodon-secret-key-base.age"; file = "${flake.self}/secrets/mastodon-secret-key-base.age";
mode = "400"; mode = "400";
@ -54,6 +69,9 @@
webProcesses = 2; webProcesses = 2;
# Threads per process used by the mastodon-web service # Threads per process used by the mastodon-web service
webThreads = 5; webThreads = 5;
activeRecordEncryptionDeterministicKeyFile = "/run/agenix/mastodon-active-record-encryption-deterministic-key";
activeRecordEncryptionKeyDerivationSaltFile = "/run/agenix/mastodon-active-record-encryption-key-derivation-salt";
activeRecordEncryptionPrimaryKeyFile = "/run/agenix/mastodon-active-record-encryption-primary-key";
secretKeyBaseFile = "/run/agenix/mastodon-secret-key-base"; secretKeyBaseFile = "/run/agenix/mastodon-secret-key-base";
otpSecretFile = "/run/agenix/mastodon-otp-secret"; otpSecretFile = "/run/agenix/mastodon-otp-secret";
vapidPrivateKeyFile = "/run/agenix/mastodon-vapid-private-key"; vapidPrivateKeyFile = "/run/agenix/mastodon-vapid-private-key";
@ -67,20 +85,20 @@
passwordFile = "/run/agenix/mastodon-smtp-password"; passwordFile = "/run/agenix/mastodon-smtp-password";
fromAddress = "mastodon-notifications@pub.solar"; fromAddress = "mastodon-notifications@pub.solar";
}; };
# Defined in ./opensearch.nix
elasticsearch.host = "127.0.0.1";
mediaAutoRemove = { mediaAutoRemove = {
olderThanDays = 7; olderThanDays = 7;
}; };
extraEnvFiles = [ "/run/agenix/mastodon-extra-env-secrets" ]; extraEnvFiles = [ "/run/agenix/mastodon-extra-env-secrets" ];
extraConfig = { extraConfig = {
WEB_DOMAIN = "mastodon.${config.pub-solar-os.networking.domain}"; WEB_DOMAIN = "mastodon.${config.pub-solar-os.networking.domain}";
# Defined in ./opensearch.nix
ES_HOST = "127.0.0.1";
# S3 File storage (optional) # S3 File storage (optional)
# ----------------------- # -----------------------
S3_ENABLED = "true"; S3_ENABLED = "true";
S3_BUCKET = "pub-solar-mastodon"; S3_BUCKET = "mastodon";
S3_REGION = "europe-west-1"; S3_REGION = "eu-central";
S3_ENDPOINT = "https://gateway.tardigradeshare.io"; S3_ENDPOINT = "https://buckets.pub.solar";
S3_ALIAS_HOST = "files.${config.pub-solar-os.networking.domain}"; S3_ALIAS_HOST = "files.${config.pub-solar-os.networking.domain}";
# Translation (optional) # Translation (optional)
# ----------------------- # -----------------------
@ -106,7 +124,7 @@
OnCalendar = "*-*-* 04:00:00 Etc/UTC"; OnCalendar = "*-*-* 04:00:00 Etc/UTC";
}; };
initialize = true; initialize = true;
passwordFile = config.age.secrets."restic-repo-storagebox".path; passwordFile = config.age.secrets."restic-repo-storagebox-nachtigall".path;
repository = "sftp:u377325@u377325.your-storagebox.de:/backups"; repository = "sftp:u377325@u377325.your-storagebox.de:/backups";
backupPrepareCommand = '' backupPrepareCommand = ''
${pkgs.sudo}/bin/sudo -u postgres ${pkgs.postgresql}/bin/pg_dump -d mastodon > /tmp/mastodon-backup.sql ${pkgs.sudo}/bin/sudo -u postgres ${pkgs.postgresql}/bin/pg_dump -d mastodon > /tmp/mastodon-backup.sql

View file

@ -1,24 +0,0 @@
{ config, flake, ... }:
{
imports = [ "${flake.inputs.nixpkgs-draupnir}/nixos/modules/services/matrix/draupnir.nix" ];
disabledModules = [ "services/matrix/draupnir.nix" ];
age.secrets."matrix-draupnir-access-token" = {
file = "${flake.self}/secrets/matrix-draupnir-access-token.age";
mode = "640";
owner = "root";
group = "draupnir";
};
services.draupnir = {
enable = true;
accessTokenFile = config.age.secrets.matrix-draupnir-access-token.path;
# https://github.com/the-draupnir-project/Draupnir/blob/main/config/default.yaml
settings = {
homeserverUrl = "http://localhost:8008";
managementRoom = "#moderators:pub.solar";
protectAllJoinedRooms = true;
};
};
}

View file

@ -16,11 +16,16 @@ let
synapseClientPort = "${toString listenerWithClient.port}"; synapseClientPort = "${toString listenerWithClient.port}";
in in
{ {
systemd.services.matrix-appservice-irc.serviceConfig.SystemCallFilter = lib.mkForce [ options.pub-solar-os = {
"@system-service @pkey" matrix.appservice-irc.mediaproxy = {
"~@privileged @resources" signingKeyPath = lib.mkOption {
"@chown" description = "Path to file containing the IRC appservice mediaproxy signing key";
]; type = lib.types.str;
default = "/var/lib/matrix-appservice-irc/media-signingkey.jwk";
};
};
};
config = {
services.matrix-appservice-irc = { services.matrix-appservice-irc = {
enable = true; enable = true;
localpart = "irc_bot"; localpart = "irc_bot";
@ -30,7 +35,6 @@ in
homeserver = { homeserver = {
domain = "${config.pub-solar-os.networking.domain}"; domain = "${config.pub-solar-os.networking.domain}";
url = "http://127.0.0.1:${synapseClientPort}"; url = "http://127.0.0.1:${synapseClientPort}";
media_url = "https://matrix.${config.pub-solar-os.networking.domain}";
enablePresence = false; enablePresence = false;
}; };
ircService = { ircService = {
@ -40,13 +44,21 @@ in
port = 1113; port = 1113;
}; };
logging = { logging = {
level = "debug"; # set to debug for debugging
level = "warn";
maxFiles = 5; maxFiles = 5;
toCosole = true; toCosole = true;
}; };
matrixHandler = { matrixHandler = {
eventCacheSize = 4096; eventCacheSize = 4096;
}; };
mediaProxy = {
signingKeyPath = config.pub-solar-os.matrix.appservice-irc.mediaproxy.signingKeyPath;
# keep media for 2 weeks
ttlSeconds = 1209600;
bindPort = 11111;
publicUrl = "https:///matrix.${config.pub-solar-os.networking.domain}/media";
};
metrics = { metrics = {
enabled = true; enabled = true;
remoteUserAgeBuckets = [ remoteUserAgeBuckets = [
@ -128,4 +140,5 @@ in
}; };
}; };
}; };
};
} }

View file

@ -1,6 +1,7 @@
{ {
flake, flake,
config, config,
lib,
pkgs, pkgs,
... ...
}: }:
@ -9,24 +10,41 @@ let
serverDomain = "${config.pub-solar-os.networking.domain}"; serverDomain = "${config.pub-solar-os.networking.domain}";
in in
{ {
age.secrets."matrix-synapse-signing-key" = { options.pub-solar-os = {
file = "${flake.self}/secrets/matrix-synapse-signing-key.age"; matrix = {
mode = "400"; enable = lib.mkEnableOption "Enable matrix-synapse and matrix-authentication-service to run on the node";
owner = "matrix-synapse";
synapse = {
app-service-config-files = lib.mkOption {
description = "List of app service config files";
type = lib.types.listOf lib.types.str;
default = [ ];
}; };
age.secrets."matrix-synapse-secret-config.yaml" = { extra-config-files = lib.mkOption {
file = "${flake.self}/secrets/matrix-synapse-secret-config.yaml.age"; description = "List of extra synapse config files";
mode = "400"; type = lib.types.listOf lib.types.str;
owner = "matrix-synapse"; default = [ ];
}; };
age.secrets."matrix-synapse-sliding-sync-secret" = { signing_key_path = lib.mkOption {
file = "${flake.self}/secrets/matrix-synapse-sliding-sync-secret.age"; description = "Path to file containing the signing key";
mode = "400"; type = lib.types.str;
owner = "matrix-synapse"; default = "${config.services.matrix-synapse.dataDir}/homeserver.signing.key";
};
}; };
matrix-authentication-service = {
extra-config-files = lib.mkOption {
description = "List of extra mas config files";
type = lib.types.listOf lib.types.str;
default = [ ];
};
};
};
};
config = lib.mkIf config.pub-solar-os.matrix.enable {
services.matrix-synapse = { services.matrix-synapse = {
enable = true; enable = true;
settings = { settings = {
@ -101,6 +119,17 @@ in
enable_room_list_search = true; enable_room_list_search = true;
encryption_enabled_by_default_for_room_type = "off"; encryption_enabled_by_default_for_room_type = "off";
event_cache_size = "100K"; event_cache_size = "100K";
# https://github.com/element-hq/synapse/issues/11203
# No YAML deep-merge, so this needs to be in secret extraConfigFiles
# together with msc3861
#experimental_features = {
# # Room summary API
# msc3266_enabled = true;
# # Rendezvous server for QR Code generation
# msc4108_enabled = true;
#};
federation_rr_transactions_per_room_per_second = 50; federation_rr_transactions_per_room_per_second = 50;
federation_client_minimum_tls_version = "1.2"; federation_client_minimum_tls_version = "1.2";
forget_rooms_on_leave = true; forget_rooms_on_leave = true;
@ -194,7 +223,7 @@ in
} }
]; ];
signing_key_path = "/run/agenix/matrix-synapse-signing-key"; signing_key_path = config.pub-solar-os.matrix.synapse.signing_key_path;
stream_writers = { }; stream_writers = { };
trusted_key_servers = [ { server_name = "matrix.org"; } ]; trusted_key_servers = [ { server_name = "matrix.org"; } ];
@ -240,94 +269,90 @@ in
}; };
user_ips_max_age = "28d"; user_ips_max_age = "28d";
app_service_config_files = [ app_service_config_files = config.pub-solar-os.matrix.synapse.app-service-config-files;
"/var/lib/matrix-synapse/telegram-registration.yaml"
"/var/lib/matrix-appservice-irc/registration.yml"
# "/matrix-appservice-slack-registration.yaml"
# "/hookshot-registration.yml"
# "/matrix-mautrix-signal-registration.yaml"
# "/matrix-mautrix-telegram-registration.yaml"
];
modules = [
{
module = "mjolnir.Module";
config = {
# Prevent servers/users in the ban lists from inviting users on this
# server to rooms. Default true.
block_invites = true;
# Flag messages sent by servers/users in the ban lists as spam. Currently
# this means that spammy messages will appear as empty to users. Default
# false.
block_messages = false;
# Remove users from the user directory search by filtering matrix IDs and
# display names by the entries in the user ban list. Default false.
block_usernames = false;
# The room IDs of the ban lists to honour. Unlike other parts of Mjolnir,
# this list cannot be room aliases or permalinks. This server is expected
# to already be joined to the room - Mjolnir will not automatically join
# these rooms.
ban_lists = [ "!roomid:example.org" ];
};
}
];
}; };
withJemalloc = true; withJemalloc = true;
extraConfigFiles = [ extraConfigFiles = config.pub-solar-os.matrix.synapse.extra-config-files;
"/run/agenix/matrix-synapse-secret-config.yaml"
# The registration file is automatically generated after starting the
# appservice for the first time.
# cp /var/lib/mautrix-telegram/telegram-registration.yaml \
# /var/lib/matrix-synapse/
# chown matrix-synapse:matrix-synapse \
# /var/lib/matrix-synapse/telegram-registration.yaml
"/var/lib/matrix-synapse/telegram-registration.yaml"
];
extras = [ extras = [
"oidc" "oidc"
"redis" "redis"
]; ];
plugins = with config.services.matrix-synapse.package.plugins; [ plugins = [ config.services.matrix-synapse.package.plugins.matrix-synapse-shared-secret-auth ];
matrix-synapse-shared-secret-auth
matrix-synapse-mjolnir-antispam
];
}; };
services.matrix-sliding-sync = { services.matrix-authentication-service = {
enable = true; enable = true;
createDatabase = true;
extraConfigFiles = config.pub-solar-os.matrix.matrix-authentication-service.extra-config-files;
# https://element-hq.github.io/matrix-authentication-service/reference/configuration.html
settings = { settings = {
SYNCV3_SERVER = "https://${publicDomain}"; account.email_change_allowed = false;
SYNCV3_BINDADDR = "127.0.0.1:8011"; http.public_base = "https://mas.${config.pub-solar-os.networking.domain}";
# The bind addr for Prometheus metrics, which will be accessible at http.issuer = "https://mas.${config.pub-solar-os.networking.domain}";
# /metrics at this address http.listeners = [
SYNCV3_PROM = "127.0.0.1:9100"; {
name = "web";
resources = [
{ name = "discovery"; }
{ name = "human"; }
{ name = "oauth"; }
{ name = "compat"; }
{ name = "graphql"; }
{
name = "assets";
path = "${config.services.matrix-authentication-service.package}/share/matrix-authentication-service/assets";
}
];
binds = [
{
host = "0.0.0.0";
port = 8090;
}
];
proxy_protocol = false;
}
{
name = "internal";
resources = [
{ name = "health"; }
];
binds = [
{
host = "0.0.0.0";
port = 8081;
}
];
proxy_protocol = false;
}
];
passwords.enabled = false;
}; };
environmentFile = config.age.secrets."matrix-synapse-sliding-sync-secret".path;
}; };
services.restic.backups.matrix-synapse-storagebox = { pub-solar-os.backups.restic.matrix-synapse = {
paths = [ paths = [
"/var/lib/matrix-synapse" "/var/lib/matrix-synapse"
"/var/lib/matrix-appservice-irc" "/var/lib/matrix-appservice-irc"
"/var/lib/mautrix-telegram" "/var/lib/mautrix-telegram"
"/tmp/matrix-synapse-backup.sql" "/tmp/matrix-synapse-backup.sql"
"/tmp/matrix-authentication-service-backup.sql"
]; ];
timerConfig = { timerConfig = {
OnCalendar = "*-*-* 05:00:00 Etc/UTC"; OnCalendar = "*-*-* 05:00:00 Etc/UTC";
}; };
initialize = true; initialize = true;
passwordFile = config.age.secrets."restic-repo-storagebox".path;
repository = "sftp:u377325@u377325.your-storagebox.de:/backups";
backupPrepareCommand = '' backupPrepareCommand = ''
${pkgs.sudo}/bin/sudo -u postgres ${pkgs.postgresql}/bin/pg_dump -d matrix > /tmp/matrix-synapse-backup.sql ${pkgs.sudo}/bin/sudo -u postgres ${pkgs.postgresql}/bin/pg_dump -d matrix > /tmp/matrix-synapse-backup.sql
${pkgs.sudo}/bin/sudo -u postgres ${pkgs.postgresql}/bin/pg_dump -d matrix-authentication-service > /tmp/matrix-authentication-service-backup.sql
''; '';
backupCleanupCommand = '' backupCleanupCommand = ''
rm /tmp/matrix-synapse-backup.sql rm /tmp/matrix-synapse-backup.sql
rm /tmp/matrix-authentication-service-backup.sql
''; '';
pruneOpts = [ pruneOpts = [
"--keep-daily 7" "--keep-daily 7"
@ -335,4 +360,5 @@ in
"--keep-monthly 3" "--keep-monthly 3"
]; ];
}; };
};
} }

View file

@ -70,6 +70,8 @@ let
$wgUploadDirectory = "/var/www/html/uploads"; $wgUploadDirectory = "/var/www/html/uploads";
$wgUploadPath = $wgScriptPath . "/uploads"; $wgUploadPath = $wgScriptPath . "/uploads";
$wgFileExtensions = [ 'png', 'gif', 'jpg', 'jpeg', 'webp', 'svg', 'pdf', ];
$wgUseImageMagick = true; $wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert"; $wgImageMagickConvertCommand = "/usr/bin/convert";
@ -139,6 +141,10 @@ let
// https://www.mediawiki.org/wiki/Extension:PluggableAuth#Configuration // https://www.mediawiki.org/wiki/Extension:PluggableAuth#Configuration
$wgPluggableAuth_EnableAutoLogin = false; $wgPluggableAuth_EnableAutoLogin = false;
$wgPluggableAuth_ButtonLabel = 'Login with pub.solar ID'; $wgPluggableAuth_ButtonLabel = 'Login with pub.solar ID';
// Avoid getting logged out after 30 minutes
// https://www.mediawiki.org/wiki/Topic:W4be4h6t63vf3y8p
// https://www.mediawiki.org/wiki/Manual:$wgRememberMe
$wgRememberMe = 'always';
// https://www.mediawiki.org/wiki/Extension:OpenID_Connect#Keycloak // https://www.mediawiki.org/wiki/Extension:OpenID_Connect#Keycloak
$wgPluggableAuth_Config[] = [ $wgPluggableAuth_Config[] = [
@ -211,7 +217,7 @@ in
backend = "docker"; backend = "docker";
containers."mediawiki" = { containers."mediawiki" = {
image = "git.pub.solar/pub-solar/mediawiki-oidc-docker:1.41.1"; image = "git.pub.solar/pub-solar/mediawiki-oidc-docker:1.43.0";
user = "1000:${builtins.toString gid}"; user = "1000:${builtins.toString gid}";
autoStart = true; autoStart = true;
@ -232,4 +238,27 @@ in
}; };
}; };
}; };
pub-solar-os.backups.restic.mediawiki = {
paths = [
"/var/lib/mediawiki/images"
"/var/lib/mediawiki/uploads"
"/tmp/mediawiki-backup.sql"
];
timerConfig = {
OnCalendar = "*-*-* 00:00:00 Etc/UTC";
};
initialize = true;
backupPrepareCommand = ''
${pkgs.sudo}/bin/sudo -u postgres ${pkgs.postgresql}/bin/pg_dump -d mediawiki > /tmp/mediawiki-backup.sql
'';
backupCleanupCommand = ''
rm /tmp/mediawiki-backup.sql
'';
pruneOpts = [
"--keep-daily 7"
"--keep-weekly 4"
"--keep-monthly 3"
];
};
} }

View file

@ -2,6 +2,7 @@
config, config,
pkgs, pkgs,
flake, flake,
lib,
... ...
}: }:
{ {
@ -22,12 +23,33 @@
forceSSL = true; forceSSL = true;
}; };
services.nextcloud = { services.nextcloud =
let
exiftool_1270 = pkgs.perlPackages.buildPerlPackage rec {
# NOTE nextcloud-memories needs this specific version of exiftool
# https://github.com/NixOS/nixpkgs/issues/345267
pname = "Image-ExifTool";
version = "12.70";
src = pkgs.fetchFromGitHub {
owner = "exiftool";
repo = "exiftool";
rev = version;
hash = "sha256-YMWYPI2SDi3s4KCpSNwovemS5MDj5W9ai0sOkvMa8Zg=";
};
nativeBuildInputs = lib.optional pkgs.stdenv.hostPlatform.isDarwin pkgs.shortenPerlShebang;
postInstall = lib.optionalString pkgs.stdenv.hostPlatform.isDarwin ''
shortenPerlShebang $out/bin/exiftool
'';
};
in
{
hostName = "cloud.${config.pub-solar-os.networking.domain}"; hostName = "cloud.${config.pub-solar-os.networking.domain}";
home = "/var/lib/nextcloud"; home = "/var/lib/nextcloud";
enable = true; enable = true;
package = pkgs.nextcloud29; # When updating package, remember to update nextcloud30Packages in
# services.nextcloud.extraApps
package = pkgs.nextcloud30;
https = true; https = true;
secretFile = config.age.secrets."nextcloud-secrets".path; # secret secretFile = config.age.secrets."nextcloud-secrets".path; # secret
maxUploadSize = "1G"; maxUploadSize = "1G";
@ -45,11 +67,10 @@
dbuser = "nextcloud"; dbuser = "nextcloud";
dbtype = "pgsql"; dbtype = "pgsql";
dbname = "nextcloud"; dbname = "nextcloud";
dbtableprefix = "oc_";
}; };
settings = { settings = {
overwrite.cli.url = "http://cloud.${config.pub-solar-os.networking.domain}"; overwrite.cli.url = "https://cloud.${config.pub-solar-os.networking.domain}";
overwriteprotocol = "https"; overwriteprotocol = "https";
installed = true; installed = true;
@ -73,25 +94,43 @@
allow_local_remote_servers = true; allow_local_remote_servers = true;
enable_previews = true; enable_previews = true;
jpeg_quality = 60;
enabledPreviewProviders = [ enabledPreviewProviders = [
"OC\\Preview\\PNG" "OC\\Preview\\PNG"
"OC\\Preview\\JPEG" "OC\\Preview\\JPEG"
"OC\\Preview\\GIF" "OC\\Preview\\GIF"
"OC\\Preview\\BMP" "OC\\Preview\\BMP"
"OC\\Preview\\HEIC"
"OC\\Preview\\TIFF"
"OC\\Preview\\XBitmap" "OC\\Preview\\XBitmap"
"OC\\Preview\\SVG"
"OC\\Preview\\WebP"
"OC\\Preview\\Font"
"OC\\Preview\\Movie" "OC\\Preview\\Movie"
"OC\\Preview\\PDF" "OC\\Preview\\ImaginaryPDF"
"OC\\Preview\\MP3" "OC\\Preview\\MP3"
"OC\\Preview\\OpenDocument"
"OC\\Preview\\Krita"
"OC\\Preview\\TXT" "OC\\Preview\\TXT"
"OC\\Preview\\MarkDown" "OC\\Preview\\MarkDown"
"OC\\Preview\\Imaginary"
]; ];
preview_max_x = "1024"; preview_imaginary_url = "http://127.0.0.1:${toString config.services.imaginary.port}/";
preview_max_y = "768"; preview_max_filesize_image = 128; # MB
preview_max_scale_factor = "1"; preview_max_memory = 512; # MB
preview_max_x = 2048; # px
preview_max_y = 2048; # px
preview_max_scale_factor = 1;
"preview_ffmpeg_path" = lib.getExe pkgs.ffmpeg-headless;
"memories.exiftool_no_local" = false;
"memories.exiftool" = "${exiftool_1270}/bin/exiftool";
"memories.vod.ffmpeg" = lib.getExe pkgs.ffmpeg;
"memories.vod.ffprobe" = lib.getExe' pkgs.ffmpeg-headless "ffprobe";
auth.bruteforce.protection.enabled = true; auth.bruteforce.protection.enabled = true;
trashbin_retention_obligation = "auto,7"; trashbin_retention_obligation = "auto,7";
skeletondirectory = "./nextcloud-skeleton"; skeletondirectory = "${pkgs.nextcloud-skeleton}/{lang}";
defaultapp = "file"; defaultapp = "file";
activity_expire_days = "14"; activity_expire_days = "14";
integrity.check.disabled = false; integrity.check.disabled = false;
@ -132,10 +171,103 @@
}; };
caching.redis = true; caching.redis = true;
autoUpdateApps.enable = true; # Don't allow the installation and updating of apps from the Nextcloud appstore,
# because we declaratively install them
appstoreEnable = false;
autoUpdateApps.enable = false;
extraApps = {
inherit (pkgs.nextcloud30Packages.apps)
calendar
contacts
cospend
deck
end_to_end_encryption
groupfolders
integration_deepl
mail
memories
notes
notify_push
previewgenerator
quota_warning
recognize
richdocuments
spreed
tasks
twofactor_webauthn
user_oidc
;
};
database.createLocally = true; database.createLocally = true;
}; };
# https://docs.nextcloud.com/server/30/admin_manual/installation/server_tuning.html#previews
services.imaginary = {
enable = true;
address = "127.0.0.1";
settings.return-size = true;
};
systemd = {
services =
let
occ = "/run/current-system/sw/bin/nextcloud-occ";
in
{
nextcloud-cron-preview-generator = {
environment.NEXTCLOUD_CONFIG_DIR = "${config.services.nextcloud.home}/config";
serviceConfig = {
ExecStart = "${occ} preview:pre-generate";
Type = "oneshot";
User = "nextcloud";
};
};
nextcloud-preview-generator-setup = {
wantedBy = [ "multi-user.target" ];
requires = [ "phpfpm-nextcloud.service" ];
after = [ "phpfpm-nextcloud.service" ];
environment.NEXTCLOUD_CONFIG_DIR = "${config.services.nextcloud.home}/config";
script = # bash
''
# check with:
# for size in squareSizes widthSizes heightSizes; do echo -n "$size: "; nextcloud-occ config:app:get previewgenerator $size; done
# extra commands run for preview generator:
# 32 icon file list
# 64 icon file list android app, photos app
# 96 nextcloud client VFS windows file preview
# 256 file app grid view, many requests
# 512 photos app tags
${occ} config:app:set --value="32 64 96 256 512" previewgenerator squareSizes
# 341 hover in maps app
# 1920 files/photos app when viewing picture
${occ} config:app:set --value="341 1920" previewgenerator widthSizes
# 256 hover in maps app
# 1080 files/photos app when viewing picture
${occ} config:app:set --value="256 1080" previewgenerator heightSizes
'';
serviceConfig = {
Type = "oneshot";
User = "nextcloud";
};
};
};
timers.nextcloud-cron-preview-generator = {
after = [ "nextcloud-setup.service" ];
timerConfig = {
OnCalendar = "*:0/10";
OnUnitActiveSec = "9m";
Persistent = true;
RandomizedDelaySec = 60;
Unit = "nextcloud-cron-preview-generator.service";
};
wantedBy = [ "timers.target" ];
};
};
services.restic.backups.nextcloud-storagebox = { services.restic.backups.nextcloud-storagebox = {
paths = [ paths = [
"/var/lib/nextcloud/data" "/var/lib/nextcloud/data"
@ -145,7 +277,7 @@
OnCalendar = "*-*-* 01:00:00 Etc/UTC"; OnCalendar = "*-*-* 01:00:00 Etc/UTC";
}; };
initialize = true; initialize = true;
passwordFile = config.age.secrets."restic-repo-storagebox".path; passwordFile = config.age.secrets."restic-repo-storagebox-nachtigall".path;
repository = "sftp:u377325@u377325.your-storagebox.de:/backups"; repository = "sftp:u377325@u377325.your-storagebox.de:/backups";
backupPrepareCommand = '' backupPrepareCommand = ''
${pkgs.sudo}/bin/sudo -u postgres ${pkgs.postgresql}/bin/pg_dump -d nextcloud > /tmp/nextcloud-backup.sql ${pkgs.sudo}/bin/sudo -u postgres ${pkgs.postgresql}/bin/pg_dump -d nextcloud > /tmp/nextcloud-backup.sql

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

View file

@ -1,8 +1,7 @@
{ config, ... }: { config, ... }:
let let
objStorHost = "link.tardigradeshare.io"; objStorHost = "mastodon.web.pub.solar";
objStorBucket = "s/jw24ad6l4a6zxsnd32cmf5hp5nsq/pub-solar-mastodon";
in in
{ {
services.nginx.virtualHosts = { services.nginx.virtualHosts = {
@ -10,6 +9,12 @@ in
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
# Use variable to force nginx to perform a DNS resolution on its value,
# the IP of the object storage provider may not always remain the same.
extraConfig = ''
set $s3_backend 'https://${objStorHost}';
'';
locations = { locations = {
"= /" = { "= /" = {
index = "index.html"; index = "index.html";
@ -25,7 +30,6 @@ in
deny all; deny all;
} }
resolver 8.8.8.8;
proxy_set_header Host ${objStorHost}; proxy_set_header Host ${objStorHost};
proxy_set_header Connection \'\'; proxy_set_header Connection \'\';
proxy_set_header Authorization \'\'; proxy_set_header Authorization \'\';
@ -40,7 +44,7 @@ in
proxy_hide_header x-amz-bucket-region; proxy_hide_header x-amz-bucket-region;
proxy_hide_header x-amzn-requestid; proxy_hide_header x-amzn-requestid;
proxy_ignore_headers Set-Cookie; proxy_ignore_headers Set-Cookie;
proxy_pass https://${objStorHost}/${objStorBucket}$request_uri?download; proxy_pass $s3_backend$request_uri;
proxy_intercept_errors off; proxy_intercept_errors off;
proxy_ssl_protocols TLSv1.2 TLSv1.3; proxy_ssl_protocols TLSv1.2 TLSv1.3;
proxy_ssl_server_name on; proxy_ssl_server_name on;

View file

@ -10,25 +10,20 @@ let
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-XSS-Protection "1; mode=block"; add_header X-XSS-Protection "1; mode=block";
''; '';
clientConfig = import ./element-client-config.nix { inherit lib pkgs; }; clientConfig = import ./element-client-config.nix { inherit config lib pkgs; };
wellKnownClient = domain: { wellKnownClient = domain: {
"m.homeserver".base_url = "https://matrix.${domain}"; "m.homeserver".base_url = "https://matrix.${domain}";
"m.identity_server".base_url = "https://matrix.${domain}"; "m.identity_server".base_url = "https://matrix.${domain}";
"org.matrix.msc3575.proxy".url = "https://matrix.${domain}"; "org.matrix.msc2965.authentication" = {
issuer = "https://mas.${domain}/";
account = "https://mas.${domain}/account";
};
"im.vector.riot.e2ee".default = true; "im.vector.riot.e2ee".default = true;
"io.element.e2ee" = { "io.element.e2ee" = {
default = true; default = true;
secure_backup_required = false; secure_backup_required = false;
secure_backup_setup_methods = [ ]; secure_backup_setup_methods = [ ];
}; };
"m.integrations" = {
managers = [
{
api_url = "https://dimension.${domain}/api/v1/scalar";
ui_url = "https://dimension.${domain}/element";
}
];
};
}; };
wellKnownServer = domain: { "m.server" = "matrix.${domain}:8448"; }; wellKnownServer = domain: { "m.server" = "matrix.${domain}:8448"; };
wellKnownSupport = { wellKnownSupport = {
@ -85,6 +80,27 @@ in
root = pkgs.element-stickerpicker; root = pkgs.element-stickerpicker;
}; };
"mas.${config.pub-solar-os.networking.domain}" = {
root = "/dev/null";
forceSSL = lib.mkDefault true;
enableACME = lib.mkDefault true;
locations = {
"/" = {
proxyPass = "http://127.0.0.1:8090";
extraConfig = ''
${commonHeaders}
proxy_http_version 1.1;
# Forward the client IP address
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
'';
};
};
};
"matrix.${config.pub-solar-os.networking.domain}" = { "matrix.${config.pub-solar-os.networking.domain}" = {
root = "/dev/null"; root = "/dev/null";
@ -99,28 +115,48 @@ in
locations = { locations = {
# For telegram # For telegram
"/c3c3f34b-29fb-5feb-86e5-98c75ec8214b" = { "/c3c3f34b-29fb-5feb-86e5-98c75ec8214b" = {
priority = 100;
proxyPass = "http://127.0.0.1:8009"; proxyPass = "http://127.0.0.1:8009";
extraConfig = commonHeaders; extraConfig = commonHeaders;
}; };
# sliding-sync # For IRC appservice media proxy
"~ ^/(client/|_matrix/client/unstable/org.matrix.msc3575/sync)" = { "/media" = {
proxyPass = "http://127.0.0.1:8011"; priority = 100;
proxyPass = "http://127.0.0.1:${toString (config.services.matrix-appservice-irc.settings.ircService.mediaProxy.bindPort)}";
extraConfig = commonHeaders; extraConfig = commonHeaders;
}; };
"~* ^(/_matrix|/_synapse/client|/_synapse/oidc)" = { # Forward to the auth service
"~ ^/_matrix/client/(.*)/(login|logout|refresh)" = {
priority = 100;
proxyPass = "http://127.0.0.1:8090";
extraConfig = ''
${commonHeaders}
proxy_http_version 1.1;
# Forward the client IP address
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
'';
};
# Forward to Synapse
# as per https://element-hq.github.io/synapse/latest/reverse_proxy.html#nginx
"~ ^(/_matrix|/_synapse/client)" = {
priority = 200;
proxyPass = "http://127.0.0.1:8008"; proxyPass = "http://127.0.0.1:8008";
extraConfig = '' extraConfig = ''
${commonHeaders} ${commonHeaders}
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
client_body_buffer_size 25M; client_body_buffer_size 25M;
client_max_body_size 50M; client_max_body_size 50M;
proxy_max_temp_file_size 0; proxy_max_temp_file_size 0;
proxy_http_version 1.1;
''; '';
}; };
}; };

View file

@ -1,9 +1,14 @@
{ pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
{ {
default_server_config = { default_server_config = {
"m.homeserver" = { "m.homeserver" = {
base_url = "https://matrix.pub.solar"; base_url = "https://matrix.${config.pub-solar-os.networking.domain}";
server_name = "pub.solar"; server_name = "${config.pub-solar-os.networking.domain}";
}; };
"m.identity_server" = { "m.identity_server" = {
base_url = ""; base_url = "";
@ -45,4 +50,15 @@
# FUTUREWORK: Replace with pub.solar logo # FUTUREWORK: Replace with pub.solar logo
auth_header_logo_url = "themes/element/img/logos/element-logo.svg"; auth_header_logo_url = "themes/element/img/logos/element-logo.svg";
}; };
# Enable Element Call Beta
features = {
feature_video_rooms = true;
feature_group_calls = true;
feature_element_call_video_rooms = true;
};
element_call = {
url = "https://call.element.io";
participant_limit = 50;
brand = "Element Call";
};
} }

View file

@ -7,7 +7,7 @@
services.nginx.virtualHosts = { services.nginx.virtualHosts = {
"www.${config.pub-solar-os.networking.domain}" = { "www.${config.pub-solar-os.networking.domain}" = {
enableACME = true; enableACME = true;
addSSL = true; forceSSL = true;
extraConfig = '' extraConfig = ''
error_log /dev/null; error_log /dev/null;

View file

@ -10,9 +10,10 @@ let
webserverGroup = "hakkonaut"; webserverGroup = "hakkonaut";
in in
{ {
users.users.nginx.extraGroups = [ webserverGroup ];
services.nginx = { services.nginx = {
enable = true; enable = true;
group = webserverGroup;
enableReload = true; enableReload = true;
proxyCachePath.cache = { proxyCachePath.cache = {
enable = true; enable = true;
@ -21,6 +22,13 @@ in
recommendedOptimisation = true; recommendedOptimisation = true;
recommendedProxySettings = true; recommendedProxySettings = true;
recommendedTlsSettings = true; recommendedTlsSettings = true;
resolver.addresses = [
# quad9.net
"9.9.9.9"
"149.112.112.112"
"[2620:fe::fe]"
"[2620:fe::9]"
];
appendHttpConfig = '' appendHttpConfig = ''
# https://my.f5.com/manage/s/article/K51798430 # https://my.f5.com/manage/s/article/K51798430
proxy_headers_hash_bucket_size 128; proxy_headers_hash_bucket_size 128;

View file

@ -147,4 +147,26 @@ in
}; };
}; };
}; };
pub-solar-os.backups.restic.obs-portal = {
paths = [
"/var/lib/obs-portal/data"
"/tmp/obs-portal-backup.sql"
];
timerConfig = {
OnCalendar = "*-*-* 06:00:00 Etc/UTC";
};
initialize = true;
backupPrepareCommand = ''
${pkgs.docker}/bin/docker exec -i --user postgres obs-portal-db pg_dump obs > /tmp/obs-portal-backup.sql
'';
backupCleanupCommand = ''
rm /tmp/obs-portal-backup.sql
'';
pruneOpts = [
"--keep-daily 7"
"--keep-weekly 4"
"--keep-monthly 3"
];
};
} }

View file

@ -25,9 +25,4 @@
full_page_writes = false; full_page_writes = false;
}; };
}; };
systemd.services.postgresql = {
after = [ "var-lib-postgresql.mount" ];
requisite = [ "var-lib-postgresql.mount" ];
};
} }

View file

@ -142,8 +142,8 @@ lib.mapAttrsToList
cpu_using_90percent = { cpu_using_90percent = {
condition = ''100 - (avg by (instance) (irate(node_cpu_seconds_total{mode="idle"}[5m])) * 100) >= 90''; condition = ''100 - (avg by (instance) (irate(node_cpu_seconds_total{mode="idle"}[5m])) * 100) >= 90'';
time = "10m"; time = "20m";
description = "{{$labels.instance}} is running with cpu usage > 90% for at least 10 minutes: {{$value}}"; description = "{{$labels.instance}} is running with cpu usage > 90% for at least 20 minutes: {{$value}}";
}; };
reboot = { reboot = {
@ -234,10 +234,10 @@ lib.mapAttrsToList
}; };
*/ */
host_memory_under_memory_pressure = { #host_memory_under_memory_pressure = {
condition = "rate(node_vmstat_pgmajfault[1m]) > 1000"; # condition = "rate(node_vmstat_pgmajfault[1m]) > 1000";
description = "{{$labels.instance}}: The node is under heavy memory pressure. High rate of major page faults: {{$value}}"; # description = "{{$labels.instance}}: The node is under heavy memory pressure. High rate of major page faults: {{$value}}";
}; #};
# ext4_errors = { # ext4_errors = {
# condition = "ext4_errors_value > 0"; # condition = "ext4_errors_value > 0";
@ -250,4 +250,10 @@ lib.mapAttrsToList
# description = # description =
# "alertmanager: number of active silences has changed: {{$value}}"; # "alertmanager: number of active silences has changed: {{$value}}";
# }; # };
garage_cluster_healthy = {
condition = "cluster_healthy == 0";
time = "15m";
description = "garage cluster on {{$labels.instance}} is not healthy: {{$labels.result}}!";
};
}) })

View file

@ -12,15 +12,27 @@
owner = "alertmanager"; owner = "alertmanager";
}; };
services.caddy.virtualHosts."alerts.${config.pub-solar-os.networking.domain}" = { security.acme.certs = {
logFormat = lib.mkForce '' "alerts.${config.pub-solar-os.networking.domain}" = {
output discard # disable http challenge
''; webroot = null;
extraConfig = '' # enable dns challenge
bind 10.7.6.2 fd00:fae:fae:fae:fae:2:: dnsProvider = "namecheap";
tls internal };
reverse_proxy :${toString config.services.prometheus.alertmanager.port} };
'';
services.nginx.virtualHosts."alerts.${config.pub-solar-os.networking.domain}" = {
enableACME = true;
forceSSL = true;
listenAddresses = [
"10.7.6.5"
"[fd00:fae:fae:fae:fae:5::]"
];
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.services.prometheus.alertmanager.port}";
};
}; };
services.prometheus = { services.prometheus = {
@ -41,12 +53,6 @@
{ {
job_name = "node-exporter"; job_name = "node-exporter";
static_configs = [ static_configs = [
{
targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" ];
labels = {
instance = "flora-6";
};
}
{ {
targets = [ "nachtigall.wg.${config.pub-solar-os.networking.domain}" ]; targets = [ "nachtigall.wg.${config.pub-solar-os.networking.domain}" ];
labels = { labels = {
@ -69,6 +75,30 @@
instance = "tankstelle"; instance = "tankstelle";
}; };
} }
{
targets = [
"trinkgenossin.wg.${config.pub-solar-os.networking.domain}:${toString config.services.prometheus.exporters.node.port}"
];
labels = {
instance = "trinkgenossin";
};
}
{
targets = [
"delite.wg.${config.pub-solar-os.networking.domain}:${toString config.services.prometheus.exporters.node.port}"
];
labels = {
instance = "delite";
};
}
{
targets = [
"blue-shell.wg.${config.pub-solar-os.networking.domain}:${toString config.services.prometheus.exporters.node.port}"
];
labels = {
instance = "blue-shell";
};
}
]; ];
} }
{ {
@ -83,6 +113,29 @@
} }
]; ];
} }
{
job_name = "garage";
static_configs = [
{
targets = [ "trinkgenossin.wg.${config.pub-solar-os.networking.domain}:3903" ];
labels = {
instance = "trinkgenossin";
};
}
{
targets = [ "delite.wg.${config.pub-solar-os.networking.domain}:3903" ];
labels = {
instance = "delite";
};
}
{
targets = [ "blue-shell.wg.${config.pub-solar-os.networking.domain}:3903" ];
labels = {
instance = "blue-shell";
};
}
];
}
]; ];
ruleFiles = [ ruleFiles = [

View file

@ -18,7 +18,7 @@
}; };
clients = [ clients = [
{ {
url = "http://flora-6.wg.pub.solar:${toString flake.self.nixosConfigurations.flora-6.config.services.loki.configuration.server.http_listen_port}/loki/api/v1/push"; url = "http://trinkgenossin.wg.pub.solar:${toString flake.self.nixosConfigurations.trinkgenossin.config.services.loki.configuration.server.http_listen_port}/loki/api/v1/push";
} }
]; ];
scrape_configs = [ scrape_configs = [

View file

@ -0,0 +1,82 @@
{
flake,
config,
pkgs,
...
}:
let
ttrss-auth-oidc = pkgs.stdenv.mkDerivation {
name = "ttrss-auth-oidc";
version = "7ebfbc91e92bb133beb907c6bde79279ee5156df";
src = pkgs.fetchgit {
url = "https://git.tt-rss.org/fox/ttrss-auth-oidc.git";
rev = "7ebfbc91e92bb133beb907c6bde79279ee5156df";
hash = "sha256-G6vZBvSWms6s6nHZWsxJjMGuubt/imiBvbp6ykwrZbg=";
};
installPhase = ''
mkdir -p $out/auth_oidc
cp -r * $out/auth_oidc
'';
};
in
{
age.secrets.tt-rss-database-password = {
file = "${flake.self}/secrets/tt-rss-database-password.age";
owner = "tt_rss";
mode = "600";
};
age.secrets.tt-rss-keycloak-client-secret = {
file = "${flake.self}/secrets/tt-rss-keycloak-client-secret.age";
owner = "tt_rss";
mode = "600";
};
age.secrets.tt-rss-smtp-password = {
file = "${flake.self}/secrets/tt-rss-smtp-password.age";
owner = "tt_rss";
mode = "600";
};
age.secrets.tt-rss-feed-crypt-key = {
file = "${flake.self}/secrets/tt-rss-feed-crypt-key.age";
owner = "tt_rss";
mode = "600";
};
services.nginx.virtualHosts."rss.${config.pub-solar-os.networking.domain}" = {
enableACME = true;
forceSSL = true;
};
services.tt-rss = {
enable = true;
virtualHost = "rss.${config.pub-solar-os.networking.domain}";
selfUrlPath = "https://rss.${config.pub-solar-os.networking.domain}";
root = "/var/lib/tt-rss";
logDestination = "";
plugins = [
"auth_internal"
"note"
"auth_oidc"
];
pluginPackages = [ ttrss-auth-oidc ];
email = {
server = "mail.pub.solar";
security = "tls";
login = "admins@pub.solar";
fromName = "pub.solar RSS server";
fromAddress = "rss@pub.solar";
digestSubject = "[RSS] New headlines for last 24 hours";
};
database = {
passwordFile = config.age.secrets.tt-rss-database-password.path;
createLocally = true;
};
extraConfig = ''
putenv('TTRSS_SMTP_PASSWORD=' . file_get_contents('${config.age.secrets.tt-rss-smtp-password.path}'));
putenv('TTRSS_AUTH_OIDC_NAME=pub.solar ID');
putenv('TTRSS_AUTH_OIDC_URL=https://auth.${config.pub-solar-os.networking.domain}/realms/${config.pub-solar-os.auth.realm}/');
putenv('TTRSS_AUTH_OIDC_CLIENT_ID=tt-rss');
putenv('TTRSS_AUTH_OIDC_CLIENT_SECRET=' . file_get_contents('${config.age.secrets.tt-rss-keycloak-client-secret.path}'));
putenv('TTRSS_FEED_CRYPT_KEY=' . file_get_contents('${config.age.secrets.tt-rss-feed-crypt-key.path}'));
'';
};
}

View file

@ -0,0 +1,20 @@
{ flake, config, ... }:
{
boot.initrd.network = {
enable = true;
ssh = {
enable = true;
# To prevent ssh clients from freaking out because a different host key is used,
# a different port for ssh is useful (assuming the same host has also a regular sshd running)
port = 2222;
# Please create this manually the first time.
hostKeys = [ "/etc/secrets/initrd/ssh_host_ed25519_key" ];
authorizedKeys = flake.self.logins.sshPubKeys;
};
postCommands = ''
# Automatically ask for the password on SSH login
echo 'cryptsetup-askpass || echo "Unlock was successful; exiting SSH session" && exit 1' >> /root/.profile
'';
};
}

View file

@ -11,7 +11,7 @@
# Please create this manually the first time. # Please create this manually the first time.
hostKeys = [ "/etc/secrets/initrd/ssh_host_ed25519_key" ]; hostKeys = [ "/etc/secrets/initrd/ssh_host_ed25519_key" ];
authorizedKeys = config.pub-solar-os.authentication.sshPubKeys; authorizedKeys = flake.self.logins.sshPubKeys;
}; };
# this will automatically load the zfs password prompt on login # this will automatically load the zfs password prompt on login
# and kill the other prompt so boot can continue # and kill the other prompt so boot can continue

View file

@ -1,7 +1,7 @@
{ self, inputs, ... }: { inputs, ... }:
{ {
flake = { flake = {
nixosModules = rec { nixosModules = {
overlays = ( overlays = (
{ ... }: { ... }:
{ {
@ -10,14 +10,13 @@
final: prev: final: prev:
let let
unstable = import inputs.unstable { system = prev.system; }; unstable = import inputs.unstable { system = prev.system; };
nixpkgs-draupnir = import inputs.nixpkgs-draupnir { system = prev.system; };
in in
{ {
draupnir = nixpkgs-draupnir.draupnir;
element-themes = prev.callPackage ./pkgs/element-themes { inherit (inputs) element-themes; }; element-themes = prev.callPackage ./pkgs/element-themes { inherit (inputs) element-themes; };
element-stickerpicker = prev.callPackage ./pkgs/element-stickerpicker { element-stickerpicker = prev.callPackage ./pkgs/element-stickerpicker {
inherit (inputs) element-stickers maunium-stickerpicker; inherit (inputs) element-stickers maunium-stickerpicker;
}; };
nextcloud-skeleton = prev.callPackage ./pkgs/nextcloud-skeleton { };
} }
) )
]; ];

Some files were not shown because too many files have changed in this diff Show more