Compare commits

...

454 Commits

Author SHA1 Message Date
Michael Hoang
6482094cb4 Revert "cli: fix installation test with latest release of nixos-anywhere"
This reverts commit 46f746d09c.
2025-10-13 17:45:51 +02:00
Michael Hoang
cbcfcd507d treewide: reformat 2025-10-13 17:45:51 +02:00
Michael Hoang
9b71f106f6 clanServices/coredns: fix evaluation on 25.05 2025-10-13 17:31:07 +02:00
Michael Hoang
1482bd571c Revert "syncthing: fix vars generator not working with latest Syncthing"
This reverts commit 1f9b44a4ad.
2025-10-13 17:24:49 +02:00
Michael Hoang
ec2537d088 formatter: drop sizelint as it is not available in 25.05 2025-10-13 17:24:49 +02:00
Michael Hoang
41229af93e treewide: use 25.05 2025-10-13 17:24:49 +02:00
Michael Hoang
7e7e58eb64 Merge pull request 'Update nixpkgs' (#5211) from update-nixpkgs into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5211
2025-10-13 13:19:45 +00:00
Michael Hoang
46f746d09c cli: fix installation test with latest release of nixos-anywhere 2025-10-13 15:06:20 +02:00
clan-bot
56e03d1f25 Update nixpkgs 2025-10-13 14:51:00 +02:00
DavHau
dd783bdf85 Merge pull request 'vars/sops: stop writing on clan vars check' (#5490) from dave into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5490
2025-10-13 11:51:29 +00:00
DavHau
bf41a9ef00 vars/sops: stop writing on clan vars check
This fixes an issue where check_vars() would add machine keys or authorize machines for shared vars.

These write operations should only ever be done on a `clan vars generate`, which `clan vars check` should be a read-only operation
2025-10-13 18:43:49 +07:00
pinpox
f313ace19a Merge pull request 'Revert SSH docs' (#5488) from revert-ssh-docs into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5488
2025-10-13 10:56:54 +00:00
pinpox
fe8f7e919e Fix ssh docs 2025-10-13 12:51:42 +02:00
hsjobeki
c64276b64e Merge pull request 'lib: remove unused facts utils' (#5480) from fix-b into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5480
2025-10-13 10:06:42 +00:00
hsjobeki
436da16bf9 Merge pull request 'facts: add bigger migration warnings' (#5484) from fix-c into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5484
2025-10-13 08:11:38 +00:00
Johannes Kirschbauer
1c3282bb63 vars: simplify collectFiles 2025-10-13 10:05:53 +02:00
Johannes Kirschbauer
3c4b3e180e facts: add bigger migration warnings 2025-10-13 10:05:53 +02:00
hsjobeki
3953715b48 Merge pull request 'clan-cli: remove unused test fixture' (#5482) from fix-c into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5482
2025-10-12 16:07:44 +00:00
Johannes Kirschbauer
7b95fa039f clan-cli: remove unused test fixture 2025-10-12 18:00:52 +02:00
Johannes Kirschbauer
347668a57f lib: remove unused facts utils 2025-10-12 17:49:05 +02:00
hsjobeki
38712d6fe0 Merge pull request 'clan-core/nixos: remove autoloading magic in favour of simple code' (#5476) from fix-a into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5476
2025-10-12 14:39:17 +00:00
Johannes Kirschbauer
1d38ffa9c2 inventory: unit test autoloading with a virtual fs 2025-10-12 16:32:55 +02:00
clan-bot
665f036dec Merge pull request 'Update clan-core-for-checks in devFlake' (#5478) from update-devFlake-clan-core-for-checks into main 2025-10-12 00:12:04 +00:00
clan-bot
b74b6ff449 Update clan-core-for-checks in devFlake 2025-10-12 00:01:53 +00:00
clan-bot
9c8797e770 Merge pull request 'Update clan-core-for-checks in devFlake' (#5477) from update-devFlake-clan-core-for-checks into main 2025-10-11 20:12:29 +00:00
clan-bot
2be6cedec4 Update clan-core-for-checks in devFlake 2025-10-11 20:01:49 +00:00
Johannes Kirschbauer
7f49449f94 clan-core/nixos: remove autoloading magic in favour of simple code 2025-10-11 18:02:32 +02:00
hsjobeki
1f7bfa4e34 Merge pull request 'inventory: wrap autoloaded machines with correct file' (#5474) from fix-a into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5474
2025-10-11 16:00:37 +00:00
clan-bot
67fab4b11d Merge pull request 'Update clan-core-for-checks in devFlake' (#5475) from update-devFlake-clan-core-for-checks into main 2025-10-11 15:11:33 +00:00
clan-bot
18e3c72ef0 Update clan-core-for-checks in devFlake 2025-10-11 15:01:51 +00:00
Johannes Kirschbauer
84d4660a8d inventory: wrap autoloaded machines with correct file 2025-10-11 15:57:42 +02:00
clan-bot
13c3e1411a Merge pull request 'Update nixpkgs-dev in devFlake' (#5472) from update-devFlake-nixpkgs-dev into main 2025-10-11 10:14:29 +00:00
clan-bot
3c3a505aca Merge pull request 'Update clan-core-for-checks in devFlake' (#5471) from update-devFlake-clan-core-for-checks into main 2025-10-11 10:13:33 +00:00
clan-bot
f33c8e98fe Update nixpkgs-dev in devFlake 2025-10-11 10:02:05 +00:00
clan-bot
869a04e5af Update clan-core-for-checks in devFlake 2025-10-11 10:01:50 +00:00
clan-bot
d09fdc3528 Merge pull request 'Update clan-core-for-checks in devFlake' (#5470) from update-devFlake-clan-core-for-checks into main 2025-10-11 05:09:16 +00:00
clan-bot
652677d06f Update clan-core-for-checks in devFlake 2025-10-11 05:01:53 +00:00
clan-bot
ec163657cd Merge pull request 'Update clan-core-for-checks in devFlake' (#5469) from update-devFlake-clan-core-for-checks into main 2025-10-11 00:09:33 +00:00
clan-bot
7d3aa5936d Update clan-core-for-checks in devFlake 2025-10-11 00:01:51 +00:00
clan-bot
f8f8efbb88 Merge pull request 'Update treefmt-nix' (#5466) from update-treefmt-nix into main 2025-10-10 20:12:14 +00:00
clan-bot
8887e209d6 Merge pull request 'Update clan-core-for-checks in devFlake' (#5467) from update-devFlake-clan-core-for-checks into main 2025-10-10 20:10:50 +00:00
clan-bot
a72f74a36e Merge pull request 'Update treefmt-nix in devFlake' (#5468) from update-devFlake-treefmt-nix into main 2025-10-10 20:10:42 +00:00
clan-bot
0e0f8e73ec Update treefmt-nix in devFlake 2025-10-10 20:02:13 +00:00
clan-bot
f15a113f52 Update clan-core-for-checks in devFlake 2025-10-10 20:01:50 +00:00
clan-bot
1fbb4f5014 Update treefmt-nix 2025-10-10 20:01:49 +00:00
Michael Hoang
980a3c90b5 Merge pull request 'cli: ensure init-hardware-config passes Nix options to nixos-anywhere' (#5465) from push-mwotvwkqsluy into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5465
2025-10-10 15:40:34 +00:00
clan-bot
c01b14aef5 Merge pull request 'Update clan-core-for-checks in devFlake' (#5464) from update-devFlake-clan-core-for-checks into main 2025-10-10 15:10:05 +00:00
clan-bot
0a3e564ec0 Update clan-core-for-checks in devFlake 2025-10-10 15:01:52 +00:00
Michael Hoang
bc09d5c886 cli: ensure init-hardware-config passes Nix options to nixos-anywhere 2025-10-10 17:00:10 +02:00
Michael Hoang
f6b8d660d8 Merge pull request 'checks: fix SSH debugging over vsock not working' (#5463) from push-yplypuoxymkt into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5463
2025-10-10 14:40:10 +00:00
Michael Hoang
6014ddcd9a checks: fix SSH debugging over vsock not working 2025-10-10 16:32:54 +02:00
hsjobeki
551f5144c7 Merge pull request 'docs: Remove surprising statement on the front of documentation' (#5460) from kenji/ke-docs-fix into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5460
2025-10-10 12:24:49 +00:00
a-kenji
9a664c323c docs: Remove surprising statement on the front of documentation 2025-10-10 13:35:29 +02:00
clan-bot
7572dc8c2b Merge pull request 'Update clan-core-for-checks in devFlake' (#5454) from update-devFlake-clan-core-for-checks into main 2025-10-10 10:09:30 +00:00
clan-bot
e22f0d9e36 Merge pull request 'Update nixpkgs-dev in devFlake' (#5455) from update-devFlake-nixpkgs-dev into main 2025-10-10 10:07:47 +00:00
clan-bot
f93ae13448 Update nixpkgs-dev in devFlake 2025-10-10 10:02:12 +00:00
clan-bot
749bac63f4 Update clan-core-for-checks in devFlake 2025-10-10 10:01:53 +00:00
clan-bot
2bac2ec7ee Merge pull request 'Update clan-core-for-checks in devFlake' (#5452) from update-devFlake-clan-core-for-checks into main 2025-10-10 05:09:28 +00:00
clan-bot
f224d4b20c Update clan-core-for-checks in devFlake 2025-10-10 05:01:54 +00:00
clan-bot
47aa0a3b8e Merge pull request 'Update clan-core-for-checks in devFlake' (#5451) from update-devFlake-clan-core-for-checks into main 2025-10-10 00:11:09 +00:00
clan-bot
dd1cab5daa Update clan-core-for-checks in devFlake 2025-10-10 00:01:51 +00:00
clan-bot
32edae4ebd Merge pull request 'Update clan-core-for-checks in devFlake' (#5450) from update-devFlake-clan-core-for-checks into main 2025-10-09 20:09:43 +00:00
clan-bot
d829aa5838 Update clan-core-for-checks in devFlake 2025-10-09 20:01:50 +00:00
clan-bot
fd6619668b Merge pull request 'Update clan-core-for-checks in devFlake' (#5449) from update-devFlake-clan-core-for-checks into main 2025-10-09 15:09:37 +00:00
clan-bot
50a26ece32 Update clan-core-for-checks in devFlake 2025-10-09 15:01:53 +00:00
brianmcgee
8f224b00a6 Merge pull request 'various-ui-fixes' (#5448) from various-ui-fixes into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5448
2025-10-09 14:22:06 +00:00
Brian McGee
27d43ee21d fix(storybook): disable Sidebar story until we have a better mock data approach 2025-10-09 14:57:22 +01:00
Brian McGee
9626e22db7 fix(storybook): adjust flash installer on mount
It needs to handle possible missing state in the store on mount.
2025-10-09 14:57:22 +01:00
Brian McGee
1df329fe0d fix(storybook): disable service workflow stories
Temporary until we can decide how best to mock state.
2025-10-09 14:57:21 +01:00
Brian McGee
9da38abc77 fix(storybook): clan settings mock data shape changed 2025-10-09 14:57:20 +01:00
Brian McGee
2814c46e68 fix(storybook): button stories
- role="button" was removed at some point during refactoring which broke how the story was finding buttons
- button no longer has automatic loading state, instead it is now controlled.
2025-10-09 14:56:39 +01:00
Brian McGee
feef0a513e fix(storybook): remove cubes storybook
It wasn't adding much value and requires a mock Clan context which is a lot of effort at the min.
2025-10-09 14:56:38 +01:00
Brian McGee
9cc85b36c6 feat(ui): switch to webkit for storybook tests 2025-10-09 14:56:38 +01:00
hsjobeki
1465b18820 Merge pull request 'app: fix ClanSettings story' (#5447) from ui-cleanup into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5447
2025-10-09 13:27:56 +00:00
Johannes Kirschbauer
6fa0062573 app: fix ClanSettings story 2025-10-09 15:24:30 +02:00
clan-bot
6cd68c23f5 Merge pull request 'Update clan-core-for-checks in devFlake' (#5444) from update-devFlake-clan-core-for-checks into main 2025-10-09 10:09:50 +00:00
clan-bot
fdddc60676 Merge pull request 'Update nixpkgs-dev in devFlake' (#5445) from update-devFlake-nixpkgs-dev into main 2025-10-09 10:08:18 +00:00
clan-bot
684aa27068 Update nixpkgs-dev in devFlake 2025-10-09 10:02:12 +00:00
clan-bot
35d8deb393 Update clan-core-for-checks in devFlake 2025-10-09 10:01:53 +00:00
DavHau
e2f20b5ffc Merge pull request 'vars: refactor - make shared generators carry machines list' (#5443) from dave into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5443
2025-10-09 09:03:09 +00:00
DavHau
fd5d7934a0 vars: refactor - make shared generators carry machines list
This should make it simpler to improve the implementation of granting a new machine access to a shared secret.
The current approach using the health_check is  pretty hacky
2025-10-09 15:41:04 +07:00
Kenji Berthold
f194c31e0e Merge pull request 'Fix typo in "Authoring a 'clan.service' module"' (#5439) from nickdichev/clan-core:nickdichev-patch-1 into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5439
2025-10-09 08:32:40 +00:00
DavHau
061b598adf Merge pull request 'vars: cleanup + fix wording' (#5442) from dave into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5442
2025-10-09 05:44:14 +00:00
DavHau
744f35e0cc vars: cleanup + fix wording 2025-10-09 07:38:00 +02:00
clan-bot
4a6d46198c Merge pull request 'Update clan-core-for-checks in devFlake' (#5441) from update-devFlake-clan-core-for-checks into main 2025-10-09 05:11:10 +00:00
clan-bot
82d5ca9a0b Update clan-core-for-checks in devFlake 2025-10-09 05:01:51 +00:00
clan-bot
28d8a91a30 Merge pull request 'Update clan-core-for-checks in devFlake' (#5440) from update-devFlake-clan-core-for-checks into main 2025-10-09 00:09:59 +00:00
clan-bot
18f8d69728 Update clan-core-for-checks in devFlake 2025-10-09 00:01:50 +00:00
nickdichev
1feead4ce4 Fix typo in "Authoring a 'clan.service' module" 2025-10-08 20:16:16 +00:00
clan-bot
7f28110558 Merge pull request 'Update clan-core-for-checks in devFlake' (#5438) from update-devFlake-clan-core-for-checks into main 2025-10-08 20:09:55 +00:00
clan-bot
38787da891 Update clan-core-for-checks in devFlake 2025-10-08 20:01:48 +00:00
clan-bot
2b587da9fe Merge pull request 'Update clan-core-for-checks in devFlake' (#5437) from update-devFlake-clan-core-for-checks into main 2025-10-08 15:10:06 +00:00
clan-bot
acd2c1654b Update clan-core-for-checks in devFlake 2025-10-08 15:01:52 +00:00
hsjobeki
2ecb1399c3 Merge pull request 'docs: move generated markdown into a package' (#5436) from docs-source into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5436
2025-10-08 14:40:41 +00:00
Johannes Kirschbauer
46ae6b49c1 docs: move generated markdown into a package 2025-10-08 16:37:31 +02:00
hsjobeki
50a8a69719 Merge pull request 'fix: pull request template folder' (#5435) from fix-j into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5435
2025-10-08 14:28:00 +00:00
Johannes Kirschbauer
203761a99c fix: pull request template folder 2025-10-08 16:24:52 +02:00
hsjobeki
990b4e0223 Merge pull request 'docs: move option-search into own package' (#5434) from docs-source into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5434
2025-10-08 14:05:38 +00:00
Johannes Kirschbauer
032f54cbfb docs: fix links 2025-10-08 16:02:31 +02:00
hsjobeki
47146efa0f Merge pull request 'PR: add pull request template' (#5428) from team-workflow into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5428
2025-10-08 13:44:14 +00:00
Johannes Kirschbauer
c031abcd9e docs: move option-search into own package 2025-10-08 15:42:18 +02:00
Kenji Berthold
6b5dca5842 Merge pull request 'docs: Improve list view on testing' (#5433) from kenji/ke-docs-testing-display into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5433
2025-10-08 12:31:43 +00:00
a-kenji
016fe3d114 docs: Improve list view on testing 2025-10-08 14:29:01 +02:00
DavHau
9b60b4a989 Merge pull request 'lib/introspection: Test skipping instrospection of oneOf' (#5432) from ke-oneof-test into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5432
2025-10-08 12:07:58 +00:00
a-kenji
3088ce025b lib/introspection: Test skipping instrospection of oneOf
This builds on top of #5422.
And tests it's behavior.
2025-10-08 13:17:55 +02:00
hsjobeki
4f1fda3de6 Merge pull request 'docs: remove unused asciinema player' (#5431) from cus-docs into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5431
2025-10-08 11:08:09 +00:00
Johannes Kirschbauer
57f14827c2 docs: remove unused asciinema player 2025-10-08 13:01:26 +02:00
Johannes Kirschbauer
0390d5999d PR: add pull request template 2025-10-08 12:44:36 +02:00
clan-bot
58e9a28f14 Merge pull request 'Update clan-core-for-checks in devFlake' (#5429) from update-devFlake-clan-core-for-checks into main 2025-10-08 10:14:43 +00:00
clan-bot
b4ad5ca1bd Merge pull request 'Update nixpkgs-dev in devFlake' (#5430) from update-devFlake-nixpkgs-dev into main 2025-10-08 10:14:17 +00:00
clan-bot
84ecb1aae6 Update nixpkgs-dev in devFlake 2025-10-08 10:02:10 +00:00
clan-bot
2b9971f538 Update clan-core-for-checks in devFlake 2025-10-08 10:01:51 +00:00
pinpox
81e15cab34 Merge pull request 'Fix capitalization issue' (#5427) from doc-fixes-1 into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5427
2025-10-08 09:24:34 +00:00
pinpox
215c808071 Fix capitalization issue
fixes #4574
2025-10-08 11:21:06 +02:00
DavHau
4de052e58b Merge pull request 'lib/instrospection: Skip either(oneOf)' (#5422) from ke-introspection-either-or into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5422
2025-10-08 07:42:12 +00:00
Louis Opter
a06a7a7a2c clan-cli/secrets: update some error message in encrypt_secret (#5271)
Found that while reading through some code.

Co-authored-by: Jörg Thalheim <joerg@thalheim.io>
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5271
Co-authored-by: Louis Opter <louis@opter.org>
Co-committed-by: Louis Opter <louis@opter.org>
2025-10-08 07:41:14 +00:00
DavHau
94df3855b5 Merge pull request 'vars: raise error when shared generators differ between machines' (#5425) from dave into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5425
2025-10-08 07:20:03 +00:00
DavHau
a83f3c23f4 vars: raise error when shared generators differ between machines
When generators are shared between machines, their definition has to be the same across all machines. If not, it might lead to unexpected problems, as the architecture assumes that all definitions are the same.

fixes https://git.clan.lol/clan/clan-core/issues/5253
2025-10-08 14:02:39 +07:00
DavHau
da6cd324f0 Merge pull request 'vars/performance: aggregate selects over all machines and generators' (#5402) from dave into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5402
2025-10-08 06:04:50 +00:00
DavHau
c5b96df7b0 vars/performance: aggregate selects over all machines and generators
This improves the performance of deployment, by aggregating uncached select calls for vars generate into two batches.
batch 1: Get all generators of all machines
batch 2: get all final scripts for generators which need to run
2025-10-08 13:00:20 +07:00
clan-bot
c4feeace31 Merge pull request 'Update clan-core-for-checks in devFlake' (#5424) from update-devFlake-clan-core-for-checks into main 2025-10-08 05:06:31 +00:00
clan-bot
6117b664ae Update clan-core-for-checks in devFlake 2025-10-08 05:02:02 +00:00
clan-bot
b8fdb48fd8 Merge pull request 'Update clan-core-for-checks in devFlake' (#5423) from update-devFlake-clan-core-for-checks into main 2025-10-08 00:06:18 +00:00
clan-bot
9165f7ccaf Update clan-core-for-checks in devFlake 2025-10-08 00:01:52 +00:00
a-kenji
8058a7c158 lib/instrospection: Skip either(oneOf)
For either(oneOf) types, we skip introspection as we cannot
determine which branch of the union was taken without more context
This *should* be safe, as it can currently mostly be triggered through
The `extraModules` setting of inventory modules.

Example:

```
importer.roles.default.extraModules = [
    ../../modules/nixos/common.nix
];
```

Error Message:

```
Traceback (most recent call last):
  File "/nix/store/zaz4r4fic03m4whgz46p5jjszzlkq694-clan-cli/lib/python3.13/site-packages/clan_lib/templates/handler.py", line 91, in machine_template
    yield dst_machine_dir
  File "/nix/store/zaz4r4fic03m4whgz46p5jjszzlkq694-clan-cli/lib/python3.13/site-packages/clan_cli/machines/create.py", line 95, in create_machine
    inventory_store.write(inventory, message=f"machine '{machine_name}'")
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/zaz4r4fic03m4whgz46p5jjszzlkq694-clan-cli/lib/python3.13/site-packages/clan_lib/persist/inventory_store.py", line 269, in write
    write_info = self._write_map()
  File "/nix/store/zaz4r4fic03m4whgz46p5jjszzlkq694-clan-cli/lib/python3.13/site-packages/clan_lib/persist/inventory_store.py", line 214, in _write_map
    current_priority = self._get_inventory_current_priority()
  File "/nix/store/zaz4r4fic03m4whgz46p5jjszzlkq694-clan-cli/lib/python3.13/site-packages/clan_lib/persist/inventory_store.py", line 206, in _get_inventory_current_priority
    return self._flake.select("clanInternals.inventoryClass.introspection")
           ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/zaz4r4fic03m4whgz46p5jjszzlkq694-clan-cli/lib/python3.13/site-packages/clan_lib/flake/flake.py", line 1129, in select
    self.get_from_nix([selector])
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/nix/store/zaz4r4fic03m4whgz46p5jjszzlkq694-clan-cli/lib/python3.13/site-packages/clan_lib/flake/flake.py", line 1054, in get_from_nix
    raise ClanSelectError(
    ...<3 lines>...
    ) from e
clan_lib.flake.flake.ClanSelectError: Error on: $ clan select 'clanInternals.inventoryClass.introspection'
  Reason: Yet Unsupported type: either
Removing left-over machine directory: /tmp/hyperconfig/machines/trooo
Error on: $ clan select 'clanInternals.inventoryClass.introspection'
  Reason: Yet Unsupported type: either

```

Closes: #5387
2025-10-07 22:58:51 +02:00
clan-bot
fed61f49f9 Merge pull request 'Update clan-core-for-checks in devFlake' (#5421) from update-devFlake-clan-core-for-checks into main 2025-10-07 20:06:46 +00:00
clan-bot
f1f05c7e6b Update clan-core-for-checks in devFlake 2025-10-07 20:01:53 +00:00
clan-bot
7597d1560f Merge pull request 'Update nixpkgs-dev in devFlake' (#5419) from update-devFlake-nixpkgs-dev into main 2025-10-07 15:06:44 +00:00
clan-bot
f739e1b66d Merge pull request 'Update clan-core-for-checks in devFlake' (#5418) from update-devFlake-clan-core-for-checks into main 2025-10-07 15:06:44 +00:00
clan-bot
5d3609aacd Update nixpkgs-dev in devFlake 2025-10-07 15:02:06 +00:00
clan-bot
7aa51d6bd7 Update clan-core-for-checks in devFlake 2025-10-07 15:01:48 +00:00
pinpox
af91ae8c7f Merge pull request 'Add internal services guide' (#5254) from internal-service-doc into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5254
2025-10-07 14:39:52 +00:00
pinpox
077bf55fd7 Add internal services guide 2025-10-07 16:37:22 +02:00
hsjobeki
1f6dcb910f Merge pull request 'clan: ignore nixpkgs version checks in core' (#5416) from fix-override into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5416
2025-10-07 14:08:30 +00:00
Johannes Kirschbauer
6363d9c99c clan: ignore nixpkgs version checks in core 2025-10-07 16:03:56 +02:00
Kenji Berthold
fd30dbd1be Merge pull request 'docs: Fix typos' (#5415) from kenji/ke-docs-typo into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5415
2025-10-07 12:15:11 +00:00
a-kenji
ba4dc36ddf docs: Fix typos 2025-10-07 14:09:38 +02:00
Mic92
5abac04b15 Merge pull request 'network: fix generator cleanup in nested context manager' (#5412) from no-leaks into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5412
2025-10-07 11:51:38 +00:00
Kenji Berthold
8c84d32b13 Merge pull request 'docs: document vars generation requirement for service tests' (#5409) from kenji/ke-document-update-vars into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5409
2025-10-07 11:48:46 +00:00
a-kenji
c083548795 docs: document vars generation requirement for service tests
Add documentation explaining that services defining vars need to run
update-vars before tests can execute. Clarifies how `clan.directory`
determines where vars are generated and loaded from during testing.

Closes: #5380
2025-10-07 13:45:39 +02:00
Kenji Berthold
11af5c3471 Merge pull request 'docs: docs-integrity enable UTF-8 support' (#5413) from kenji/ke-html-proofer into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5413
2025-10-07 11:23:06 +00:00
a-kenji
dac8a40b9f docs: docs-integrity enable UTF-8 support 2025-10-07 13:13:55 +02:00
Jörg Thalheim
204f9d09e3 network: refactor get_best_remote to class-based context manager
Resolves the "RuntimeError: generator didn't stop after throw()" issue
by replacing the generator-based @contextmanager with an explicit class.

This maintains backward compatibility through a factory function.
2025-10-07 13:05:20 +02:00
Mic92
668067080d Merge pull request 'sops: don't leak secret key in debug logs' (#5411) from no-leaks into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5411
2025-10-07 10:00:47 +00:00
Jörg Thalheim
10ed2cc7f7 sops: don't leak secret key in debug logs 2025-10-07 11:31:12 +02:00
Kenji Berthold
060b22cf21 Merge pull request 'docs: Fix nixpkgs hierarchy' (#5410) from kenji/ke-qa-nixpkgs-input into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5410
2025-10-07 08:50:00 +00:00
a-kenji
965dddfee1 docs: Fix nixpkgs hierarchy 2025-10-07 10:34:22 +02:00
clan-bot
6e5d74ba22 Merge pull request 'Update nixpkgs-dev in devFlake' (#5408) from update-devFlake-nixpkgs-dev into main 2025-10-07 05:06:29 +00:00
clan-bot
4257f47a1a Merge pull request 'Update clan-core-for-checks in devFlake' (#5407) from update-devFlake-clan-core-for-checks into main 2025-10-07 05:06:22 +00:00
clan-bot
72b64a8b70 Update nixpkgs-dev in devFlake 2025-10-07 05:02:09 +00:00
clan-bot
e46e0543cd Update clan-core-for-checks in devFlake 2025-10-07 05:01:51 +00:00
clan-bot
0de79962ea Merge pull request 'Update clan-core-for-checks in devFlake' (#5406) from update-devFlake-clan-core-for-checks into main 2025-10-07 00:06:50 +00:00
clan-bot
6209816115 Update clan-core-for-checks in devFlake 2025-10-07 00:01:50 +00:00
clan-bot
ec21cda0cf Merge pull request 'Update clan-core-for-checks in devFlake' (#5404) from update-devFlake-clan-core-for-checks into main 2025-10-06 20:06:46 +00:00
clan-bot
8a29d102cd Merge pull request 'Update nixpkgs-dev in devFlake' (#5405) from update-devFlake-nixpkgs-dev into main 2025-10-06 20:06:28 +00:00
clan-bot
22787e7c93 Update nixpkgs-dev in devFlake 2025-10-06 20:02:12 +00:00
clan-bot
19fd72e075 Update clan-core-for-checks in devFlake 2025-10-06 20:01:53 +00:00
clan-bot
50be33088c Merge pull request 'Update clan-core-for-checks in devFlake' (#5403) from update-devFlake-clan-core-for-checks into main 2025-10-06 15:06:19 +00:00
clan-bot
6e7a67c830 Update clan-core-for-checks in devFlake 2025-10-06 15:01:51 +00:00
DavHau
1cb7c7d25f Merge pull request 'tests: disable state-version generation in all python tests' (#5399) from dave into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5399
2025-10-06 10:13:02 +00:00
DavHau
43b1744528 tests: disable state-version generation in all python tests
This improves the performance of tests, as there are less vars operations to perform.
2025-10-06 17:08:42 +07:00
clan-bot
27d1dd4400 Merge pull request 'Update clan-core-for-checks in devFlake' (#5400) from update-devFlake-clan-core-for-checks into main 2025-10-06 10:06:25 +00:00
clan-bot
5d27af51d8 Update clan-core-for-checks in devFlake 2025-10-06 10:01:52 +00:00
clan-bot
c737271585 Merge pull request 'Update clan-core-for-checks in devFlake' (#5398) from update-devFlake-clan-core-for-checks into main 2025-10-06 05:07:22 +00:00
clan-bot
f504a63e93 Update clan-core-for-checks in devFlake 2025-10-06 05:01:53 +00:00
clan-bot
ca53d14656 Merge pull request 'Update clan-core-for-checks in devFlake' (#5397) from update-devFlake-clan-core-for-checks into main 2025-10-06 00:09:06 +00:00
clan-bot
09d8a2b3a9 Update clan-core-for-checks in devFlake 2025-10-06 00:01:51 +00:00
Michael Hoang
2a67b09f51 Merge pull request 'test-fixtures: move to devFlake' (#5277) from push-mmqvttmrxtlk into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5277
2025-10-05 21:52:33 +00:00
Michael Hoang
3295e1561d checks: use new clan-core-for-checks to fix tests
I manually updated `flake.lock` and then evaluated the flake input to get the
correct NAR hash and last modified time.
2025-10-05 23:48:08 +02:00
Michael Hoang
9d0cec1422 checks/installation: don't require privateInputs for eval 2025-10-05 23:26:33 +02:00
Michael Hoang
dc66321a72 test-fixtures: move to devFlake 2025-10-05 23:26:24 +02:00
Michael Hoang
01baa46b36 flake: make privateInputs actually the inputs 2025-10-05 22:09:44 +02:00
clan-bot
dd0acfb628 Merge pull request 'Update nixpkgs-dev in devFlake' (#5395) from update-devFlake-nixpkgs-dev into main 2025-10-05 20:08:47 +00:00
clan-bot
ab14538c28 Merge pull request 'Update clan-core-for-checks in devFlake' (#5394) from update-devFlake-clan-core-for-checks into main 2025-10-05 20:06:58 +00:00
clan-bot
331287bfb6 Update nixpkgs-dev in devFlake 2025-10-05 20:02:08 +00:00
clan-bot
02cfe180db Update clan-core-for-checks in devFlake 2025-10-05 20:01:48 +00:00
clan-bot
b681737dce Merge pull request 'Update clan-core-for-checks in devFlake' (#5393) from update-devFlake-clan-core-for-checks into main 2025-10-05 15:07:57 +00:00
clan-bot
99011d2514 Update clan-core-for-checks in devFlake 2025-10-05 15:01:51 +00:00
hsjobeki
8aa4749a3e Merge pull request 'docs: check init htmlproofer' (#5392) from docs-simplify into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5392
2025-10-05 12:16:54 +00:00
Johannes Kirschbauer
359582118c docs: fix broken links 2025-10-05 14:14:12 +02:00
Johannes Kirschbauer
75c8feb42a docs: fix rss link 2025-10-05 14:14:12 +02:00
Johannes Kirschbauer
fcfd56c00c docs: check init htmlproofer
Checks integrity of internal links
post-rendering for problems that might have slipped through
we noticed a set of edge cases where the builtin link checking doesnt work
2025-10-05 14:14:12 +02:00
clan-bot
d598e19da4 Merge pull request 'Update clan-core-for-checks in devFlake' (#5390) from update-devFlake-clan-core-for-checks into main 2025-10-05 10:10:51 +00:00
clan-bot
23a07f15ab Merge pull request 'Update nixpkgs-dev in devFlake' (#5391) from update-devFlake-nixpkgs-dev into main 2025-10-05 10:10:50 +00:00
clan-bot
a3e34a9a1a Update nixpkgs-dev in devFlake 2025-10-05 10:02:09 +00:00
clan-bot
4991965ed9 Update clan-core-for-checks in devFlake 2025-10-05 10:01:51 +00:00
clan-bot
7560a07458 Merge pull request 'Update sops-nix' (#5384) from update-sops-nix into main 2025-10-05 05:09:54 +00:00
clan-bot
ee3b126a04 Merge pull request 'Update nixpkgs-dev in devFlake' (#5386) from update-devFlake-nixpkgs-dev into main 2025-10-05 05:09:12 +00:00
clan-bot
9c4af81b2f Merge pull request 'Update clan-core-for-checks in devFlake' (#5385) from update-devFlake-clan-core-for-checks into main 2025-10-05 05:09:09 +00:00
clan-bot
83878ceeda Update nixpkgs-dev in devFlake 2025-10-05 05:02:24 +00:00
clan-bot
6206b4a636 Update clan-core-for-checks in devFlake 2025-10-05 05:02:06 +00:00
clan-bot
da151a1ff4 Update sops-nix 2025-10-05 05:02:00 +00:00
clan-bot
dd686ed6dd Merge pull request 'Update clan-core-for-checks in devFlake' (#5383) from update-devFlake-clan-core-for-checks into main 2025-10-05 00:08:11 +00:00
clan-bot
93908bfa54 Update clan-core-for-checks in devFlake 2025-10-05 00:01:55 +00:00
clan-bot
e28b49317e Merge pull request 'Update clan-core-for-checks in devFlake' (#5381) from update-devFlake-clan-core-for-checks into main 2025-10-04 20:06:38 +00:00
clan-bot
6e7a96e762 Update clan-core-for-checks in devFlake 2025-10-04 20:01:49 +00:00
clan-bot
a026ead29d Merge pull request 'Update clan-core-for-checks in devFlake' (#5379) from update-devFlake-clan-core-for-checks into main 2025-10-04 15:06:03 +00:00
clan-bot
e1b8086c40 Update clan-core-for-checks in devFlake 2025-10-04 15:01:51 +00:00
clan-bot
9847d4558b Merge pull request 'Update clan-core-for-checks in devFlake' (#5377) from update-devFlake-clan-core-for-checks into main 2025-10-04 10:06:15 +00:00
clan-bot
eef1e4eca9 Merge pull request 'Update nixpkgs-dev in devFlake' (#5378) from update-devFlake-nixpkgs-dev into main 2025-10-04 10:05:59 +00:00
clan-bot
b7dd116136 Update nixpkgs-dev in devFlake 2025-10-04 10:02:09 +00:00
clan-bot
8c6d096fa7 Update clan-core-for-checks in devFlake 2025-10-04 10:01:52 +00:00
clan-bot
81d5132ac6 Merge pull request 'Update clan-core-for-checks in devFlake' (#5376) from update-devFlake-clan-core-for-checks into main 2025-10-04 05:06:05 +00:00
clan-bot
4c51a62b2a Update clan-core-for-checks in devFlake 2025-10-04 05:01:52 +00:00
clan-bot
e587735050 Merge pull request 'Update clan-core-for-checks in devFlake' (#5375) from update-devFlake-clan-core-for-checks into main 2025-10-04 00:06:32 +00:00
clan-bot
808e42f9b5 Update clan-core-for-checks in devFlake 2025-10-04 00:01:53 +00:00
Luis Hebendanz
fd62b4e9b3 Merge pull request 'clan_lib: Add clan_module_to_llm_function for ai integration' (#5361) from ai_support2 into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5361
2025-10-03 21:20:43 +00:00
clan-bot
dc1dd9aa3f Merge pull request 'Update clan-core-for-checks in devFlake' (#5373) from update-devFlake-clan-core-for-checks into main 2025-10-03 20:06:35 +00:00
clan-bot
67b1f36a38 Merge pull request 'Update nixpkgs-dev in devFlake' (#5374) from update-devFlake-nixpkgs-dev into main 2025-10-03 20:06:25 +00:00
clan-bot
9de5607394 Update nixpkgs-dev in devFlake 2025-10-03 20:02:08 +00:00
clan-bot
6e994d57c6 Update clan-core-for-checks in devFlake 2025-10-03 20:01:49 +00:00
hsjobeki
90c8f674e1 Merge pull request 'docs: move services into its reserved category' (#5372) from docs-simplify into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5372
2025-10-03 19:18:42 +00:00
Johannes Kirschbauer
3068a9e16a docs: move service definition into explizit markdown file 2025-10-03 21:16:32 +02:00
Johannes Kirschbauer
6c972c1e19 docs: move services into its reserved category 2025-10-03 21:02:18 +02:00
hsjobeki
807e3b2369 Merge pull request 'docs: fix contributing.md' (#5371) from docs-simplify into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5371
2025-10-03 18:54:36 +00:00
Johannes Kirschbauer
f9c58b4912 docs: fix contributing.md 2025-10-03 20:51:04 +02:00
hsjobeki
3fc2a55468 Merge pull request 'docs: consistent options reference' (#5370) from docs-simplify into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5370
2025-10-03 17:01:58 +00:00
Johannes Kirschbauer
8d9d4c9089 docs: fix absolute links need to be absolute 2025-10-03 18:59:47 +02:00
Johannes Kirschbauer
76d1d9b167 docs: consistent options reference 2025-10-03 18:17:13 +02:00
hsjobeki
652eb87bcc Merge pull request 'docs: move official services into subfolder' (#5369) from docs-simplify into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5369
2025-10-03 15:59:02 +00:00
Johannes Kirschbauer
028cf2a00c docs: move official services into subfolder 2025-10-03 17:56:47 +02:00
hsjobeki
c04e8b6ead Merge pull request 'docs: use absolute page URI' (#5368) from docs-simplify into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5368
2025-10-03 15:36:00 +00:00
Johannes Kirschbauer
08c2d574ce docs: use absolute page URI
This allows us to migrate to any framework that uses normal uri's
We just need to strip all .md endings in a simple grep command
2025-10-03 17:31:42 +02:00
hsjobeki
cf8720e4dd Merge pull request 'docs: decisions harmonize with file tree' (#5367) from docs-simplify into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5367
2025-10-03 15:08:28 +00:00
clan-bot
2bca2b2b7e Merge pull request 'Update clan-core-for-checks in devFlake' (#5366) from update-devFlake-clan-core-for-checks into main 2025-10-03 15:06:21 +00:00
Johannes Kirschbauer
f9c8ed74e1 docs: decisions harmonize with file tree 2025-10-03 17:06:14 +02:00
clan-bot
1a488dd2ad Update clan-core-for-checks in devFlake 2025-10-03 15:01:51 +00:00
hsjobeki
b58f37011d Merge pull request 'docs: move getting-started out of guides' (#5365) from docs-simplify into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5365
2025-10-03 14:53:59 +00:00
Johannes Kirschbauer
b1f6dd58f3 docs: move getting-started out of guides 2025-10-03 16:50:10 +02:00
hsjobeki
d634f2c9ae Merge pull request 'docs: unify markdown files with documentation titles' (#5364) from docs-simplify into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5364
2025-10-03 14:31:29 +00:00
Johannes Kirschbauer
90b1033870 docs: unify markdown files with documentation titles
This is preparational work to reduce the surface are of the different mappings

We want to reduce the following:

/guides/secrets.md -> Guides/getting started/How to use flakes with sops -> with '# Secrets Management'

- Title
- URI
- Filepath

should follow a stricter pattern to make it easy to maintain
2025-10-03 16:08:20 +02:00
Michael Hoang
d20ed9ec0c Merge pull request 'clanServices/sshd: readd default' (#5363) from push-wxxokvmsuymn into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5363
2025-10-03 13:11:27 +00:00
Michael Hoang
d847ab6fa1 clanServices/sshd: readd default 2025-10-03 15:07:09 +02:00
Michael Hoang
94272f76d4 Merge pull request 'cli: support getting chroot-realpath from nixos-init if necessary' (#5362) from push-wquonsppmwzr into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5362
2025-10-03 11:21:26 +00:00
Michael Hoang
56558023a8 cli: support getting chroot-realpath from nixos-init if necessary 2025-10-03 13:02:40 +02:00
Qubasa
b56230e3a7 clan_lib: Add clan_module_to_llm_function for ai integration 2025-10-03 12:32:33 +02:00
clan-bot
5e98b1335a Merge pull request 'Update clan-core-for-checks in devFlake' (#5360) from update-devFlake-clan-core-for-checks into main 2025-10-03 10:05:59 +00:00
clan-bot
36e03b75b2 Update clan-core-for-checks in devFlake 2025-10-03 10:01:52 +00:00
clan-bot
a371b9255c Merge pull request 'Update clan-core-for-checks in devFlake' (#5358) from update-devFlake-clan-core-for-checks into main 2025-10-03 05:06:07 +00:00
clan-bot
01e7a7ff26 Update clan-core-for-checks in devFlake 2025-10-03 05:01:54 +00:00
clan-bot
7f4faf8696 Merge pull request 'Update clan-core-for-checks in devFlake' (#5356) from update-devFlake-clan-core-for-checks into main 2025-10-03 00:05:59 +00:00
clan-bot
2a14e3e085 Update clan-core-for-checks in devFlake 2025-10-03 00:01:47 +00:00
clan-bot
b7521d00c7 Merge pull request 'Update nixpkgs-dev in devFlake' (#5355) from update-devFlake-nixpkgs-dev into main 2025-10-02 20:07:35 +00:00
clan-bot
7a77e563c9 Merge pull request 'Update clan-core-for-checks in devFlake' (#5354) from update-devFlake-clan-core-for-checks into main 2025-10-02 20:07:31 +00:00
clan-bot
bb119518c4 Update nixpkgs-dev in devFlake 2025-10-02 20:02:06 +00:00
clan-bot
d9048fdfda Update clan-core-for-checks in devFlake 2025-10-02 20:01:46 +00:00
Luis Hebendanz
4f00a22921 Merge pull request 'clanServices: Add role descriptions to all our services Part 2' (#5353) from Qubasa/clan-core:add_role_descriptions into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5353
2025-10-02 17:16:38 +00:00
Luis Hebendanz
4ce5f49144 Merge pull request 'inventory: Add roles.<name>.description option and a warning if it is not set Part 1' (#5340) from Qubasa/clan-core:ai_support into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5340
2025-10-02 17:16:29 +00:00
Qubasa
3d5d812e05 clanServices: Add role descriptions to all our services 2025-10-02 19:05:31 +02:00
Qubasa
2df96d3a9b inventory: Add roles.<name>.description option and a warning if it is not set 2025-10-02 18:57:55 +02:00
hsjobeki
b344db021b Merge pull request 'lib/clan: add checks' (#5352) from write-access into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5352
2025-10-02 16:41:23 +00:00
Johannes Kirschbauer
2dabff5db1 lib/clan: add checks 2025-10-02 18:21:37 +02:00
hsjobeki
e4a31f065d Merge pull request 'lib/introspection: backwards support older nixpkgs version with reduced features' (#5351) from write-access into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5351
2025-10-02 15:43:33 +00:00
Johannes Kirschbauer
149e14e85d lib/introspection: backwards support older nixpkgs version with reduced features 2025-10-02 17:39:03 +02:00
clan-bot
38339651cc Merge pull request 'Update clan-core-for-checks in devFlake' (#5350) from update-devFlake-clan-core-for-checks into main 2025-10-02 15:07:53 +00:00
clan-bot
652cc9fecc Update clan-core-for-checks in devFlake 2025-10-02 15:01:50 +00:00
hsjobeki
13c2581cbd Merge pull request 'lib/introspect: seperate headType from nullable' (#5332) from write-access into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5332
2025-10-02 14:44:56 +00:00
Johannes Kirschbauer
6f5f182aef lib/introspect: fix list item meta 2025-10-02 16:40:29 +02:00
DavHau
393323ba91 Merge pull request 'vars: optimize generate - reduce cache misses' (#5348) from dave into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5348
2025-10-02 11:50:26 +00:00
DavHau
5a6ffbf916 vars: optimize generate - reduce cache misses
optimize the `clan vars generate` procedure by pre-caching more selectors.

To achieve this, helper functions are added to several classes.

Also a debugging feature is added to the Flake class in order to track stack traces of cache misses
2025-10-02 18:46:11 +07:00
clan-bot
6de667c125 Merge pull request 'Update clan-core-for-checks in devFlake' (#5346) from update-devFlake-clan-core-for-checks into main 2025-10-02 10:09:11 +00:00
clan-bot
ba03ac29fd Merge pull request 'Update nixpkgs-dev in devFlake' (#5347) from update-devFlake-nixpkgs-dev into main 2025-10-02 10:09:04 +00:00
clan-bot
3691dcc9e0 Update nixpkgs-dev in devFlake 2025-10-02 10:02:09 +00:00
clan-bot
8c976445c0 Update clan-core-for-checks in devFlake 2025-10-02 10:01:50 +00:00
hsjobeki
586b0ddc5f Merge pull request 'ui: new api call design' (#5319) from hgl-api into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5319
2025-10-02 07:58:09 +00:00
clan-bot
cb0d4f2200 Merge pull request 'Update clan-core-for-checks in devFlake' (#5345) from update-devFlake-clan-core-for-checks into main 2025-10-02 05:06:44 +00:00
clan-bot
65f884616a Update clan-core-for-checks in devFlake 2025-10-02 05:01:51 +00:00
clan-bot
bc139cb0e2 Merge pull request 'Update clan-core-for-checks in devFlake' (#5344) from update-devFlake-clan-core-for-checks into main 2025-10-02 00:07:24 +00:00
clan-bot
b0bb03b1d1 Merge pull request 'Update flake-parts' (#5343) from update-flake-parts into main 2025-10-02 00:05:59 +00:00
clan-bot
6a4de66edb Update clan-core-for-checks in devFlake 2025-10-02 00:01:53 +00:00
clan-bot
0982378f96 Update flake-parts 2025-10-02 00:01:14 +00:00
clan-bot
8d4a9a959f Merge pull request 'Update nixpkgs-dev in devFlake' (#5342) from update-devFlake-nixpkgs-dev into main 2025-10-01 20:08:10 +00:00
clan-bot
5d0d302ed5 Merge pull request 'Update clan-core-for-checks in devFlake' (#5341) from update-devFlake-clan-core-for-checks into main 2025-10-01 20:07:28 +00:00
clan-bot
fd2730eaa7 Update nixpkgs-dev in devFlake 2025-10-01 20:02:07 +00:00
clan-bot
ef2d6f7949 Update clan-core-for-checks in devFlake 2025-10-01 20:01:47 +00:00
clan-bot
b9c07a7151 Merge pull request 'Update clan-core-for-checks in devFlake' (#5338) from update-devFlake-clan-core-for-checks into main 2025-10-01 15:06:05 +00:00
clan-bot
e6a3dd4c34 Merge pull request 'Update nixpkgs-dev in devFlake' (#5339) from update-devFlake-nixpkgs-dev into main 2025-10-01 15:05:33 +00:00
clan-bot
8697bc8b11 Update nixpkgs-dev in devFlake 2025-10-01 15:02:11 +00:00
clan-bot
a0d7bd0726 Update clan-core-for-checks in devFlake 2025-10-01 15:01:53 +00:00
Johannes Kirschbauer
1a8131f17f lib/introspect: recurse for nested attrsOf 2025-10-01 16:56:53 +02:00
Kenji Berthold
af62946651 Merge pull request 'service/yggdrasil: Fix typos' (#5337) from kenji/ke-fix-typos into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5337
2025-10-01 14:33:52 +00:00
a-kenji
351087d4e1 service/yggdrasil: Fix typos 2025-10-01 16:29:40 +02:00
Glen Huang
a268be69fe ui: new api call design
- api functions exist under api.*
- they accept an abort signal and return a promise
- they can be swapped out at build time depending on the platform
  (e.g.,window.method on desktop, fetch on mobile)
- TanStack Query functions should only be used in components, and
  only when we need its features, favoring simpler api.* calls
2025-10-01 20:51:48 +08:00
Michael Hoang
a9a1982943 Merge pull request 'nixos_test_lib: fix Nix in Nix not working with driverInteractive' (#5326) from push-puyqntntpwsx into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5326
2025-10-01 12:38:45 +00:00
Michael Hoang
850160d120 nixos_test_lib: fix Nix in Nix not working with driverInteractive 2025-10-01 14:33:23 +02:00
Kenji Berthold
8dc7256a4a Merge pull request 'pkgs/lib: verbose git commits' (#5333) from kenji/ke-verbose-git-commits into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5333
Reviewed-by: DavHau <d.hauer.it@gmail.com>
2025-10-01 10:28:45 +00:00
Luis Hebendanz
02fdb83282 Merge pull request 'docs: Update zerotier documentation' (#5335) from ke-docs-update-zerotier into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5335
2025-10-01 10:25:52 +00:00
a-kenji
df3fdf3758 pkgs/lib/git: List all files that are committed 2025-10-01 12:24:33 +02:00
a-kenji
11c559ee6d docs: Update zerotier documentation 2025-10-01 12:14:57 +02:00
a-kenji
5e6a202ce0 docs: Remove outdated information 2025-10-01 12:11:09 +02:00
clan-bot
f31dbe6c2a Merge pull request 'Update clan-core-for-checks in devFlake' (#5334) from update-devFlake-clan-core-for-checks into main 2025-10-01 10:06:02 +00:00
clan-bot
f18cdd20ce Update clan-core-for-checks in devFlake 2025-10-01 10:01:51 +00:00
a-kenji
08e2048eeb pkgs/lib: verbose git commits
Make sure the user knowns that a git command is run.

From the issue #4588:
> It is confusing at times, when executing some CLI command, expecting change,
then checking git status but no changes are observed.

We now log:
- git add (debug)
- git commit (info)

The git commit information is formatted the following way:
```
Committed machines/backup-target to git
```

Alternatives:
Currently this shows to the user what happened.
But we might want to show the user what is being run.
We could print the information before invoking the `git commit` itself.
Informing the user of a potential password input window.

Closes #4588
2025-10-01 11:46:01 +02:00
Johannes Kirschbauer
a8156d2fa6 lib/introspect: seperate headType from nullable 2025-10-01 09:51:34 +02:00
DavHau
e593d5da34 Merge pull request 'vars/list: reduce cache misses to 1' (#5331) from dave into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5331
2025-10-01 05:52:55 +00:00
DavHau
b72145d4aa vars/list: reduce cache misses to 1
This improves the performance for clan vars list
2025-10-01 12:43:09 +07:00
clan-bot
7cdd026e04 Merge pull request 'Update clan-core-for-checks in devFlake' (#5330) from update-devFlake-clan-core-for-checks into main 2025-10-01 05:06:12 +00:00
clan-bot
8e395d6715 Update clan-core-for-checks in devFlake 2025-10-01 05:02:08 +00:00
clan-bot
0868f466b6 Merge pull request 'Update clan-core-for-checks in devFlake' (#5329) from update-devFlake-clan-core-for-checks into main 2025-10-01 00:06:28 +00:00
clan-bot
7144b4b271 Update clan-core-for-checks in devFlake 2025-10-01 00:01:50 +00:00
clan-bot
b99d2363b9 Merge pull request 'Update clan-core-for-checks in devFlake' (#5327) from update-devFlake-clan-core-for-checks into main 2025-09-30 20:06:36 +00:00
clan-bot
0131900d79 Merge pull request 'Update nixpkgs-dev in devFlake' (#5328) from update-devFlake-nixpkgs-dev into main 2025-09-30 20:05:57 +00:00
clan-bot
2cd2a8b9b7 Update nixpkgs-dev in devFlake 2025-09-30 20:02:10 +00:00
clan-bot
f918149430 Update clan-core-for-checks in devFlake 2025-09-30 20:01:50 +00:00
clan-bot
7ecec19232 Merge pull request 'Update clan-core-for-checks in devFlake' (#5325) from update-devFlake-clan-core-for-checks into main 2025-09-30 15:06:05 +00:00
clan-bot
0ee297504c Update clan-core-for-checks in devFlake 2025-09-30 15:01:52 +00:00
hsjobeki
e680c3a478 Merge pull request 'classgen: mute expected warning' (#5324) from mute-warning into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5324
2025-09-30 13:40:08 +00:00
Johannes Kirschbauer
5a026eaf57 classgen: mute expected warning 2025-09-30 15:37:22 +02:00
Luis Hebendanz
873382eaa9 Merge pull request 'ai_support' (#5323) from Qubasa/clan-core:ai_support into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5323
2025-09-30 13:34:17 +00:00
Qubasa
07def16ff6 clan-app: fix logging error
on closing the logging file descriptor some parts of the program still
had the old reference. This will replace the old fd with stderr to fix
errors raised
2025-09-30 15:32:21 +02:00
Qubasa
fdc4b5f769 clan-app: full context tracebacks
If an exception now is thrown in one of the middlewares we will get a
proper traceback instead of a cut off one like before
2025-09-30 15:31:16 +02:00
Qubasa
8ad9f99606 clan-app: renamed deps folder to 'backend' 2025-09-30 15:30:39 +02:00
Luis Hebendanz
adb82a8414 Merge pull request 'clan-app: fixed broken webview delete_task' (#5321) from Qubasa/clan-core:ai_support into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5321
2025-09-30 12:09:56 +00:00
Qubasa
d36f97aa6d clan-app: fixed broken webview delete_task 2025-09-30 14:07:25 +02:00
DavHau
d2728bea27 Merge pull request 'vars: make list/get fast' (#5316) from vars into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5316
2025-09-30 10:15:08 +00:00
Jörg Thalheim
d67e23890b inline stringify_vars 2025-09-30 12:10:44 +02:00
Jörg Thalheim
597eb46c47 vars: speedup get/list
no longer get the full closure that is only needed for generating vars
2025-09-30 12:10:44 +02:00
clan-bot
4b4f4c8a30 Merge pull request 'Update clan-core-for-checks in devFlake' (#5317) from update-devFlake-clan-core-for-checks into main 2025-09-30 10:06:52 +00:00
clan-bot
467ba09720 Merge pull request 'Update nixpkgs-dev in devFlake' (#5318) from update-devFlake-nixpkgs-dev into main 2025-09-30 10:06:26 +00:00
clan-bot
1cfc9f1c5a Update nixpkgs-dev in devFlake 2025-09-30 10:02:12 +00:00
clan-bot
3ba9f1e957 Update clan-core-for-checks in devFlake 2025-09-30 10:01:52 +00:00
clan-bot
b9b8b6d5be Merge pull request 'Update clan-core-for-checks in devFlake' (#5315) from update-devFlake-clan-core-for-checks into main 2025-09-30 05:06:59 +00:00
clan-bot
f5aa3dc76f Update clan-core-for-checks in devFlake 2025-09-30 05:01:51 +00:00
clan-bot
9dcf3ae934 Merge pull request 'Update sops-nix' (#5313) from update-sops-nix into main 2025-09-30 00:09:19 +00:00
clan-bot
7629f497f5 Merge pull request 'Update clan-core-for-checks in devFlake' (#5314) from update-devFlake-clan-core-for-checks into main 2025-09-30 00:07:56 +00:00
clan-bot
39b6dd70e4 Update clan-core-for-checks in devFlake 2025-09-30 00:01:50 +00:00
clan-bot
c8e5b0ac00 Update sops-nix 2025-09-30 00:01:45 +00:00
clan-bot
d8a1699691 Merge pull request 'Update clan-core-for-checks in devFlake' (#5312) from update-devFlake-clan-core-for-checks into main 2025-09-29 20:06:44 +00:00
clan-bot
95dbd1e4cc Update clan-core-for-checks in devFlake 2025-09-29 20:01:49 +00:00
clan-bot
eaa359d70c Merge pull request 'Update clan-core-for-checks in devFlake' (#5311) from update-devFlake-clan-core-for-checks into main 2025-09-29 15:06:53 +00:00
clan-bot
37524ebb37 Update clan-core-for-checks in devFlake 2025-09-29 15:01:51 +00:00
brianmcgee
750f502ac6 Merge pull request 'feat(ui): remove add clan button from ListClansModal' (#5310) from feat/remove-add-clan-button into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5310
2025-09-29 10:45:15 +00:00
Brian McGee
aa0b03064a feat(ui): remove add clan button from ListClansModal
It was confusing how it worked. Cleaner to remove it and just have users X out of the modal and use the existing onboarding workflow.

Closes #5010
2025-09-29 11:42:41 +01:00
Brian McGee
04a1fa1cf0 feat(ui): remove add clan button from ListClansModal
It was confusing how it worked. Cleaner to remove it and just have users X out of the modal and use the existing onboarding workflow.

Closes #5010
2025-09-29 11:13:03 +01:00
clan-bot
7951e25319 Merge pull request 'Update clan-core-for-checks in devFlake' (#5308) from update-devFlake-clan-core-for-checks into main 2025-09-29 10:09:29 +00:00
clan-bot
d7c42cd2aa Merge pull request 'Update nixpkgs-dev in devFlake' (#5309) from update-devFlake-nixpkgs-dev into main 2025-09-29 10:08:53 +00:00
clan-bot
4f6cb72a3b Merge pull request 'Update data-mesher' (#5307) from update-data-mesher into main 2025-09-29 10:06:29 +00:00
clan-bot
ee6adf5ca5 Update nixpkgs-dev in devFlake 2025-09-29 10:02:08 +00:00
clan-bot
a2fffd64fd Update clan-core-for-checks in devFlake 2025-09-29 10:01:52 +00:00
clan-bot
18e0175412 Update data-mesher 2025-09-29 10:01:14 +00:00
hsjobeki
890486e353 Merge pull request 'use css modules for Tag and MachineStatus' (#5255) from hgl-ui-machine into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5255
2025-09-29 08:06:44 +00:00
hsjobeki
406ee30b1c Merge pull request 'docs/index: fix broken links' (#5306) from docs-fix into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5306
2025-09-29 07:38:04 +00:00
hsjobeki
ccced8c9f7 Merge pull request 'ui/onboarding: extract cube animation to its own component' (#5287) from hgl-onboarding into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5287
Reviewed-by: hsjobeki <hsjobeki@gmail.com>
2025-09-29 07:37:57 +00:00
Johannes Kirschbauer
13c0639fa9 docs/index: fix broken links 2025-09-29 09:30:29 +02:00
clan-bot
c59ae5205d Merge pull request 'Update clan-core-for-checks in devFlake' (#5305) from update-devFlake-clan-core-for-checks into main 2025-09-29 05:07:15 +00:00
clan-bot
a0df88dd71 Update clan-core-for-checks in devFlake 2025-09-29 05:01:52 +00:00
clan-bot
b813988dd6 Merge pull request 'Update clan-core-for-checks in devFlake' (#5304) from update-devFlake-clan-core-for-checks into main 2025-09-29 00:08:39 +00:00
clan-bot
db1f4db2ff Update clan-core-for-checks in devFlake 2025-09-29 00:01:54 +00:00
clan-bot
1ce0cbc9bb Merge pull request 'Update clan-core-for-checks in devFlake' (#5303) from update-devFlake-clan-core-for-checks into main 2025-09-28 20:06:35 +00:00
clan-bot
cb73261283 Update clan-core-for-checks in devFlake 2025-09-28 20:01:49 +00:00
clan-bot
d073306f05 Merge pull request 'Update clan-core-for-checks in devFlake' (#5302) from update-devFlake-clan-core-for-checks into main 2025-09-28 15:08:04 +00:00
clan-bot
e99d2876ce Update clan-core-for-checks in devFlake 2025-09-28 15:01:51 +00:00
clan-bot
9e09134f27 Merge pull request 'Update clan-core-for-checks in devFlake' (#5300) from update-devFlake-clan-core-for-checks into main 2025-09-28 10:06:29 +00:00
clan-bot
1826880edf Merge pull request 'Update nixpkgs-dev in devFlake' (#5301) from update-devFlake-nixpkgs-dev into main 2025-09-28 10:05:45 +00:00
clan-bot
8525855fe2 Update nixpkgs-dev in devFlake 2025-09-28 10:02:05 +00:00
clan-bot
17b91ce812 Update clan-core-for-checks in devFlake 2025-09-28 10:01:48 +00:00
clan-bot
5ebe68c9c9 Merge pull request 'Update clan-core-for-checks in devFlake' (#5299) from update-devFlake-clan-core-for-checks into main 2025-09-28 05:09:24 +00:00
clan-bot
861e050c02 Merge pull request 'Update sops-nix' (#5298) from update-sops-nix into main 2025-09-28 05:09:18 +00:00
clan-bot
5b72076895 Update clan-core-for-checks in devFlake 2025-09-28 05:01:55 +00:00
clan-bot
98ffa0c368 Update sops-nix 2025-09-28 05:01:51 +00:00
clan-bot
9e07526f7e Merge pull request 'Update clan-core-for-checks in devFlake' (#5297) from update-devFlake-clan-core-for-checks into main 2025-09-28 00:06:30 +00:00
clan-bot
5e0a8eb914 Update clan-core-for-checks in devFlake 2025-09-28 00:01:51 +00:00
clan-bot
814990f75d Merge pull request 'Update clan-core-for-checks in devFlake' (#5296) from update-devFlake-clan-core-for-checks into main 2025-09-27 20:06:34 +00:00
clan-bot
35b2dbec59 Update clan-core-for-checks in devFlake 2025-09-27 20:01:49 +00:00
clan-bot
68106108ee Merge pull request 'Update clan-core-for-checks in devFlake' (#5294) from update-devFlake-clan-core-for-checks into main 2025-09-27 15:08:11 +00:00
clan-bot
216dfbccec Merge pull request 'Update nixpkgs-dev in devFlake' (#5295) from update-devFlake-nixpkgs-dev into main 2025-09-27 15:07:29 +00:00
clan-bot
f8aa623c9a Update nixpkgs-dev in devFlake 2025-09-27 15:02:09 +00:00
clan-bot
3d30cfbb13 Update clan-core-for-checks in devFlake 2025-09-27 15:01:51 +00:00
clan-bot
5f1303ffd1 Merge pull request 'Update clan-core-for-checks in devFlake' (#5293) from update-devFlake-clan-core-for-checks into main 2025-09-27 10:06:12 +00:00
clan-bot
d300e35b6a Update clan-core-for-checks in devFlake 2025-09-27 10:01:53 +00:00
clan-bot
aa8e9758d1 Merge pull request 'Update clan-core-for-checks in devFlake' (#5292) from update-devFlake-clan-core-for-checks into main 2025-09-27 05:06:16 +00:00
clan-bot
4604a80f72 Update clan-core-for-checks in devFlake 2025-09-27 05:01:52 +00:00
clan-bot
54b0fe25f3 Merge pull request 'Update clan-core-for-checks in devFlake' (#5291) from update-devFlake-clan-core-for-checks into main 2025-09-27 00:06:41 +00:00
clan-bot
6dc1b1b102 Update clan-core-for-checks in devFlake 2025-09-27 00:01:51 +00:00
clan-bot
01b018866d Merge pull request 'Update clan-core-for-checks in devFlake' (#5289) from update-devFlake-clan-core-for-checks into main 2025-09-26 20:06:47 +00:00
clan-bot
03d402c8c5 Merge pull request 'Update nixpkgs-dev in devFlake' (#5290) from update-devFlake-nixpkgs-dev into main 2025-09-26 20:06:02 +00:00
clan-bot
29f8d783c4 Update nixpkgs-dev in devFlake 2025-09-26 20:02:07 +00:00
clan-bot
b14e82aae4 Update clan-core-for-checks in devFlake 2025-09-26 20:01:48 +00:00
clan-bot
cc23fe4e2d Merge pull request 'Update clan-core-for-checks in devFlake' (#5288) from update-devFlake-clan-core-for-checks into main 2025-09-26 15:06:52 +00:00
clan-bot
22d86b859e Update clan-core-for-checks in devFlake 2025-09-26 15:01:53 +00:00
Glen Huang
35f42107bb ui/onboarding: extract cube animation to its own component 2025-09-26 21:58:32 +08:00
hsjobeki
017f0901da Merge pull request 'ui/HostFileInput: refactor' (#5280) from hgl-hostfileinput into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5280
Reviewed-by: hsjobeki <hsjobeki@gmail.com>
2025-09-26 13:53:02 +00:00
Glen Huang
54c39edafd ui/HostFileInput: refactor
- Contain api call within itself
- Flatten input attributes
- Fix directory validation type error
2025-09-26 21:44:50 +08:00
Michael Hoang
d0148b47d5 Merge pull request 'checks/installation: refactor to remove hardcoded system' (#5278) from push-qkzrzzqorxsl into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5278
2025-09-26 12:24:29 +00:00
Michael Hoang
e4137a6876 checks/installation: fix NixOS configuration not having a system 2025-09-26 14:13:19 +02:00
Michael Hoang
356b0ab546 Merge pull request 'checks/installation: remove unused closureInfo' (#5286) from push-kpwummqulwnp into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5286
2025-09-26 11:32:04 +00:00
Michael Hoang
992273013f checks/installation: remove unused closureInfo 2025-09-26 13:19:25 +02:00
clan-bot
1e91be3efa Merge pull request 'Update clan-core-for-checks in devFlake' (#5284) from update-devFlake-clan-core-for-checks into main 2025-09-26 10:06:45 +00:00
clan-bot
907ccbfd22 Merge pull request 'Update nixpkgs-dev in devFlake' (#5285) from update-devFlake-nixpkgs-dev into main 2025-09-26 10:06:11 +00:00
clan-bot
49ff420b8b Update nixpkgs-dev in devFlake 2025-09-26 10:02:11 +00:00
clan-bot
269169815c Update clan-core-for-checks in devFlake 2025-09-26 10:01:52 +00:00
clan-bot
724b114c34 Merge pull request 'Update clan-core-for-checks in devFlake' (#5281) from update-devFlake-clan-core-for-checks into main 2025-09-26 05:06:45 +00:00
clan-bot
a5bc193411 Merge pull request 'Update nixpkgs-dev in devFlake' (#5282) from update-devFlake-nixpkgs-dev into main 2025-09-26 05:06:44 +00:00
clan-bot
2b321914f5 Update nixpkgs-dev in devFlake 2025-09-26 05:02:11 +00:00
clan-bot
921693f494 Update clan-core-for-checks in devFlake 2025-09-26 05:01:52 +00:00
clan-bot
374bb30eea Merge pull request 'Update clan-core-for-checks in devFlake' (#5279) from update-devFlake-clan-core-for-checks into main 2025-09-26 00:07:29 +00:00
clan-bot
0f2d38551f Update clan-core-for-checks in devFlake 2025-09-26 00:01:48 +00:00
Michael Hoang
3ec2c7c03b Merge pull request 'cli: support machines init-hardware-config --debug' (#5275) from push-kkrktlvvovkm into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5275
2025-09-25 20:14:53 +00:00
Michael Hoang
51bf7c8848 cli: support machines init-hardware-config --debug 2025-09-25 22:10:01 +02:00
clan-bot
14dfe1f9c5 Merge pull request 'Update clan-core-for-checks in devFlake' (#5274) from update-devFlake-clan-core-for-checks into main 2025-09-25 20:07:01 +00:00
clan-bot
88b3c1b7ac Update clan-core-for-checks in devFlake 2025-09-25 20:01:51 +00:00
Michael Hoang
285e72616e Merge pull request 'Update clan-core-for-checks in devFlake' (#5203) from update-devFlake-clan-core-for-checks into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5203
2025-09-25 17:23:41 +00:00
Michael Hoang
4cadedaa5d checks: don't use the global flake registry 2025-09-25 19:18:28 +02:00
Michael Hoang
27f87c7345 checks: add dependency on bubblewrap 2025-09-25 19:18:28 +02:00
clan-bot
6f5137fc56 Update clan-core-for-checks in devFlake 2025-09-25 19:18:28 +02:00
Michael Hoang
948bc41562 Merge pull request 'checks/flash: don't generate any vars' (#5273) from push-ormsrmnustku into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5273
2025-09-25 17:18:00 +00:00
Michael Hoang
ab5060a947 checks/flash: don't generate any vars 2025-09-25 19:14:10 +02:00
Luis Hebendanz
23d5a77814 Merge pull request 'Improve backup documentation' (#5272) from Qubasa/clan-core:docs_fix2 into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5272
2025-09-25 17:13:59 +00:00
Qubasa
6d6a085b97 flake.nix: re-add nuschtos 2025-09-25 19:03:32 +02:00
Qubasa
233d1a48af docs: make flake-inputs flow better 2025-09-25 18:59:27 +02:00
Qubasa
eddb1e35fc docs: make flake-parts guide flow better 2025-09-25 18:59:27 +02:00
Qubasa
2c2266ce8c docs: group templates together 2025-09-25 18:59:27 +02:00
Qubasa
a28270f43a docs: extensive backup documentation 2025-09-25 18:59:27 +02:00
Michael Hoang
824f80f357 Merge pull request 'checks/update: reduce instances of hardcoded system' (#5270) from push-toqqzsyoqotv into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5270
2025-09-25 16:40:53 +00:00
Michael Hoang
bec8de3faa checks/update: reduce instances of hardcoded system 2025-09-25 18:37:35 +02:00
Qubasa
f9681d49b6 borgbackup: fix requirement that client and server roles must be defined 2025-09-25 18:32:37 +02:00
hsjobeki
3169df3769 Merge pull request 'ui: no need to guard SolidQueryDevtools behind dev flag' (#5266) from hgl-query into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5266
2025-09-25 15:12:52 +00:00
clan-bot
1314f070f7 Merge pull request 'Update nix-darwin' (#5269) from update-nix-darwin into main 2025-09-25 15:07:19 +00:00
clan-bot
eba3b9f119 Update nix-darwin 2025-09-25 15:02:38 +00:00
Glen Huang
19b8c6022f ui: no need to guard SolidQueryDevtools behind dev flag
It won't be bundled in the prod build
2025-09-25 17:05:30 +08:00
clan-bot
587dde157f Merge pull request 'Update nixpkgs-dev in devFlake' (#5265) from update-devFlake-nixpkgs-dev into main 2025-09-25 00:06:28 +00:00
clan-bot
149ea99344 Update nixpkgs-dev in devFlake 2025-09-25 00:02:08 +00:00
clan-bot
1e32e2ef46 Merge pull request 'Update treefmt-nix in devFlake' (#5264) from update-devFlake-treefmt-nix into main 2025-09-24 20:08:06 +00:00
clan-bot
565972d602 Merge pull request 'Update treefmt-nix' (#5263) from update-treefmt-nix into main 2025-09-24 20:08:05 +00:00
clan-bot
dab2bffc7b Update treefmt-nix in devFlake 2025-09-24 20:02:15 +00:00
clan-bot
7385d7caec Update treefmt-nix 2025-09-24 20:01:47 +00:00
hsjobeki
becb32a947 Merge pull request 'lib/introspect: use valueMeta to expose more information' (#5262) from update-service into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5262
2025-09-24 16:38:14 +00:00
Johannes Kirschbauer
bcadf6b0fb clan_lib: write_rules complete internal keys 2025-09-24 18:34:09 +02:00
Johannes Kirschbauer
75121767d3 lib/introspect: use valueMeta to expose more information 2025-09-24 17:24:44 +02:00
Luis Hebendanz
8da25d5295 Merge pull request 'hardware-update-split' (#5261) from Qubasa/clan-core:hardware-update-split into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5261
2025-09-24 14:54:32 +00:00
Qubasa
ed069c48d3 clan-cli: rename to init-hardware-config 2025-09-24 16:51:06 +02:00
Qubasa
ac79bfb35f clan-cli: Split up update-hardware info into kexec-hardware-info 2025-09-24 15:47:33 +02:00
Qubasa
5595b2f862 clan-cli: Don't print trace on Keyboard Interrupt 2025-09-24 15:43:04 +02:00
hsjobeki
f03bcb8c14 Merge pull request 'ui: add npmrc to disable install scripts' (#5258) from hgl-npmrc into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5258
2025-09-24 11:01:26 +00:00
hsjobeki
b8e1fa2478 Merge pull request 'ui/cubes: use css modules for cube' (#5257) from hgl-ui-cube into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5257
2025-09-24 11:01:14 +00:00
Glen Huang
a2529e953b ui: add npmrc to disable install scripts
https://www.stepsecurity.io/blog/ctrl-tinycolor-and-40-npm-packages-compromised#immediate-actions-required
2025-09-24 18:59:04 +08:00
clan-bot
d783ae7c7c Merge pull request 'Update nixpkgs-dev in devFlake' (#5256) from update-devFlake-nixpkgs-dev into main 2025-09-24 10:06:06 +00:00
Glen Huang
2c66bd6508 ui/cubes: use css modules for cubes 2025-09-24 18:05:25 +08:00
clan-bot
aeb6b44ca6 Update nixpkgs-dev in devFlake 2025-09-24 10:02:02 +00:00
Glen Huang
cbb32e5ce9 ui/colors: remove the unused fgClass function 2025-09-24 17:48:21 +08:00
Glen Huang
5f13b24f80 ui/TagGroup: use css modules for TagGroup 2025-09-24 17:37:50 +08:00
Glen Huang
aaa353ec91 ui/Tag: use css modules 2025-09-24 17:17:47 +08:00
Glen Huang
c0281e8b4c ui/MachineStatus: use css modules 2025-09-24 15:47:38 +08:00
clan-bot
fde05adbd6 Merge pull request 'Update nuschtos in devFlake' (#5252) from update-devFlake-nuschtos into main 2025-09-24 00:05:38 +00:00
clan-bot
e1fff811ee Update nuschtos in devFlake 2025-09-24 00:02:02 +00:00
hsjobeki
3171512f30 Merge pull request 'ui/SectionService: not throwing errors inside the component rendering function' (#5249) from hgl-ui-froze into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5249
2025-09-23 15:54:09 +00:00
hsjobeki
b87953e2af Merge pull request 'clan: add nixpkgs version checks' (#5246) from update-service into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5246
2025-09-23 15:11:56 +00:00
Johannes Kirschbauer
ab8607e01a clan: add nixpkgs version checks 2025-09-23 17:07:33 +02:00
Glen Huang
6db8757281 ui/SectionService: not throwing errors inside the component rendering function 2025-09-23 22:50:22 +08:00
hsjobeki
18edf5f992 Merge pull request 'ui: use css modules for TextArea and TextInput' (#5235) from hgl-ui-textfield into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5235
2025-09-23 13:59:21 +00:00
Mic92
f6bc4ca6df Merge pull request 'clan-cli vars: speedup vars retrieval' (#5245) from faster_vars into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5245
Reviewed-by: Kenji Berthold <aks.kenji@protonmail.com>
2025-09-23 12:03:37 +00:00
lassulus
8567c2c09d clan-cli vars: speedup vars retrieval 2025-09-23 13:55:33 +02:00
Glen Huang
7be9e3f333 ui: use css modules for TextArea and TextInput 2025-09-23 15:01:17 +08:00
Qubasa
8ff060c589 clan_lib: Remote add to arguments override func 2025-09-22 11:20:49 +02:00
246 changed files with 5158 additions and 2676 deletions

View File

@@ -0,0 +1,12 @@
## Description of the change
<!-- Brief summary of the change if not already clear from the title -->
## Checklist
- [ ] Updated Documentation
- [ ] Added tests
- [ ] Doesn't affect backwards compatibility - or check the next points
- [ ] Add the breaking change and migration details to docs/release-notes.md
- !!! Review from another person is required *BEFORE* merge !!!
- [ ] Add introduction of major feature to docs/release-notes.md

View File

@@ -1,4 +0,0 @@
# Contributing to Clan
<!-- Local file: docs/CONTRIBUTING.md -->
Go to the Contributing guide at https://docs.clan.lol/guides/contributing/CONTRIBUTING

View File

@@ -19,28 +19,19 @@ let
nixosLib = import (self.inputs.nixpkgs + "/nixos/lib") { };
in
{
imports =
let
clanCoreModulesDir = ../nixosModules/clanCore;
getClanCoreTestModules =
let
moduleNames = attrNames (builtins.readDir clanCoreModulesDir);
testPaths = map (
moduleName: clanCoreModulesDir + "/${moduleName}/tests/flake-module.nix"
) moduleNames;
in
filter pathExists testPaths;
in
getClanCoreTestModules
++ filter pathExists [
./devshell/flake-module.nix
./flash/flake-module.nix
./installation/flake-module.nix
./update/flake-module.nix
./morph/flake-module.nix
./nixos-documentation/flake-module.nix
./dont-depend-on-repo-root.nix
];
imports = filter pathExists [
./devshell/flake-module.nix
./flash/flake-module.nix
./installation/flake-module.nix
./update/flake-module.nix
./morph/flake-module.nix
./nixos-documentation/flake-module.nix
./dont-depend-on-repo-root.nix
# clan core submodule tests
../nixosModules/clanCore/machine-id/tests/flake-module.nix
../nixosModules/clanCore/postgresql/tests/flake-module.nix
../nixosModules/clanCore/state-version/tests/flake-module.nix
];
flake.check = genAttrs [ "x86_64-linux" "aarch64-darwin" ] (
system:
let
@@ -120,7 +111,7 @@ in
) (self.darwinConfigurations or { })
// lib.mapAttrs' (n: lib.nameValuePair "package-${n}") (
if system == "aarch64-darwin" then
lib.filterAttrs (n: _: n != "docs" && n != "deploy-docs" && n != "docs-options") packagesToBuild
lib.filterAttrs (n: _: n != "docs" && n != "deploy-docs" && n != "option-search") packagesToBuild
else
packagesToBuild
)

View File

@@ -13,8 +13,6 @@
fileSystems."/".device = lib.mkDefault "/dev/vda";
boot.loader.grub.device = lib.mkDefault "/dev/vda";
# We need to use `mkForce` because we inherit from `test-install-machine`
# which currently hardcodes `nixpkgs.hostPlatform`
nixpkgs.hostPlatform = lib.mkForce system;
imports = [ self.nixosModules.test-flash-machine ];
@@ -28,6 +26,9 @@
{
imports = [ self.nixosModules.test-install-machine-without-system ];
# We don't want our system to define any `vars` generators as these can't
# be generated as the flake is inside `/nix/store`.
clan.core.settings.state-version.enable = false;
clan.core.vars.generators.test = lib.mkForce { };
disko.devices.disk.main.preCreateHook = lib.mkForce "";
@@ -59,11 +60,11 @@
pkgs.kbd.out
self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".pkgs.perlPackages.ConfigIniFiles
self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".pkgs.perlPackages.FileSlurp
pkgs.bubblewrap
self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".config.system.build.toplevel
self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".config.system.build.diskoScript
self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".config.system.build.diskoScript.drvPath
(import ../installation/facter-report.nix pkgs.hostPlatform.system)
]
++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs);
closureInfo = pkgs.closureInfo { rootPaths = dependencies; };
@@ -87,7 +88,7 @@
substituters = lib.mkForce [ ];
hashed-mirrors = null;
connect-timeout = lib.mkForce 3;
flake-registry = pkgs.writeText "flake-registry" ''{"flakes":[],"version":2}'';
flake-registry = "";
experimental-features = [
"nix-command"
"flakes"

View File

@@ -1,10 +0,0 @@
system:
builtins.fetchurl {
url = "https://git.clan.lol/clan/test-fixtures/raw/commit/4a2bc56d886578124b05060d3fb7eddc38c019f8/nixos-vm-facter-json/${system}.json";
sha256 =
{
aarch64-linux = "sha256:1rlfymk03rmfkm2qgrc8l5kj5i20srx79n1y1h4nzlpwaz0j7hh2";
x86_64-linux = "sha256:16myh0ll2gdwsiwkjw5ba4dl23ppwbsanxx214863j7nvzx42pws";
}
.${system};
}

View File

@@ -1,8 +1,8 @@
{
config,
self,
lib,
privateInputs,
...
}:
{
@@ -14,26 +14,37 @@
# you can get a new one by adding
# client.fail("cat test-flake/machines/test-install-machine/facter.json >&2")
# to the installation test.
clan.machines.test-install-machine-without-system = {
fileSystems."/".device = lib.mkDefault "/dev/vda";
boot.loader.grub.device = lib.mkDefault "/dev/vda";
imports = [
self.nixosModules.test-install-machine-without-system
];
};
clan.machines.test-install-machine-with-system =
{ pkgs, ... }:
{
# https://git.clan.lol/clan/test-fixtures
facter.reportPath = import ./facter-report.nix pkgs.hostPlatform.system;
clan.machines = {
test-install-machine-without-system = {
fileSystems."/".device = lib.mkDefault "/dev/vda";
boot.loader.grub.device = lib.mkDefault "/dev/vda";
imports = [ self.nixosModules.test-install-machine-without-system ];
imports = [
self.nixosModules.test-install-machine-without-system
];
};
}
// (lib.listToAttrs (
lib.map (
system:
lib.nameValuePair "test-install-machine-${system}" {
imports = [
self.nixosModules.test-install-machine-without-system
(
if privateInputs ? test-fixtures then
{
facter.reportPath = privateInputs.test-fixtures + /nixos-vm-facter-json/${system}.json;
}
else
{ nixpkgs.hostPlatform = system; }
)
];
fileSystems."/".device = lib.mkDefault "/dev/vda";
boot.loader.grub.device = lib.mkDefault "/dev/vda";
}
) (lib.filter (lib.hasSuffix "linux") config.systems)
));
flake.nixosModules = {
test-install-machine-without-system =
@@ -149,13 +160,12 @@
closureInfo = pkgs.closureInfo {
rootPaths = [
privateInputs.clan-core-for-checks
self.clanInternals.machines.${pkgs.hostPlatform.system}.test-install-machine-with-system.config.system.build.toplevel
self.clanInternals.machines.${pkgs.hostPlatform.system}.test-install-machine-with-system.config.system.build.initialRamdisk
self.clanInternals.machines.${pkgs.hostPlatform.system}.test-install-machine-with-system.config.system.build.diskoScript
self.nixosConfigurations."test-install-machine-${pkgs.hostPlatform.system}".config.system.build.toplevel
self.nixosConfigurations."test-install-machine-${pkgs.hostPlatform.system}".config.system.build.initialRamdisk
self.nixosConfigurations."test-install-machine-${pkgs.hostPlatform.system}".config.system.build.diskoScript
pkgs.stdenv.drvPath
pkgs.bash.drvPath
pkgs.buildPackages.xorg.lndir
(import ./facter-report.nix pkgs.hostPlatform.system)
]
++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs);
};
@@ -205,7 +215,7 @@
# Prepare test flake and Nix store
flake_dir = prepare_test_flake(
temp_dir,
"${self.checks.x86_64-linux.clan-core-for-checks}",
"${self.checks.${pkgs.hostPlatform.system}.clan-core-for-checks}",
"${closureInfo}"
)
@@ -216,6 +226,22 @@
"${../assets/ssh/privkey}"
)
# Run clan install from host using port forwarding
clan_cmd = [
"${self.packages.${pkgs.system}.clan-cli-full}/bin/clan",
"machines",
"init-hardware-config",
"--debug",
"--flake", str(flake_dir),
"--yes", "test-install-machine-without-system",
"--host-key-check", "none",
"--target-host", f"nonrootuser@localhost:{ssh_conn.host_port}",
"-i", ssh_conn.ssh_key,
"--option", "store", os.environ['CLAN_TEST_STORE']
]
subprocess.run(clan_cmd, check=True)
# Run clan install from host using port forwarding
clan_cmd = [
"${self.packages.${pkgs.system}.clan-cli-full}/bin/clan",
@@ -270,7 +296,7 @@
# Prepare test flake and Nix store
flake_dir = prepare_test_flake(
temp_dir,
"${self.checks.x86_64-linux.clan-core-for-checks}",
"${self.checks.${pkgs.hostPlatform.system}.clan-core-for-checks}",
"${closureInfo}"
)

View File

@@ -15,7 +15,6 @@ let
networking.useNetworkd = true;
services.openssh.enable = true;
services.openssh.settings.UseDns = false;
services.openssh.settings.PasswordAuthentication = false;
system.nixos.variant_id = "installer";
environment.systemPackages = [
pkgs.nixos-facter
@@ -147,28 +146,11 @@ let
];
doCheck = false;
};
# Common closure info
closureInfo = pkgs.closureInfo {
rootPaths = [
self.checks.x86_64-linux.clan-core-for-checks
self.clanInternals.machines.${pkgs.hostPlatform.system}.test-install-machine-with-system.config.system.build.toplevel
self.clanInternals.machines.${pkgs.hostPlatform.system}.test-install-machine-with-system.config.system.build.initialRamdisk
self.clanInternals.machines.${pkgs.hostPlatform.system}.test-install-machine-with-system.config.system.build.diskoScript
self.clanInternals.machines.${pkgs.hostPlatform.system}.test-install-machine-with-system.config.system.clan.deployment.file
pkgs.stdenv.drvPath
pkgs.bash.drvPath
pkgs.buildPackages.xorg.lndir
]
++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs);
};
in
{
inherit
target
baseTestMachine
nixosTestLib
closureInfo
;
}

View File

@@ -35,7 +35,6 @@
pkgs.stdenv.drvPath
pkgs.stdenvNoCC
self.nixosConfigurations.test-morph-machine.config.system.build.toplevel
(import ../installation/facter-report.nix pkgs.hostPlatform.system)
]
++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs);
closureInfo = pkgs.closureInfo { rootPaths = dependencies; };

View File

@@ -29,32 +29,34 @@ nixosLib.runTest (
{ nodes, ... }:
''
import subprocess
from nixos_test_lib.nix_setup import setup_nix_in_nix # type: ignore[import-untyped]
import tempfile
from nixos_test_lib.nix_setup import setup_nix_in_nix
setup_nix_in_nix(None) # No closure info for this test
with tempfile.TemporaryDirectory() as temp_dir:
setup_nix_in_nix(temp_dir, None) # No closure info for this test
start_all()
admin1.wait_for_unit("multi-user.target")
peer1.wait_for_unit("multi-user.target")
start_all()
admin1.wait_for_unit("multi-user.target")
peer1.wait_for_unit("multi-user.target")
# peer1 should have the 'hello' file
peer1.succeed("cat ${nodes.peer1.clan.core.vars.generators.new-service.files.not-a-secret.path}")
# peer1 should have the 'hello' file
peer1.succeed("cat ${nodes.peer1.clan.core.vars.generators.new-service.files.not-a-secret.path}")
ls_out = peer1.succeed("ls -la ${nodes.peer1.clan.core.vars.generators.new-service.files.a-secret.path}")
# Check that the file is owned by 'nobody'
assert "nobody" in ls_out, f"File is not owned by 'nobody': {ls_out}"
# Check that the file is in the 'users' group
assert "users" in ls_out, f"File is not in the 'users' group: {ls_out}"
# Check that the file is in the '0644' mode
assert "-rw-r--r--" in ls_out, f"File is not in the '0644' mode: {ls_out}"
ls_out = peer1.succeed("ls -la ${nodes.peer1.clan.core.vars.generators.new-service.files.a-secret.path}")
# Check that the file is owned by 'nobody'
assert "nobody" in ls_out, f"File is not owned by 'nobody': {ls_out}"
# Check that the file is in the 'users' group
assert "users" in ls_out, f"File is not in the 'users' group: {ls_out}"
# Check that the file is in the '0644' mode
assert "-rw-r--r--" in ls_out, f"File is not in the '0644' mode: {ls_out}"
# Run clan command
result = subprocess.run(
["${
clan-core.packages.${hostPkgs.system}.clan-cli
}/bin/clan", "machines", "list", "--flake", "${config.clan.test.flakeForSandbox}"],
check=True
)
# Run clan command
result = subprocess.run(
["${
clan-core.packages.${hostPkgs.system}.clan-cli
}/bin/clan", "machines", "list", "--flake", "${config.clan.test.flakeForSandbox}"],
check=True
)
'';
}
)

View File

@@ -27,7 +27,9 @@
modules.new-service = {
_class = "clan.service";
manifest.name = "new-service";
roles.peer = { };
roles.peer = {
description = "A peer that uses the new-service to generate some files.";
};
perMachine = {
nixosModule = {
# This should be generated by:

View File

@@ -34,7 +34,9 @@ nixosLib.runTest (
modules.new-service = {
_class = "clan.service";
manifest.name = "new-service";
roles.peer = { };
roles.peer = {
description = "A peer that uses the new-service to generate some files.";
};
perMachine = {
nixosModule = {
# This should be generated by:

View File

@@ -67,6 +67,15 @@
];
};
nix.settings = {
flake-registry = "";
# required for setting the `flake-registry`
experimental-features = [
"nix-command"
"flakes"
];
};
# Define the mounts that exist in the container to prevent them from being stopped
fileSystems = {
"/" = {
@@ -106,13 +115,13 @@
let
closureInfo = pkgs.closureInfo {
rootPaths = [
self.packages.${pkgs.system}.clan-cli
self.checks.${pkgs.system}.clan-core-for-checks
self.packages.${pkgs.hostPlatform.system}.clan-cli
self.checks.${pkgs.hostPlatform.system}.clan-core-for-checks
self.clanInternals.machines.${pkgs.hostPlatform.system}.test-update-machine.config.system.build.toplevel
pkgs.stdenv.drvPath
pkgs.bash.drvPath
pkgs.buildPackages.xorg.lndir
(import ../installation/facter-report.nix pkgs.hostPlatform.system)
pkgs.bubblewrap
]
++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs);
};
@@ -123,7 +132,7 @@
imports = [ self.nixosModules.test-update-machine ];
};
extraPythonPackages = _p: [
self.legacyPackages.${pkgs.system}.nixosTestLib
self.legacyPackages.${pkgs.hostPlatform.system}.nixosTestLib
];
testScript = ''
@@ -145,7 +154,7 @@
# Prepare test flake and Nix store
flake_dir = prepare_test_flake(
temp_dir,
"${self.checks.x86_64-linux.clan-core-for-checks}",
"${self.checks.${pkgs.hostPlatform.system}.clan-core-for-checks}",
"${closureInfo}"
)
(flake_dir / ".clan-flake").write_text("") # Ensure .clan-flake exists
@@ -212,12 +221,13 @@
[
"${pkgs.nix}/bin/nix",
"copy",
"--from",
f"{temp_dir}/store",
"--to",
"ssh://root@192.168.1.1",
"--no-check-sigs",
f"${self.packages.${pkgs.system}.clan-cli}",
f"${self.packages.${pkgs.hostPlatform.system}.clan-cli}",
"--extra-experimental-features", "nix-command flakes",
"--from", f"{os.environ["TMPDIR"]}/store"
],
check=True,
env={
@@ -232,7 +242,7 @@
"-o", "UserKnownHostsFile=/dev/null",
"-o", "StrictHostKeyChecking=no",
f"root@192.168.1.1",
"${self.packages.${pkgs.system}.clan-cli}/bin/clan",
"${self.packages.${pkgs.hostPlatform.system}.clan-cli}/bin/clan",
"machines",
"update",
"--debug",
@@ -260,7 +270,7 @@
# Run clan update command
subprocess.run([
"${self.packages.${pkgs.system}.clan-cli-full}/bin/clan",
"${self.packages.${pkgs.hostPlatform.system}.clan-cli-full}/bin/clan",
"machines",
"update",
"--debug",
@@ -287,7 +297,7 @@
# Run clan update command with --build-host
subprocess.run([
"${self.packages.${pkgs.system}.clan-cli-full}/bin/clan",
"${self.packages.${pkgs.hostPlatform.system}.clan-cli-full}/bin/clan",
"machines",
"update",
"--debug",

View File

@@ -1,14 +1,14 @@
{
_class = "clan.service";
manifest.name = "clan-core/admin";
manifest.description = "Convenient Administration for the Clan App";
manifest.description = "Adds a root user with ssh access";
manifest.categories = [ "Utility" ];
roles.default = {
description = "Placeholder role to apply the admin service";
interface =
{ lib, ... }:
{
options = {
allowedKeys = lib.mkOption {
default = { };

View File

@@ -9,7 +9,7 @@ inventory.instances = {
};
roles.client.machines."jon".settings = {
destinations."storagebox" = {
repo = "username@$hostname:/./borgbackup";
repo = "username@hostname:/./borgbackup";
rsh = ''ssh -oPort=23 -i /run/secrets/vars/borgbackup/borgbackup.ssh'';
};
};

View File

@@ -9,7 +9,7 @@
# TODO: a client can only be in one instance, add constraint
roles.server = {
description = "A borgbackup server that stores the backups of clients.";
interface =
{ lib, ... }:
{
@@ -54,7 +54,7 @@
authorizedKeys = [ (builtins.readFile (borgbackupIpMachinePath machineName)) ];
# };
# }) machinesWithKey;
}) roles.client.machines;
}) (roles.client.machines or { });
in
hosts;
};
@@ -62,6 +62,7 @@
};
roles.client = {
description = "A borgbackup client that backs up to all borgbackup server roles.";
interface =
{
lib,
@@ -187,7 +188,7 @@
config.clan.core.vars.generators.borgbackup.files."borgbackup.ssh".path
} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=Yes";
};
}) (builtins.attrNames roles.server.machines);
}) (builtins.attrNames (roles.server.machines or { }));
in
(builtins.listToAttrs destinations);

View File

@@ -2,12 +2,12 @@
{
_class = "clan.service";
manifest.name = "certificates";
manifest.description = "Sets up a certificates internal to your Clan";
manifest.description = "Sets up a PKI certificate chain using step-ca";
manifest.categories = [ "Network" ];
manifest.readme = builtins.readFile ./README.md;
roles.ca = {
description = "A certificate authority that issues and signs certificates for other machines.";
interface =
{ lib, ... }:
{
@@ -184,6 +184,7 @@
# Empty role, so we can add non-ca machins to the instance to trust the CA
roles.default = {
description = "A machine that trusts the CA and can get certificates issued by it.";
interface =
{ lib, ... }:
{

View File

@@ -45,13 +45,15 @@ inventory = {
# Add the default role to all machines, including `client`
roles.default.tags.all = { };
# DNS server
# DNS server queries to http://<name>.foo are resolved here
roles.server.machines."dnsserver".settings = {
ip = "192.168.1.2";
tld = "foo";
};
# First service
# Registers http://one.foo will resolve to 192.168.1.3
# underlying service runs on server01
roles.default.machines."server01".settings = {
ip = "192.168.1.3";
services = [ "one" ];

View File

@@ -8,7 +8,7 @@
manifest.readme = builtins.readFile ./README.md;
roles.server = {
description = "A DNS server that resolves services in the clan network.";
interface =
{ lib, ... }:
{
@@ -103,6 +103,7 @@
};
roles.default = {
description = "A machine that registers the 'server' role as resolver and registers services under the configured TLD in the resolver.";
interface =
{ lib, ... }:
{

View File

@@ -50,13 +50,13 @@
dns =
{ pkgs, ... }:
{
environment.systemPackages = [ pkgs.net-tools ];
environment.systemPackages = [ pkgs.nettools ];
};
client =
{ pkgs, ... }:
{
environment.systemPackages = [ pkgs.net-tools ];
environment.systemPackages = [ pkgs.nettools ];
};
server01 = {

View File

@@ -101,6 +101,7 @@ in
manifest.readme = builtins.readFile ./README.md;
roles.admin = {
description = "A data-mesher admin node that bootstraps the network and can sign new nodes into the network.";
interface =
{ lib, ... }:
{
@@ -177,6 +178,7 @@ in
};
roles.signer = {
description = "A data-mesher signer node that can sign new nodes into the network.";
interface = sharedInterface;
perInstance =
{
@@ -208,6 +210,7 @@ in
};
roles.peer = {
description = "A data-mesher peer node that connects to the network.";
interface = sharedInterface;
perInstance =
{

View File

@@ -2,11 +2,12 @@
{
_class = "clan.service";
manifest.name = "clan-core/dyndns";
manifest.description = "A dynamic DNS service to update domain IPs";
manifest.description = "A dynamic DNS service to auto update domain IPs";
manifest.categories = [ "Network" ];
manifest.readme = builtins.readFile ./README.md;
roles.default = {
description = "Placeholder role to apply the dyndns service";
interface =
{ lib, ... }:
{

View File

@@ -2,31 +2,34 @@
{
_class = "clan.service";
manifest.name = "clan-core/emergency-access";
manifest.description = "Set recovery password for emergency access to machine";
manifest.description = "Set recovery password for emergency access to machine to debug boot issues";
manifest.categories = [ "System" ];
manifest.readme = builtins.readFile ./README.md;
roles.default.perInstance = {
nixosModule =
{ config, pkgs, ... }:
{
boot.initrd.systemd.emergencyAccess =
config.clan.core.vars.generators.emergency-access.files.password-hash.value;
roles.default = {
description = "Placeholder role to apply the emergency-access service";
perInstance = {
nixosModule =
{ config, pkgs, ... }:
{
boot.initrd.systemd.emergencyAccess =
config.clan.core.vars.generators.emergency-access.files.password-hash.value;
clan.core.vars.generators.emergency-access = {
runtimeInputs = [
pkgs.coreutils
pkgs.mkpasswd
pkgs.xkcdpass
];
files.password.deploy = false;
files.password-hash.secret = false;
clan.core.vars.generators.emergency-access = {
runtimeInputs = [
pkgs.coreutils
pkgs.mkpasswd
pkgs.xkcdpass
];
files.password.deploy = false;
files.password-hash.secret = false;
script = ''
xkcdpass --numwords 4 --delimiter - --count 1 | tr -d "\n" > $out/password
mkpasswd -s -m sha-512 < $out/password | tr -d "\n" > $out/password-hash
'';
script = ''
xkcdpass --numwords 4 --delimiter - --count 1 | tr -d "\n" > $out/password
mkpasswd -s -m sha-512 < $out/password | tr -d "\n" > $out/password-hash
'';
};
};
};
};
};
}

View File

@@ -6,7 +6,7 @@
manifest.categories = [ "System" ];
roles.default = {
description = "Placeholder role to apply the garage service";
perInstance.nixosModule =
{
config,

View File

@@ -14,6 +14,7 @@
# defined in this file directly (e.g. the "morning" role) or split up into a
# separate file (e.g. the "evening" role)
roles.morning = {
description = "A morning greeting machine";
interface =
{ lib, ... }:
{
@@ -67,6 +68,7 @@
# the interface here, so we can see all settings of the service in one place,
# but you can also move it to the respective file
roles.evening = {
description = "An evening greeting machine";
interface =
{ lib, ... }:
{

View File

@@ -6,5 +6,7 @@
manifest.categories = [ "Utility" ];
manifest.readme = builtins.readFile ./README.md;
roles.default = { };
roles.default = {
description = "Placeholder role to apply the importer service";
};
}

View File

@@ -2,12 +2,13 @@
{
_class = "clan.service";
manifest.name = "clan-core/internet";
manifest.description = "direct access (or via ssh jumphost) to machines";
manifest.description = "Part of the clan networking abstraction to define how to reach machines from outside the clan network over the internet, if defined has the highest priority";
manifest.categories = [
"System"
"Network"
];
roles.default = {
description = "Placeholder role to apply the internet service";
interface =
{ lib, ... }:
{

View File

@@ -2,11 +2,12 @@
{
_class = "clan.service";
manifest.name = "localbackup";
manifest.description = "Automatically backups current machine to local directory.";
manifest.description = "Automatically backups current machine to local directory or a mounted drive.";
manifest.categories = [ "System" ];
manifest.readme = builtins.readFile ./README.md;
roles.default = {
description = "Placeholder role to apply the localbackup service";
interface =
{ lib, ... }:
{

View File

@@ -6,6 +6,7 @@
manifest.categories = [ "Social" ];
roles.default = {
description = "Placeholder role to apply the matrix-synapse service";
interface =
{ lib, ... }:
{

View File

@@ -6,6 +6,7 @@
manifest.readme = builtins.readFile ./README.md;
roles.telegraf = {
description = "Placeholder role to apply the telegraf monitoring agent";
interface =
{ lib, ... }:
{

View File

@@ -2,13 +2,14 @@
{
_class = "clan.service";
manifest.name = "clan-core/mycelium";
manifest.description = "End-2-end encrypted IPv6 overlay network";
manifest.description = "End-2-end encrypted P2P IPv6 overlay network";
manifest.categories = [
"System"
"Network"
];
roles.peer = {
description = "A peer in the mycelium network";
interface =
{ lib, ... }:
{

View File

@@ -8,6 +8,7 @@
];
roles.default = {
description = "Placeholder role to apply the packages service";
interface =
{ lib, ... }:
{

View File

@@ -1,11 +1,15 @@
The `sshd` Clan service manages SSH to make it easy to securely access your machines over the internet. The service uses `vars` to store the SSH host keys for each machine to ensure they remain stable across deployments.
The `sshd` Clan service manages SSH to make it easy to securely access your
machines over the internet. The service uses `vars` to store the SSH host keys
for each machine to ensure they remain stable across deployments.
`sshd` also generates SSH certificates for both servers and clients allowing for certificate-based authentication for SSH.
`sshd` also generates SSH certificates for both servers and clients allowing for
certificate-based authentication for SSH.
The service also disables password-based authentication over SSH, to access your machines you'll need to use public key authentication or certificate-based authentication.
The service also disables password-based authentication over SSH, to access your
machines you'll need to use public key authentication or certificate-based
authentication.
## Usage
```nix
{
inventory.instances = {
@@ -18,7 +22,6 @@ The service also disables password-based authentication over SSH, to access your
roles.server.tags.all = { };
roles.client.tags.all = { };
};
# Also generate RSA host keys for all servers
sshd-with-rsa = {
module = {

View File

@@ -10,6 +10,7 @@
manifest.readme = builtins.readFile ./README.md;
roles.client = {
description = "Installs the SSH CA public key into known_hosts for the configured domains, so this machine can verify servers host certificates without TOFU prompts.";
interface =
{ lib, ... }:
{
@@ -38,7 +39,6 @@
...
}:
{
clan.core.vars.generators.openssh-ca = lib.mkIf (settings.certificate.searchDomains != [ ]) {
share = true;
files.id_ed25519.deploy = false;
@@ -64,11 +64,12 @@
};
roles.server = {
description = "Runs sshd with persistent host keys and (if certificate.searchDomains is set) a CAsigned host certificate for <machine>.<domain>, enabling TOFUless verification by clients that trust the CA.";
interface =
{ lib, ... }:
{
options = {
hostKeys.rsa.enable = lib.mkEnableOption "Generate RSA host key";
hostKeys.rsa.enable = lib.mkEnableOption "generating a RSA host key";
certificate = {
searchDomains = lib.mkOption {
@@ -96,9 +97,7 @@
...
}:
{
clan.core.vars.generators = {
openssh-ca = lib.mkIf (settings.certificate.searchDomains != [ ]) {
share = true;
files.id_ed25519.deploy = false;

View File

@@ -13,7 +13,7 @@
}
```
Now the folder `~/syncthing/documents` will be shared with all your machines.
Now the folder `~/syncthing/documents` will be shared and kept in sync with all your machines.
## Documentation

View File

@@ -11,6 +11,7 @@
manifest.readme = builtins.readFile ./README.md;
roles.peer = {
description = "A peer in the syncthing cluster that syncs files with other peers.";
interface =
{ lib, ... }:
{

View File

@@ -11,9 +11,7 @@
pkgs.syncthing
];
script = ''
export TMPDIR=/tmp
TEMPORARY=$(mktemp -d)
syncthing generate --config "$out" --data "$TEMPORARY"
syncthing generate --config "$out"
mv "$out"/key.pem "$out"/key
mv "$out"/cert.pem "$out"/cert
cat "$out"/config.xml | grep -oP '(?<=<device id=")[^"]+' | uniq > "$out"/id

View File

@@ -2,13 +2,17 @@
{
_class = "clan.service";
manifest.name = "clan-core/tor";
manifest.description = "Onion routing, use Hidden services to connect your machines";
manifest.description = "Part of the clan networking abstraction to define how to reach machines through the Tor network, if used has the lowest priority";
manifest.categories = [
"System"
"Network"
];
roles.client = {
description = ''
Enables a continuosly running Tor proxy on the machine, allowing access to other machines via the Tor network.
If not enabled, a Tor proxy will be started automatically when required.
'';
perInstance =
{
...
@@ -31,6 +35,7 @@
};
roles.server = {
description = "Sets up a Tor onion service for the machine, thus making it reachable over Tor.";
# interface =
# { lib, ... }:
# {

View File

@@ -7,7 +7,7 @@
manifest.readme = builtins.readFile ./README.md;
roles.default = {
description = "Placeholder role to apply the trusted-nix-caches service";
perInstance =
{ ... }:
{

View File

@@ -10,6 +10,7 @@
manifest.readme = builtins.readFile ./README.md;
roles.default = {
description = "Placeholder role to apply the user service";
interface =
{ lib, ... }:
{

View File

@@ -0,0 +1,21 @@
This module allows you to pre-configure WiFi networks for automatic connection.
Each attribute in `settings.network` serves as an internal identifier, not the actual SSID.
After defining your networks, you will be prompted for the SSID and password for each one.
This module leverages NetworkManager for managing connections.
```nix
instances = {
wifi = {
module.name = "wifi";
module.input = "clan-core";
roles.default = {
machines."jon" = {
settings.networks.home = { };
settings.networks.work = { keyMgmt = "wpa-eap"; };
};
};
};
};
```

View File

@@ -9,8 +9,11 @@ in
{
_class = "clan.service";
manifest.name = "wifi";
manifest.description = "Pre configure wifi networks to connect to";
manifest.readme = builtins.readFile ./README.md;
roles.default = {
description = "Placeholder role to apply the wifi service";
interface = {
options.networks = lib.mkOption {
type = lib.types.attrsOf (
@@ -42,7 +45,18 @@ in
)
);
default = { };
description = "Wifi networks to predefine";
example = {
home = { };
guest = {
autoConnect = false;
keyMgmt = "wpa-eap";
};
};
description = ''
List of wifi networks to configure for connection.
Each attribute name is an internal identifier (not the SSID).
For each network, you will be prompted to enter the SSID and password as secrets.
'';
};
};

View File

@@ -146,6 +146,7 @@ in
# Peer options and configuration
roles.peer = {
description = "A peer that connects to one or more controllers.";
interface =
{ lib, ... }:
{
@@ -261,6 +262,7 @@ in
# Controller options and configuration
roles.controller = {
description = "A controller that routes peer traffic. Must be publicly reachable.";
interface =
{ lib, ... }:
{

View File

@@ -5,6 +5,7 @@
manifest.description = "Yggdrasil encrypted IPv6 routing overlay network";
roles.default = {
description = "Placeholder role to apply the yggdrasil service";
interface =
{ lib, ... }:
{
@@ -88,7 +89,7 @@
enable = true;
openMulticastPort = true;
# We don't need this option, because we persist our keys with
# vars by ourselfs. This option creates an unnessesary additional
# vars by ourselves. This option creates an unnecesary additional
# systemd service to save/load the keys and should be removed
# from the NixOS module entirely, as it can be replaced by the
# (at the time of writing undocumented) PrivateKeyPath= setting.

View File

@@ -2,11 +2,12 @@
{
_class = "clan.service";
manifest.name = "clan-core/zerotier";
manifest.description = "Configuration of the secure and efficient Zerotier VPN";
manifest.description = "Zerotier Mesh VPN Service for secure P2P networking between machines";
manifest.categories = [ "Utility" ];
manifest.readme = builtins.readFile ./README.md;
roles.peer = {
description = "A peer that connects to your private Zerotier network.";
perInstance =
{
instanceName,
@@ -51,6 +52,7 @@
};
roles.moon = {
description = "A moon acts as a relay node to connect other nodes in the zerotier network that are not publicly reachable. Each moon must be publicly reachable.";
interface =
{ lib, ... }:
{
@@ -101,6 +103,7 @@
};
roles.controller = {
description = "Manages network membership and is responsible for admitting new peers to your Zerotier network.";
interface =
{ lib, ... }:
{

73
devFlake/flake.lock generated
View File

@@ -3,21 +3,42 @@
"clan-core-for-checks": {
"flake": false,
"locked": {
"lastModified": 1756166884,
"narHash": "sha256-skg4rwpbCjhpLlrv/Pndd43FoEgrJz98WARtGLhCSzo=",
"ref": "main",
"rev": "f7414d7e6e58709af27b6fe16eb530278e81eaaf",
"lastModified": 1760368011,
"narHash": "sha256-mLK2nwbfklfOGIVAKVNDwGyYz8mPh4fzsAqSK3BlCiI=",
"ref": "clan-25.05",
"rev": "1b3c129aa9741d99b27810652ca888b3fbfc3a11",
"shallow": true,
"type": "git",
"url": "https://git.clan.lol/clan/clan-core"
},
"original": {
"ref": "main",
"ref": "clan-25.05",
"shallow": true,
"type": "git",
"url": "https://git.clan.lol/clan/clan-core"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"test-fixtures",
"nixpkgs"
]
},
"locked": {
"lastModified": 1741352980,
"narHash": "sha256-+u2UunDA4Cl5Fci3m7S643HzKmIDAe+fiXrLqYsR2fs=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "f4330d22f1c5d2ba72d3d22df5597d123fdb60a9",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": [
@@ -84,16 +105,16 @@
},
"nixpkgs-dev": {
"locked": {
"lastModified": 1758573205,
"narHash": "sha256-0ybDco+HjG5h46wx7ww4JIyg3y/mBDgkMCVX/Ua0e/Q=",
"lastModified": 1760309387,
"narHash": "sha256-e0lvQ7+B1Y8zjykYHAj9tBv10ggLqK0nmxwvMU3J0Eo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "803b1683f562edc00665874bf98c1aad0b111482",
"rev": "6cd95994a9c8f7c6f8c1f1161be94119afdcb305",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable-small",
"ref": "nixos-25.05-small",
"repo": "nixpkgs",
"type": "github"
}
@@ -107,11 +128,11 @@
]
},
"locked": {
"lastModified": 1758272005,
"narHash": "sha256-1u3xTH+3kaHhztPmWtLAD8LF5pTYLR2CpsPFWTFnVtQ=",
"lastModified": 1758662783,
"narHash": "sha256-igrxT+/MnmcftPOHEb+XDwAMq3Xg1Xy7kVYQaHhPlAg=",
"owner": "NuschtOS",
"repo": "search",
"rev": "aa975a3757f28ce862812466c5848787b868e116",
"rev": "7d4c0fc4ffe3bd64e5630417162e9e04e64b27a4",
"type": "github"
},
"original": {
@@ -127,6 +148,7 @@
"nixpkgs-dev": "nixpkgs-dev",
"nuschtos": "nuschtos",
"systems": "systems_2",
"test-fixtures": "test-fixtures",
"treefmt-nix": "treefmt-nix"
}
},
@@ -160,16 +182,37 @@
"type": "github"
}
},
"test-fixtures": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": [
"nixpkgs-dev"
]
},
"locked": {
"lastModified": 1742806412,
"narHash": "sha256-ZoAN0/sHEHY+ymJnkdkBAuZ/6sc66RYR4xMHpLf7++E=",
"ref": "refs/heads/main",
"rev": "4a2bc56d886578124b05060d3fb7eddc38c019f8",
"revCount": 2,
"type": "git",
"url": "https://git.clan.lol/clan/test-fixtures"
},
"original": {
"type": "git",
"url": "https://git.clan.lol/clan/test-fixtures"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": []
},
"locked": {
"lastModified": 1758206697,
"narHash": "sha256-/DbPkh6PZOgfueCbs3uzlk4ASU2nPPsiVWhpMCNkAd0=",
"lastModified": 1760120816,
"narHash": "sha256-gq9rdocpmRZCwLS5vsHozwB6b5nrOBDNc2kkEaTXHfg=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "128222dc911b8e2e18939537bed1762b7f3a04aa",
"rev": "761ae7aff00907b607125b2f57338b74177697ed",
"type": "github"
},
"original": {

View File

@@ -2,7 +2,7 @@
description = "private dev inputs";
# Dev dependencies
inputs.nixpkgs-dev.url = "github:NixOS/nixpkgs/nixos-unstable-small";
inputs.nixpkgs-dev.url = "github:NixOS/nixpkgs/nixos-25.05-small";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.flake-utils.inputs.systems.follows = "systems";
@@ -15,8 +15,11 @@
inputs.systems.url = "github:nix-systems/default";
inputs.clan-core-for-checks.url = "git+https://git.clan.lol/clan/clan-core?ref=main&shallow=1";
inputs.clan-core-for-checks.url = "git+https://git.clan.lol/clan/clan-core?ref=clan-25.05&shallow=1";
inputs.clan-core-for-checks.flake = false;
inputs.test-fixtures.url = "git+https://git.clan.lol/clan/test-fixtures";
inputs.test-fixtures.inputs.nixpkgs.follows = "nixpkgs-dev";
outputs = inputs: inputs;
}

3
docs/.gitignore vendored
View File

@@ -1,5 +1,6 @@
/site/reference
/site/services/official
/site/static
/site/options
/site/option-search
/site/openapi.json
!/site/static/extra.css

View File

@@ -1,6 +1,5 @@
# Contributing to Clan
**Continuous Integration (CI)**: Each pull request gets automatically tested by gitea. If any errors are detected, it will block pull requests until they're resolved.
**Dependency Management**: We use the [Nix package manager](https://nixos.org/) to manage dependencies and ensure reproducibility, making your development process more robust.
@@ -10,25 +9,27 @@
- Linux
- macOS
# Getting Started with the Development Environment
## Getting Started with the Development Environment
Let's get your development environment up and running:
1. **Install Nix Package Manager**:
- You can install the Nix package manager by either [downloading the Nix installer](https://github.com/DeterminateSystems/nix-installer/releases) or running this command:
```bash
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
```
1. **Install direnv**:
```bash
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
```
2. **Install direnv**:
- To automatically setup a devshell on entering the directory
```bash
nix profile install nixpkgs#nix-direnv-flakes nixpkgs#direnv
```
1. **Add direnv to your shell**:
```bash
nix profile install nixpkgs#nix-direnv-flakes nixpkgs#direnv
```
3. **Add direnv to your shell**:
- Direnv needs to [hook into your shell](https://direnv.net/docs/hook.html) to work.
You can do this by executing following command. The example below will setup direnv for `zsh` and `bash`
@@ -37,34 +38,43 @@ Let's get your development environment up and running:
echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc && echo 'eval "$(direnv hook bash)"' >> ~/.bashrc && eval "$SHELL"
```
1. **Allow the devshell**
4. **Allow the devshell**
- Go to `clan-core/pkgs/clan-cli` and do a `direnv allow` to setup the necessary development environment to execute the `clan` command
1. **Create a Gitea Account**:
5. **Create a Gitea Account**
- Register an account on https://git.clan.lol
- Fork the [clan-core](https://git.clan.lol/clan/clan-core) repository
- Clone the repository and navigate to it
- Add a new remote called upstream:
```bash
git remote add upstream gitea@git.clan.lol:clan/clan-core.git
```
1. **Allow .envrc**:
- Add a new remote called upstream
```bash
git remote add upstream gitea@git.clan.lol:clan/clan-core.git
```
7. **Allow .envrc**
- When you enter the directory, you'll receive an error message like this:
```bash
direnv: error .envrc is blocked. Run `direnv allow` to approve its content
```
```bash
direnv: error .envrc is blocked. Run `direnv allow` to approve its content
```
- Execute `direnv allow` to automatically execute the shell script `.envrc` when entering the directory.
1. **(Optional) Install Git Hooks**:
8. **(Optional) Install Git Hooks**
- To syntax check your code you can run:
```bash
nix fmt
```
```bash
nix fmt
```
- To make this automatic install the git hooks
```bash
./scripts/pre-commit
```
```bash
./scripts/pre-commit
```
## Related Projects
@@ -73,7 +83,7 @@ Let's get your development environment up and running:
- **Nixos Anywhere**: [nixos-anywhere](https://github.com/nix-community/nixos-anywhere)
- **Disko**: [disko](https://github.com/nix-community/disko)
## Fixing Bugs or Adding Features in Clan-CLI
### Override related projects for local development
If you have a bug fix or feature that involves a related project, clone the relevant repository and replace its invocation in your local setup.
@@ -102,10 +112,10 @@ run(
```
The <path_to_local_src> doesn't need to be a local path, it can be any valid [flakeref](https://nix.dev/manual/nix/2.26/command-ref/new-cli/nix3-flake.html#flake-references).
The `<path_to_local_src>` doesn't need to be a local path, it can be any valid [flakeref](https://nix.dev/manual/nix/2.26/command-ref/new-cli/nix3-flake.html#flake-references).
And thus can point to test already opened PRs for example.
# Standards
## Standards
- Every new module name should be in kebab-case.
- Every fact definition, where possible should be in kebab-case.

View File

@@ -1,5 +1,5 @@
# Serve documentation locally
```
$ nix develop .#docs -c mkdocs serve
nix develop .#docs -c mkdocs serve
```

View File

@@ -1,41 +0,0 @@
from typing import Any
def define_env(env: Any) -> None:
static_dir = "/static/"
video_dir = "https://clan.lol/" + "videos/"
asciinema_dir = static_dir + "asciinema-player/"
@env.macro
def video(name: str) -> str:
return f"""<video loop muted autoplay id="{name}">
<source src={video_dir + name} type="video/webm">
Your browser does not support the video tag.
</video>"""
@env.macro
def asciinema(name: str) -> str:
return f"""<div id="{name}">
<script>
// Function to load the script and then create the Asciinema player
function loadAsciinemaPlayer() {{
var script = document.createElement('script');
script.src = "{asciinema_dir}/asciinema-player.min.js";
script.onload = function() {{
AsciinemaPlayer.create('{video_dir + name}', document.getElementById("{name}"), {{
loop: true,
autoPlay: true,
controls: false,
speed: 1.5,
theme: "solarized-light"
}});
}};
document.head.appendChild(script);
}}
// Load the Asciinema player script
loadAsciinemaPlayer();
</script>
<link rel="stylesheet" type="text/css" href="{asciinema_dir}/asciinema-player.css" />
</div>"""

View File

@@ -47,26 +47,26 @@ exclude_docs: |
nav:
- Getting Started:
- Overview: index.md
- Creating Your First Clan: guides/getting-started/index.md
- Add Machines: guides/getting-started/add-machines.md
- Add User: guides/getting-started/add-user.md
- Add Services: guides/getting-started/add-services.md
- getting-started/creating-your-first-clan.md
- getting-started/add-machines.md
- getting-started/add-users.md
- getting-started/add-services.md
- Deploy to Physical Machine:
- Create USB Installer: guides/getting-started/create-installer.md
- Deploy Physical Machine: guides/getting-started/hardware-report-physical.md
- Deploy to Virtual Machine: guides/getting-started/hardware-report-virtual.md
- Configure Disk Config: guides/getting-started/choose-disk.md
- Update Machine: guides/getting-started/update.md
- Continuous Integration: guides/getting-started/flake-check.md
- Convert Existing NixOS Config: guides/getting-started/convert-flake.md
- getting-started/deploy-to-physical-machine/flash-installer.md
- getting-started/deploy-to-physical-machine/install-machine.md
- getting-started/deploy-to-virtual-machine.md
- getting-started/configure-disk.md
- getting-started/update-machines.md
- getting-started/continuous-integration.md
- Convert existing NixOS configurations: getting-started/convert-existing-NixOS-configuration.md
- Guides:
- Inventory:
- Introduction to Inventory: guides/inventory/inventory.md
- File Autoincludes: guides/inventory/autoincludes.md
- Clan Services:
- Inventory Guide: guides/inventory/clanServices.md
- Services:
- Introduction to Services: guides/services/introduction-to-services.md
- Author Your Own Service: guides/services/community.md
- Internal Services with SSL: guides/internal-ssl-services.md
- Vars:
- Introduction to Vars: guides/vars/vars-overview.md
- Minimal Example: guides/vars/vars-backend.md
@@ -76,37 +76,40 @@ nav:
- Sops Backend:
- Yubikeys & Age Plugins: guides/vars/sops/age-plugins.md
- Managing Users (OLD): guides/secrets.md
- Backups:
- Introduction to Backups: guides/backups/backup-intro.md
- Minimal Example: guides/backups/minimal-example.md
- Digging Deeper: guides/backups/digging-deeper.md
- Advanced Example: guides/backups/advanced-example.md
- Networking:
- Introduction to Networking: guides/networking/networking.md
- Zerotier VPN: guides/networking/mesh-vpn.md
- Disko Templates:
- Community Disko Templates: guides/disko-templates/community.md
- Backups:
- Introduction to Backups: guides/backups.md
- Nixpkgs Flake Input: guides/nixpkgs-flake-input/index.md
- Flake-parts: guides/flake-parts.md
- NixOS Rebuild: guides/nixos-rebuild.md
- macOS:
- Managing macOS Machines: guides/macos.md
- macOS: guides/macos.md
# Should be part of the respective sections above
# machines, disko, clan
- Templates: concepts/templates.md
- Templates:
- Introduction to Templates: concepts/templates.md
- Community Disko Templates: guides/disko-templates/community.md
- Migrations:
- clan modules --> clan services: guides/migrations/migrate-inventory-services.md
- Facts --> Vars: guides/migrations/migration-facts-vars.md
- clan modules to clan services: guides/migrations/migrate-inventory-services.md
- Facts to Vars: guides/migrations/migration-facts-vars.md
- Disk id: guides/migrations/disk-id.md
- Disk Encryption: guides/disk-encryption.md
- Disable Secure Boot: guides/secure-boot.md
- Contributing:
- Hacking: guides/contributing/CONTRIBUTING.md
- Advanced Debugging: guides/contributing/debugging.md
- Testing: guides/contributing/testing.md
- guides/contributing/CONTRIBUTING.md
- guides/contributing/debugging.md
- guides/contributing/testing.md
- Reference:
- Overview: reference/index.md
- Clan Options: reference/options/clan.md
- Clan Inventory Options: reference/options/clan_inventory.md
- Clan Service API: reference/clanServices/clan-service-author-interface.md
- Options:
- reference/options/clan.md
- reference/options/clan_inventory.md
- reference/options/clan_service.md
- clan.core (Machine Options):
- Overview: reference/clan.core/index.md
@@ -140,43 +143,44 @@ nav:
- HTTP API: api.md
- Decisions:
- Architecture Decisions: decisions/README.md
- 01-clanModules: decisions/01-ClanModules.md
- 02-clan-api: decisions/02-clan-api.md
- 03-adr-numbering-process: decisions/03-adr-numbering-process.md
- 04-fetching-nix-from-python: decisions/04-fetching-nix-from-python.md
- 05-deployment-parameters: decisions/05-deployment-parameters.md
- Template: decisions/_template.md
- decisions/Architecture-decisions.md
- decisions/01-Clan-Modules.md
- decisions/02-clan-as-library.md
- decisions/03-adr-numbering-process.md
- decisions/04-fetching-nix-from-python.md
- decisions/05-deployment-parameters.md
- decisions/template.md
- Glossary: reference/glossary.md
- Services:
- Introduction to ClanServices: reference/clanServices/index.md
- services/definition.md
# Generated list from the list of official services
- Official:
- reference/clanServices/admin.md
- reference/clanServices/borgbackup.md
- reference/clanServices/certificates.md
- reference/clanServices/coredns.md
- reference/clanServices/data-mesher.md
- reference/clanServices/dyndns.md
- reference/clanServices/emergency-access.md
- reference/clanServices/garage.md
- reference/clanServices/hello-world.md
- reference/clanServices/importer.md
- reference/clanServices/localbackup.md
- reference/clanServices/matrix-synapse.md
- reference/clanServices/mycelium.md
- reference/clanServices/monitoring.md
- reference/clanServices/packages.md
- reference/clanServices/sshd.md
- reference/clanServices/syncthing.md
- reference/clanServices/trusted-nix-caches.md
- reference/clanServices/users.md
- reference/clanServices/wifi.md
- reference/clanServices/wireguard.md
- reference/clanServices/yggdrasil.md
- reference/clanServices/zerotier.md
- Community: community/services/index.md
- services/official/admin.md
- services/official/borgbackup.md
- services/official/certificates.md
- services/official/coredns.md
- services/official/data-mesher.md
- services/official/dyndns.md
- services/official/emergency-access.md
- services/official/garage.md
- services/official/hello-world.md
- services/official/importer.md
- services/official/localbackup.md
- services/official/matrix-synapse.md
- services/official/mycelium.md
- services/official/monitoring.md
- services/official/packages.md
- services/official/sshd.md
- services/official/syncthing.md
- services/official/trusted-nix-caches.md
- services/official/users.md
- services/official/wifi.md
- services/official/wireguard.md
- services/official/yggdrasil.md
- services/official/zerotier.md
- services/community.md
- Search Clan Options: "/options"
- Search Clan Options: "/option-search"
docs_dir: site
site_dir: out
@@ -230,7 +234,7 @@ extra:
- icon: fontawesome/brands/github
link: https://github.com/clan-lol/clan-core
- icon: fontawesome/solid/rss
link: /feed_rss_created.xml
link: https://clan.lol/feed.xml
plugins:
- search

View File

@@ -3,11 +3,9 @@
module-docs,
clan-cli-docs,
clan-lib-openapi,
asciinema-player-js,
asciinema-player-css,
roboto,
fira-code,
docs-options,
option-search,
...
}:
let
@@ -44,22 +42,18 @@ pkgs.stdenv.mkDerivation {
pushd docs
mkdir -p ./site/reference/cli
cp -af ${module-docs}/* ./site/reference/
cp -af ${module-docs}/services/* ./site/services/
cp -af ${module-docs}/reference/* ./site/reference/
cp -af ${clan-cli-docs}/* ./site/reference/cli/
mkdir -p ./site/reference/internal
cp -af ${clan-lib-openapi} ./site/openapi.json
chmod -R +w ./site/reference
chmod -R +w ./site
echo "Generated API documentation in './site/reference/' "
rm -rf ./site/options
cp -r ${docs-options} ./site/options
chmod -R +w ./site/options
mkdir -p ./site/static/asciinema-player
ln -snf ${asciinema-player-js} ./site/static/asciinema-player/asciinema-player.min.js
ln -snf ${asciinema-player-css} ./site/static/asciinema-player/asciinema-player.css
rm -rf ./site/option-search
cp -r ${option-search} ./site/option-search
chmod -R +w ./site/option-search
# Link to fonts
ln -snf ${roboto}/share/fonts/truetype/Roboto-Regular.ttf ./site/static/

View File

@@ -1,8 +1,5 @@
{ inputs, self, ... }:
{ inputs, ... }:
{
imports = [
./options/flake-module.nix
];
perSystem =
{
config,
@@ -10,86 +7,14 @@
pkgs,
...
}:
let
# Simply evaluated options (JSON)
# { clanCore = «derivation JSON»; clanModules = { ${name} = «derivation JSON» }; }
jsonDocs = pkgs.callPackage ./get-module-docs.nix {
inherit (self) clanModules;
clan-core = self;
inherit pkgs;
};
# clan service options
clanModulesViaService = pkgs.writeText "info.json" (builtins.toJSON jsonDocs.clanModulesViaService);
# Simply evaluated options (JSON)
renderOptions =
pkgs.runCommand "render-options"
{
# TODO: ruff does not splice properly in nativeBuildInputs
depsBuildBuild = [ pkgs.ruff ];
nativeBuildInputs = [
pkgs.python3
pkgs.mypy
self'.packages.clan-cli
];
}
''
install -D -m755 ${./render_options}/__init__.py $out/bin/render-options
patchShebangs --build $out/bin/render-options
ruff format --check --diff $out/bin/render-options
ruff check --line-length 88 $out/bin/render-options
mypy --strict $out/bin/render-options
'';
asciinema-player-js = pkgs.fetchurl {
url = "https://github.com/asciinema/asciinema-player/releases/download/v3.7.0/asciinema-player.min.js";
sha256 = "sha256-Ymco/+FinDr5YOrV72ehclpp4amrczjo5EU3jfr/zxs=";
};
asciinema-player-css = pkgs.fetchurl {
url = "https://github.com/asciinema/asciinema-player/releases/download/v3.7.0/asciinema-player.css";
sha256 = "sha256-GZMeZFFGvP5GMqqh516mjJKfQaiJ6bL38bSYOXkaohc=";
};
module-docs =
pkgs.runCommand "rendered"
{
buildInputs = [
pkgs.python3
self'.packages.clan-cli
];
}
''
export CLAN_CORE_PATH=${
inputs.nixpkgs.lib.fileset.toSource {
root = ../..;
fileset = ../../clanModules;
}
}
export CLAN_CORE_DOCS=${jsonDocs.clanCore}/share/doc/nixos/options.json
# A file that contains the links to all clanModule docs
export CLAN_MODULES_VIA_SERVICE=${clanModulesViaService}
export CLAN_SERVICE_INTERFACE=${self'.legacyPackages.clan-service-module-interface}/share/doc/nixos/options.json
export CLAN_OPTIONS_PATH=${self'.legacyPackages.clan-options}/share/doc/nixos/options.json
mkdir $out
# The python script will place mkDocs files in the output directory
exec python3 ${renderOptions}/bin/render-options
'';
in
{
legacyPackages = {
inherit
jsonDocs
clanModulesViaService
;
};
devShells.docs = self'.packages.docs.overrideAttrs (_old: {
nativeBuildInputs =
self'.devShells.default.nativeBuildInputs ++ self'.packages.docs.nativeBuildInputs;
nativeBuildInputs = [
# Run: htmlproofer --disable-external
pkgs.html-proofer
]
++ self'.devShells.default.nativeBuildInputs
++ self'.packages.docs.nativeBuildInputs;
shellHook = ''
${self'.devShells.default.shellHook}
git_root=$(git rev-parse --show-toplevel)
@@ -101,17 +26,27 @@
docs = pkgs.python3.pkgs.callPackage ./default.nix {
inherit (self'.packages)
clan-cli-docs
docs-options
option-search
inventory-api-docs
clan-lib-openapi
module-docs
;
inherit (inputs) nixpkgs;
inherit module-docs;
inherit asciinema-player-js;
inherit asciinema-player-css;
};
deploy-docs = pkgs.callPackage ./deploy-docs.nix { inherit (config.packages) docs; };
inherit module-docs;
};
checks.docs-integrity =
pkgs.runCommand "docs-integrity"
{
nativeBuildInputs = [ pkgs.html-proofer ];
LANG = "C.UTF-8";
}
''
# External links should be avoided in the docs, because they often break
# and we cannot statically control them. Thus we disable checking them
htmlproofer --disable-external ${self'.packages.docs}
touch $out
'';
};
}

9
docs/release-notes.md Normal file
View File

@@ -0,0 +1,9 @@
# clan-core release notes 25.11
<!-- This is not rendered yet -->
## New features
## Breaking Changes
## Misc

View File

@@ -1,5 +1,3 @@
# Clan service modules
## Status
Accepted

View File

@@ -1,5 +1,3 @@
# Clan as library
## Status
Accepted

View File

@@ -1,5 +1,3 @@
# ADR Numbering process
## Status
Proposed after some conversation between @lassulus, @Mic92, & @lopter.

View File

@@ -1,5 +1,3 @@
# deployment parameters: evalHost, buildHost, targetHost
## Status
accepted

View File

@@ -1,5 +1,3 @@
# Architecture Decision Records
This section contains the architecture decisions that have been reviewed and generally agreed upon
## What is an ADR?
@@ -11,6 +9,6 @@ This section contains the architecture decisions that have been reviewed and gen
## Crafting a new ADR
1. Use the [template](./_template.md)
1. Use the [template](../decisions/template.md)
2. Create the Pull request and gather feedback
3. Retreive your adr-number (see: [numbering](./03-adr-numbering-process.md))
3. Retreive your adr-number (see: [numbering](../decisions/03-adr-numbering-process.md))

View File

@@ -1,6 +1,6 @@
# Decision record template by Michael Nygard
## Decision record template by Michael Nygard
This is the template in [Documenting architecture decisions - Michael Nygard](http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions).
This is the template in [Documenting architecture decisions - Michael Nygard](https://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions).
You can use [adr-tools](https://github.com/npryce/adr-tools) for managing the ADR files.
In each ADR file, write these sections:

View File

@@ -1,12 +1,10 @@
# How to add machines
Machines can be added using the following methods
- Create a file `machines/{machine_name}/configuration.nix` (See: [File Autoincludes](../inventory/autoincludes.md))
- Create a file `machines/{machine_name}/configuration.nix` (See: [File Autoincludes](../guides/inventory/autoincludes.md))
- Imperative via cli command: `clan machines create`
- Editing nix expressions in flake.nix See [`clan-core.lib.clan`](/options/?scope=Flake Options (clan.nix file))
- Editing nix expressions in flake.nix See [`clan-core.lib.clan`](../reference/options/clan.md)
See the complete [list](../inventory/autoincludes.md) of auto-loaded files.
See the complete [list](../guides/inventory/autoincludes.md) of auto-loaded files.
## Create a machine
@@ -20,8 +18,6 @@ See the complete [list](../inventory/autoincludes.md) of auto-loaded files.
};
# Additional NixOS configuration can be added here.
# machines/jon/configuration.nix will be automatically imported.
# See: https://docs.clan.lol/guides/more-machines/#automatic-registration
machines = {
# jon = { config, ... }: {
# environment.systemPackages = [ pkgs.asciinema ];

View File

@@ -1,5 +1,3 @@
# How to add services
A service in clan is a self-contained, reusable unit of system configuration that provides a specific piece of functionality across one or more machines.
Think of it as a recipe for running a tool — like automatic backups, VPN networking, monitoring, etc.
@@ -10,7 +8,7 @@ In Clan Services are multi-Host & role-based:
- You can use tags instead of explicit machine names.
To learn more: [Guide about clanService](../inventory/clanServices.md)
To learn more: [Guide about clanService](../guides/services/introduction-to-services.md)
!!! Important
It is recommended to add at least one networking service such as `zerotier` that allows to reach all your clan machines from your setup computer across the globe.
@@ -40,8 +38,8 @@ To learn more: [Guide about clanService](../inventory/clanServices.md)
}
```
1. See [reference/clanServices](../../reference/clanServices/index.md) for all available services and how to configure them.
Or read [authoring/clanServices](../services/community.md) if you want to bring your own
1. See [services/official](../services/definition.md) for all available services and how to configure them.
Or read [guides/services](../guides/services/community.md) if you want to bring your own
2. Replace `__YOUR_CONTROLLER_` with the *name* of your machine.
@@ -73,5 +71,5 @@ Adding the following services is recommended for most users:
```
1. The `admin` service will generate a **root-password** and **add your ssh-key** that allows for convienient administration.
2. Equivalent to directly setting `authorizedKeys` like in [configuring a machine](./add-machines.md#configuring-a-machine)
2. Equivalent to directly setting `authorizedKeys` like in [configuring a machine](../getting-started/add-machines.md#configuring-a-machine)
3. Adds `user = jon` as a user on all machines. Will create a `home` directory, and prompt for a password before deployment.

View File

@@ -1,19 +1,17 @@
# How to add users
!!! Note "Under construction"
The users concept of clan is not done yet. This guide outlines some solutions from our community.
Defining users can be done in many different ways. We want to highlight two approaches:
- Using clan's [users](../../reference/clanServices/users.md) service.
- Using clan's [users](../services/official/users.md) service.
- Using a custom approach.
## Adding Users using the [users](../../reference/clanServices/users.md) service
## Adding Users using the [users](../services/official/users.md) service
To add a first *user* this guide will be leveraging two things:
- [clanServices](../../reference/clanServices/index.md): Allows to bind arbitrary logic to something we call an `ìnstance`.
- [clanServices/users](../../reference/clanServices/users.md): Implements logic for adding a single user perInstance.
- [services](../services/definition.md): Allows to bind arbitrary logic to something we call an `ìnstance`.
- [services/users](../services/official/users.md): Implements logic for adding a single user perInstance.
The example shows how to add a user called `jon`:
@@ -51,7 +49,7 @@ The example shows how to add a user called `jon`:
The `users` service creates a `/home/jon` directory, allows `jon` to sign in and will take care of the user's password.
For more information see [clanService/users](../../reference/clanServices/users.md)
For more information see [services/users](../services/official/users.md)
## Using a custom approach

View File

@@ -1,5 +1,3 @@
# Configure Disk Config
By default clan uses [disko](https://github.com/nix-community/disko) which allows for declarative disk partitioning.
To see what disk templates are available run:
@@ -64,9 +62,9 @@ You can have a look and customize it if needed.
## Deploy the machine
**Finally deployment time!**
**Finally deployment time!**
This command is destructive and will format your disk and install NixOS on it! It is equivalent to appending `--phases kexec,disko,install,reboot`.
This command is destructive and will format your disk and install NixOS on it! It is equivalent to appending `--phases kexec,disko,install,reboot`.
```bash

View File

@@ -1,19 +1,17 @@
# Convert existing NixOS configurations
This guide will help you convert your existing NixOS configurations into a Clan.
!!! Warning
Migrating instead of starting new can be trickier and might lead to bugs or
unexpected issues. We recommend reading the [Getting Started](./index.md) guide first.
unexpected issues. We recommend reading the [Getting Started](../getting-started/creating-your-first-clan.md) guide first.
Once you have a working setup and understand the concepts transfering your NixOS configurations over is easy.
Once you have a working setup and understand the concepts transferring your NixOS configurations over is easy.
## Back up your existing configuration
Before you start, it is strongly recommended to back up your existing
configuration in any form you see fit. If you use version control to manage
your configuration changes, it is also a good idea to follow the migration
guide in a separte branch until everything works as expected.
guide in a separate branch until everything works as expected.
## Starting Point
@@ -171,7 +169,7 @@ Clan needs to know where it can reach your hosts. For testing purpose set
}
```
See our guide on for properly [configuring machines networking](../networking/networking.md)
See our guide on for properly [configuring machines networking](../guides/networking/networking.md)
## Next Steps

View File

@@ -1,6 +1,4 @@
# :material-clock-fast: Getting Started
Ready to manage your fleet of machines?
Ready to manage your fleet of machines?
We will create a declarative infrastructure using **clan**, **git**, and **nix flakes**.
@@ -43,7 +41,7 @@ Make sure you have the following:
## Create a New Clan
1. Navigate to your desired directory:
```shellSession
cd <your-directory>
```
@@ -76,7 +74,7 @@ my-clan/
```
!!! note "Templates"
This is the structure for the `default` template.
This is the structure for the `default` template.
Use `clan templates list` and `clan templates --help` for available templates & more. Keep in mind that the exact files may change as templates evolve.
@@ -121,7 +119,7 @@ Name: __CHANGE_ME__
Description: None
```
This confirms your setup is working correctly.
This confirms your setup is working correctly.
You can now change the default name by editing the `meta.name` field in your `clan.nix` file.

View File

@@ -1,9 +1,7 @@
# USB Installer Image for Physical Machines
To install Clan on physical machines, you need to use our custom installer image. This is necessary for proper installation and operation.
!!! note "Deploying to a Virtual Machine?"
If you're deploying to a virtual machine (VM), you can skip this section and go directly to the [Deploy Virtual Machine](./hardware-report-virtual.md) step. In this scenario, we automatically use [nixos-anywhere](https://github.com/nix-community/nixos-anywhere) to replace the kernel during runtime.
If you're deploying to a virtual machine (VM), you can skip this section and go directly to the [Deploy Virtual Machine](../../getting-started/deploy-to-virtual-machine.md) step. In this scenario, we automatically use [nixos-anywhere](https://github.com/nix-community/nixos-anywhere) to replace the kernel during runtime.
??? info "Why nixos-anywhere Doesn't Work on Physical Hardware?"
nixos-anywhere relies on [kexec](https://wiki.archlinux.org/title/Kexec) to replace the running kernel with our custom one. This method often has compatibility issues with real hardware, especially systems with dedicated graphics cards like laptops and servers, leading to crashes and black screens.
@@ -152,7 +150,7 @@ sudo umount /dev/sdb1
## Boot From USB Stick
- To use, boot from the Clan USB drive with **secure boot turned off**. For step by step instructions go to [Disabling Secure Boot](../secure-boot.md)
- To use, boot from the Clan USB drive with **secure boot turned off**. For step by step instructions go to [Disabling Secure Boot](../../guides/secure-boot.md)
## (Optional) Connect to Wifi Manually

View File

@@ -1,18 +1,16 @@
# Installing a Physical Machine
Now that you have created a machine, added some services, and set up secrets, this guide will walk you through how to deploy it.
### Prerequisites
- [x] RAM > 2GB
- [x] **Two Computers**: You need one computer that you're getting ready (we'll call this the Target Computer) and another one to set it up from (we'll call this the Setup Computer). Make sure both can talk to each other over the network using SSH.
- [x] **Machine configuration**: See our basic [adding and configuring machine guide](./add-machines.md)
- [x] **Initialized secrets**: See [secrets](../secrets.md) for how to initialize your secrets.
- [x] **USB Flash Drive**: See [Clan Installer](./create-installer.md)
- [x] **Machine configuration**: See our basic [adding and configuring machine guide](../../getting-started/add-machines.md)
- [x] **Initialized secrets**: See [secrets](../../guides/secrets.md) for how to initialize your secrets.
- [x] **USB Flash Drive**: See [Clan Installer](../../getting-started/deploy-to-physical-machine/flash-installer.md)
### Image Installer
This method makes use of the [image installers](./create-installer.md).
This method makes use of the [image installers](../../getting-started/deploy-to-physical-machine/flash-installer.md).
The installer will randomly generate a password and local addresses on boot, then run a SSH server with these preconfigured.
The installer shows its deployment relevant information in two formats, a text form, as well as a QR code.
@@ -68,7 +66,7 @@ This is an example of the booted installer.
```
2. The root password for the installer medium.
This password is autogenerated and meant to be easily typeable.
3. See how to connect the installer medium to wlan [here](./create-installer.md).
3. See how to connect the installer medium to wlan [here](../../getting-started/deploy-to-physical-machine/flash-installer.md).
!!!tip
For easy sharing of deployment information via QR code, we highly recommend using [KDE Connect](https://apps.kde.org/de/kdeconnect/).
@@ -113,4 +111,4 @@ The following command will generate a hardware report with [nixos-facter](https:
If you are using our template `[MACHINE]` would be `jon`
[Next Step (Choose Disk Format)](./choose-disk.md){ .md-button .md-button--primary }
[Next Step (Choose Disk Format)](../../getting-started/configure-disk.md){ .md-button .md-button--primary }

View File

@@ -1,12 +1,8 @@
# Generate a VM Hardware Report
Now that you have created a machine, added some services, and set up secrets, this guide will walk you through how to deploy it.
## Prerequisites
- [x] RAM > 2GB
- [x] **Two Computers**: You need one computer that you're getting ready (we'll call this the Target Computer) and another one to set it up from (we'll call this the Setup Computer). Make sure both can talk to each other over the network using SSH.
- [x] **Machine configuration**: See our basic [adding and configuring machine guide](./add-machines.md)
- [x] **Machine configuration**: See our basic [adding and configuring machine guide](../getting-started/add-machines.md)
Clan supports any cloud machine if it is reachable via SSH and supports `kexec`.

View File

@@ -1,4 +1,3 @@
# Update Machines
The Clan command line interface enables you to update machines remotely over SSH.
@@ -32,7 +31,7 @@ Ensure that the root login is secured and only used when necessary.
## Multiple Target Hosts
You can now experiment with a new interface that allows you to define multiple `targetHost` addresses for different VPNs. Learn more and try it out in our [networking guide](../networking/networking.md).
You can now experiment with a new interface that allows you to define multiple `targetHost` addresses for different VPNs. Learn more and try it out in our [networking guide](../guides/networking/networking.md).
## Updating Machine Configurations
@@ -79,7 +78,7 @@ clan {
`buildHost` / `targetHost`, and other network settings can be temporarily overridden for a single command:
For the full list of flags refer to the [Clan CLI](../../reference/cli/index.md)
For the full list of flags refer to the [Clan CLI](../reference/cli/index.md)
```bash
# Build on a remote host

View File

@@ -1,195 +0,0 @@
This guide explains how to set up and manage
[BorgBackup](https://borgbackup.readthedocs.io/) for secure, efficient backups
in a clan network. BorgBackup provides:
- Space efficient storage of backups with deduplication
- Secure, authenticated encryption
- Compression: lz4, zstd, zlib, lzma or none
- Mountable backups with FUSE
- Easy installation on multiple platforms: Linux, macOS, BSD, …
- Free software (BSD license).
- Backed by a large and active open-source community.
## Borgbackup Example
```nix
inventory.instances = {
borgbackup = {
module = {
name = "borgbackup";
input = "clan-core";
};
roles.client.machines."jon".settings = {
destinations."storagebox" = {
repo = "username@$hostname:/./borgbackup";
rsh = ''ssh -oPort=23 -i /run/secrets/vars/borgbackup/borgbackup.ssh'';
};
};
roles.server.machines = { };
};
};
```
The input should be named according to your flake input. Jon is configured as a
client machine with a destination pointing to a Hetzner Storage Box.
To see a list of all possible options go to [borgbackup clan service](../reference/clanServices/borgbackup.md)
## Roles
A Clan Service can have multiple roles, each role applies different nix config to the machine.
### 1. Client
Clients are machines that create and send backups to various destinations. Each
client can have multiple backup destinations configured.
### 2. Server
Servers act as backup repositories, receiving and storing backups from client
machines. They can be dedicated backup servers within your clan network.
## Backup destinations
This service allows you to perform backups to multiple `destinations`.
Destinations can be:
- **Local**: Local disk storage
- **Server**: Your own borgbackup server (using the `server` role)
- **Third-party services**: Such as Hetzner's Storage Box
## State management
Backups are based on [states](../reference/clan.core/state.md). A state
defines which files should be backed up and how these files are obtained through
pre/post backup and restore scripts.
Here's an example for a user application `linkding`:
In this example:
- `/data/podman/linkding` is the application's data directory
- `/var/backup/linkding` is the staging directory where data is copied for
backup
```nix
clan.core.state.linkding = {
folders = [ "/var/backup/linkding" ];
preBackupScript = ''
export PATH=${
lib.makeBinPath [
config.systemd.package
pkgs.coreutils
pkgs.rsync
]
}
service_status=$(systemctl is-active podman-linkding)
if [ "$service_status" = "active" ]; then
systemctl stop podman-linkding
rsync -avH --delete --numeric-ids "/data/podman/linkding/" /var/backup/linkding/
systemctl start podman-linkding
fi
'';
postRestoreScript = ''
export PATH=${
lib.makeBinPath [
config.systemd.package
pkgs.coreutils
pkgs.rsync
]
}
service_status="$(systemctl is-active podman-linkding)"
if [ "$service_status" = "active" ]; then
systemctl stop podman-linkding
# Backup locally current linkding data
cp -rp "/data/podman/linkding" "/data/podman/linkding.bak"
# Restore from borgbackup
rsync -avH --delete --numeric-ids /var/backup/linkding/ "/data/podman/linkding/"
systemctl start podman-linkding
fi
'';
};
```
## Managing backups
In this section we go over how to manage your collection of backups with the clan command.
### Listing states
To see which files (`states`) will be backed up on a specific machine, use:
```bash
clan state list jon
```
This will show all configured states for the machine `jon`, for example:
```text
· service: linkding
folders:
- /var/backup/linkding
preBackupCommand: pre-backup-linkding
postRestoreCommand: post-restore-linkding
· service: zerotier
folders:
- /var/lib/zerotier-one
```
### Creating backups
To create a backup of a machine (e.g., `jon`), run:
```bash
clan backups create jon
```
This will backup all configured states (`zerotier` and `linkding` in this
example) from the machine `jon`.
### Listing available backups
To see all available backups, use:
```bash
clan backups list
```
This will display all backups with their timestamps:
```text
storagebox::username@username.your-storagebox.de:/./borgbackup::jon-jon-2025-07-22T19:40:10
storagebox::username@username.your-storagebox.de:/./borgbackup::jon-jon-2025-07-23T01:00:00
storagebox::username@username.your-storagebox.de:/./borgbackup::jon-storagebox-2025-07-24T01:00:00
storagebox::username@username.your-storagebox.de:/./borgbackup::jon-storagebox-2025-07-24T06:02:35
```
### Restoring backups
For restoring a backup you have two options.
#### Full restoration
To restore all services from a backup:
```bash
clan backups restore jon borgbackup storagebox::u444061@u444061.your-storagebox.de:/./borgbackup::jon-storagebox-2025-07-24T06:02:35
```
#### Partial restoration
To restore only a specific service (e.g., `linkding`):
```bash
clan backups restore --service linkding jon borgbackup storagebox::u444061@u444061.your-storagebox.de:/./borgbackup::jon-storagebox-2025-07-24T06:02:35
```

View File

@@ -0,0 +1,71 @@
This guide explains how to set up a [Hetzner Storage Box](https://docs.hetzner.com/storage/storage-box/general) as a backup destination instead of using an internal Clan backup server. Follow the steps below to configure and verify the setup.
### Step 1: Create a Hetzner Storage Box
Begin by [creating a Hetzner Storage Box account](https://docs.hetzner.com/storage/storage-box/getting-started/creating-a-storage-box).
### Step 2: Create a Sub-Account
Set up a sub-account for your `jon` machine. Save the SSH password for this account in your password manager for future reference.
### Step 3: Configure BorgBackup in `clan.nix`
Add the BorgBackup service to your `clan.nix` configuration. In this example, the `jon` machine will back up to `user-sub1@user-sub1.your-storagebox.de` in the `borgbackup` folder:
```nix hl_lines="9"
inventory.instances = {
borgbackup = {
module = {
name = "borgbackup";
input = "clan-core";
};
roles.client.machines."jon".settings = {
destinations."storagebox" = {
repo = "user-sub1@user-sub1.your-storagebox.de:/./borgbackup";
rsh = ''ssh -p 23 -oStrictHostKeyChecking=accept-new -i /run/secrets/vars/borgbackup/borgbackup.ssh'';
};
};
};
};
```
### Step 4: Generate SSH Keys
Run the following command to generate the SSH private keys:
```bash
clan vars generate
```
### Step 5: Add the Public Key to the Sub-Account
Add the generated SSH public key to the `user-sub1` account by running:
```bash
clan vars get jon borgbackup/borgbackup.ssh.pub | ssh -p23 user-sub1@user-sub1.your-storagebox.de install-ssh-key
```
### Step 6: Deploy the Configuration
Apply the changes to your Clan setup by executing:
```bash
clan machines update
```
### Step 7: Verify the Setup
Check if the configuration works by starting the BorgBackup service on the `jon` machine:
```bash
systemctl start borgbackup-job-storagebox.service &
```
Then, inspect the service logs to ensure everything is functioning correctly:
```bash
journalctl -u borgbackup-job-storagebox.service
```

View File

@@ -0,0 +1,89 @@
# Introduction to Clan Backups
This guide explains how to use the Clan backup and state management interface to configure, manage, and restore backups for your services and machines. By the end of this guide, you will understand how to define backup states, manage backups, and restore data.
## State Management
Clan backups are based on the concept of [states](../../reference/clan.core/state.md). A state is a Nix attribute set, defined as `clan.core.state.<name> = {};`, which specifies the files or directories to back up.
For example, if you have a clan service called `linkding`, you can define the folders to back up as follows:
```nix hl_lines="2"
clan.core.state.linkding = {
folders = [ "/var/backup/linkding" ];
};
```
In this example:
- `/var/backup/linkding` is the staging directory where data is prepared for backup.
This simple configuration ensures that all critical data for the `linkding` service is included in the backup process.
## Custom Pre and Post Backup Hooks
The state interface allows you to run custom scripts before creating a backup and after restoring one. These scripts are defined using the `preBackupScript` and `postRestoreScript` options. This can be useful for tasks like stopping services, syncing data, or performing cleanup operations.
### Example: Pre and Post Backup Scripts for the `linkding` Service
In the following example, we configure the `linkding` service to:
1. Stop the service before backing up its data.
2. Sync the data to a staging directory.
3. Restore the data and restart the service after restoration.
```nix hl_lines="5 26"
clan.core.state.linkding = {
folders = [ "/var/backup/linkding" ];
# Script to run before creating a backup
preBackupScript = ''
export PATH=${
lib.makeBinPath [
config.systemd.package
pkgs.coreutils
pkgs.rsync
]
}
# Check if the service is running
service_status=$(systemctl is-active podman-linkding)
if [ "$service_status" = "active" ]; then
# Stop the service and sync data to the backup directory
systemctl stop podman-linkding
rsync -avH --delete --numeric-ids "/data/podman/linkding/" /var/backup/linkding/
systemctl start podman-linkding
fi
'';
# Script to run after restoring a backup
postRestoreScript = ''
export PATH=${
lib.makeBinPath [
config.systemd.package
pkgs.coreutils
pkgs.rsync
]
}
# Check if the service is running
service_status="$(systemctl is-active podman-linkding)"
if [ "$service_status" = "active" ]; then
# Stop the service
systemctl stop podman-linkding
# Backup current data locally
cp -rp "/data/podman/linkding" "/data/podman/linkding.bak"
# Restore data from the backup directory
rsync -avH --delete --numeric-ids /var/backup/linkding/ "/data/podman/linkding/"
# Restart the service
systemctl start podman-linkding
fi
'';
};
```

View File

@@ -0,0 +1,75 @@
In this section we go over how to manage your collection of backups with the clan command.
### Listing states
To see which files (`states`) will be backed up on a specific machine, use:
```bash
clan state list jon
```
This will show all configured states for the machine `jon`, for example:
```text
· service: linkding
folders:
- /var/backup/linkding
preBackupCommand: pre-backup-linkding
postRestoreCommand: post-restore-linkding
· service: zerotier
folders:
- /var/lib/zerotier-one
```
### Creating backups
To create a backup of a machine (e.g., `jon`), run:
```bash
clan backups create jon
```
This will backup all configured states (`zerotier` and `linkding` in this
example) from the machine `jon`.
### Listing available backups
To see all available backups, use:
```bash
clan backups list
```
This will display all backups with their timestamps:
```text
storagebox::username@username.your-storagebox.de:/./borgbackup::jon-jon-2025-07-22T19:40:10
storagebox::username@username.your-storagebox.de:/./borgbackup::jon-jon-2025-07-23T01:00:00
storagebox::username@username.your-storagebox.de:/./borgbackup::jon-storagebox-2025-07-24T01:00:00
storagebox::username@username.your-storagebox.de:/./borgbackup::jon-storagebox-2025-07-24T06:02:35
```
### Restoring backups
For restoring a backup you have two options.
#### Full restoration
To restore all services from a backup:
```bash
clan backups restore jon borgbackup storagebox::u444061@u444061.your-storagebox.de:/./borgbackup::jon-storagebox-2025-07-24T06:02:35
```
#### Partial restoration
To restore only a specific service (e.g., `linkding`):
```bash
clan backups restore --service linkding jon borgbackup storagebox::u444061@u444061.your-storagebox.de:/./borgbackup::jon-storagebox-2025-07-24T06:02:35
```

View File

@@ -0,0 +1,63 @@
In this guide we will explain how to install a simple peer-to-peer backup system through the inventory. Such that machines will backup it's state to other machines in the clan, ensuring redundancy and data safety.
### What is BorgBackup?
BorgBackup is a powerful and efficient backup solution designed for secure and space-efficient backups. It offers features such as:
- **Deduplication**: Saves storage space by avoiding duplicate data.
- **Encryption**: Ensures backups are secure and authenticated.
- **Compression**: Supports multiple compression algorithms like lz4, zstd, zlib, and more.
- **FUSE Mounting**: Allows backups to be mounted as a file system.
- **Cross-Platform**: Works on Linux, macOS, BSD, and more.
- **Open Source**: Licensed under BSD and supported by an active community.
While this guide uses BorgBackup, you can also use other backup services supported by Clan, depending on your requirements.
### Example Setup
In this example, we configure a backup system with three machines: `bob`, `jon`, and `alice`. The `bob` and `jon` machines will periodically back up their state folders to `alice`. The backups are encrypted for security.
```nix
inventory.instances = {
borgbackup = {
module = {
name = "borgbackup";
input = "clan-core";
};
roles.client.machines = {
"bob" = { };
"jon" = { };
};
roles.server.machines = {
"alice" = { };
};
};
};
```
## Roles
In a Clan Service, roles define how machines participate in the backup system. Each role applies specific Nix configurations to the machine, enabling flexibility and scalability in your backup setup.
- **Client**: These machines create backups and send them to designated destinations. Clients can be configured to back up to multiple destinations, ensuring redundancy and reliability.
- **Server**: These machines act as repositories, receiving and securely storing backups from client machines. Servers can be dedicated backup nodes within your clan network, providing centralized storage for all backups.
## Backup destinations
This service allows you to perform backups to multiple `destinations`.
Destinations can be:
- **Local**: Local disk storage
- **Server**: Your own borgbackup server (using the `server` role)
- **Third-party services**: Such as Hetzner's Storage Box
However, if BorgBackup does not meet your needs, you can implement your own backup clan service.

View File

@@ -26,7 +26,7 @@ pkgs.mkShell {
## Debugging nixos-anywhere
If you encounter a bug in a complex shell script such as `nixos-anywhere`, start by replacing the `nixos-anywhere` command with a local checkout of the project, look in the [contribution](./CONTRIBUTING.md) section for an example.
If you encounter a bug in a complex shell script such as `nixos-anywhere`, start by replacing the `nixos-anywhere` command with a local checkout of the project, look in the [contribution](../../guides/contributing/CONTRIBUTING.md) section for an example.
## The Debug Flag

View File

@@ -67,6 +67,59 @@ nix build .#checks.x86_64-linux.{test-attr-name}
```
(replace `{test-attr-name}` with the name of the test)
### Testing services with vars
Services that define their own vars (using `clan.core.vars.generators`) require generating test vars before running the tests.
#### Understanding the `clan.directory` setting
The `clan.directory` option is critical for vars generation and loading in tests. This setting determines:
1. **Where vars are generated**: When you run `update-vars`, it creates `vars/` and `sops/` directories inside the path specified by `clan.directory`
2. **Where vars are loaded from**: During test execution, machines look for their vars and secrets relative to `clan.directory`
#### Generating test vars
For services that define vars, you must first run:
```shellSession
nix run .#checks.x86_64-linux.{test-attr-name}.update-vars
```
This generates the necessary var files in the directory specified by `clan.directory`. After running this command, you can run the test normally:
```shellSession
nix run .#checks.x86_64-linux.{test-attr-name}
```
#### Example: service-dummy-test
The `service-dummy-test` is a good example of a test that uses vars. To run it:
```shellSession
# First, generate the test vars
nix run .#checks.x86_64-linux.service-dummy-test.update-vars
# Then run the test
nix run .#checks.x86_64-linux.service-dummy-test
```
#### Common issues
If `update-vars` fails, you may need to ensure that:
- **`clan.directory` is set correctly**: It should point to the directory where you want vars to be generated (typically `clan.directory = ./.;` in your test definition)
- **Your test defines machines**: Machines must be defined in `clan.inventory.machines` or through the inventory system
- **Machine definitions are complete**: Each machine should have the necessary service configuration that defines the vars generators
**If vars are not found during test execution:**
- Verify that `clan.directory` points to the same location where you ran `update-vars`
- Check that the `vars/` and `sops/` directories exist in that location
- Ensure the generated files match the machines and generators defined in your test
You can reference `/checks/service-dummy-test/` to see a complete working example of a test with vars, including the correct directory structure.
### Debugging VM tests
The following techniques can be used to debug a VM test:

View File

@@ -5,7 +5,7 @@ This guide provides an example setup for a single-disk ZFS system with native en
This configuration only applies to `systemd-boot` enabled systems and **requires** UEFI booting.
!!! Info "Secure Boot"
This guide is compatible with systems that have [secure boot disabled](./secure-boot.md). If you encounter boot issues, check if secure boot needs to be disabled in your UEFI settings.
This guide is compatible with systems that have [secure boot disabled](../guides/secure-boot.md). If you encounter boot issues, check if secure boot needs to be disabled in your UEFI settings.
Replace the highlighted lines with your own disk-id.
You can find our your disk-id by executing:

View File

@@ -1,33 +1,29 @@
Clan supports integration with [flake-parts](https://flake.parts/), a framework for constructing your `flake.nix` using modules. Follow these steps to integrate Clan with flake-parts:
Clan supports integration with [flake-parts](https://flake.parts/), a framework for constructing your `flake.nix` using modules.
## Step 1: Update Your Flake Inputs
To construct your Clan using flake-parts, follow these steps:
## Update Your Flake Inputs
To begin, you'll need to add `flake-parts` as a new dependency in your flake's inputs. This is alongside the already existing dependencies, such as `clan-core` and `nixpkgs`. Here's how you can update your `flake.nix` file:
Add `flake-parts` as a dependency in your `flake.nix` file alongside existing dependencies like `clan-core` and `nixpkgs`. Here's an example:
```nix
# flake.nix
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
# New flake-parts input
# Add flake-parts
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
clan-core = {
url = "https://git.clan.lol/clan/clan-core/archive/main.tar.gz";
inputs.nixpkgs.follows = "nixpkgs"; # Don't do this if your machines are on nixpkgs stable.
# New
inputs.flake-parts.follows = "flake-parts";
inputs.nixpkgs.follows = "nixpkgs"; # Avoid this if using nixpkgs stable.
inputs.flake-parts.follows = "flake-parts"; # New
};
}
};
```
## Import the Clan flake-parts Module
## Step 2: Import the Clan flake-parts Module
After updating your flake inputs, the next step is to import the Clan flake-parts module. This will make the [Clan options](/options) available within `mkFlake`.
Next, import the Clan flake-parts module to make the [Clan options](../reference/options/clan.md) available within `mkFlake`:
```nix
{
@@ -43,9 +39,9 @@ After updating your flake inputs, the next step is to import the Clan flake-part
}
```
## Configure Clan Settings and Define Machines
## Step 3: Configure Clan Settings and Define Machines
Next you'll need to configure Clan wide settings and define machines, here's an example of how `flake.nix` should look:
Configure Clan-wide settings and define machines. Here's an example `flake.nix`:
```nix
{
@@ -62,24 +58,22 @@ Next you'll need to configure Clan wide settings and define machines, here's an
];
# Define your Clan
# See: https://docs.clan.lol/reference/nix-api/clan/
clan = {
# Clan wide settings
meta.name = ""; # This is required and must be unique
meta.name = ""; # Required and must be unique
machines = {
jon = {
imports = [
./modules/firefox.nix
# ... more modules
# Add more modules as needed
];
nixpkgs.hostPlatform = "x86_64-linux";
# Set this for Clan commands to work remotely over SSH like `clan machines update`
# Enable remote Clan commands over SSH
clan.core.networking.targetHost = "root@jon";
# remote> lsblk --output NAME,ID-LINK,FSTYPE,SIZE,MOUNTPOINT
# Disk configuration
disko.devices.disk.main = {
device = "/dev/disk/by-id/nvme-eui.e8238fa6bf530001001b448b4aec2929";
};
@@ -90,7 +84,4 @@ Next you'll need to configure Clan wide settings and define machines, here's an
}
```
For detailed information about configuring `flake-parts` and the available options within Clan,
refer to the [Clan module](https://git.clan.lol/clan/clan-core/src/branch/main/flakeModules/clan.nix) documentation.
---
For more details on configuring `flake-parts` and available Clan options, refer to the [Clan module documentation](https://git.clan.lol/clan/clan-core/src/branch/main/flakeModules/clan.nix).

View File

@@ -0,0 +1,213 @@
A common use case you might have is to host services and applications which are
only reachable within your clan.
This guide explains how to set up such secure, clan-internal web services using
a custom top-level domain (TLD) with SSL certificates.
Your services will be accessible only within your clan network and secured with
proper SSL certificates that all clan machines trust.
## Overview
By combining the `coredns` and `certificates` clan services, you can:
- Create a custom TLD for your clan (e.g. `.c`)
- Host internal web services accessible via HTTPS (e.g. `https://api.c`, `https://dashboard.c`)
- Automatically provision and trust SSL certificates across all clan machines
- Keep internal services secure and isolated from the public internet
The setup uses two clan services working together:
- **coredns service**: Provides DNS resolution for your custom TLD within the clan
- **certificates service**: Creates a certificate authority (CA) and issues SSL certificates for your TLD
### DNS Resolution Flow
1. A clan machine tries to access `https://service.c`
2. The machine queries its local DNS resolver (unbound)
3. For `.c` domains, the query is forwarded to your clan's CoreDNS server. All
other domains will be resolved as usual.
4. CoreDNS returns the IP address of the machine hosting the service
5. The machine connects directly to the service over HTTPS
6. The SSL certificate is trusted because all machines trust your clan's CA
## Step-by-Step Setup
The following setup assumes you have a VPN (e.g. Zerotier) already running. The
IPs configured in the options below will probably the Zerotier-IPs of the
respective machines.
### Configure the CoreDNS Service
The CoreDNS service has two roles:
- `server`: Runs the DNS server for your custom TLD
- `default`: Makes machines use the DNS server for TLD resolution and allows exposing services
Add this to your inventory:
```nix
inventory = {
machines = {
dns-server = { }; # Machine that will run the DNS server
web-server = { }; # Machine that will host web services
client = { }; # Any other machines in your clan
};
instances = {
coredns = {
# Add the default role to all machines
roles.default.tags = [ "all" ];
# DNS server for the .c TLD
roles.server.machines.dns-server.settings = {
ip = "192.168.1.10"; # IP of your DNS server machine
tld = "c";
};
# Machine hosting services (example: ca.c and admin.c)
roles.default.machines.web-server.settings = {
ip = "192.168.1.20"; # IP of your web server
services = [ "ca" "admin" ];
};
};
};
};
```
### Configure the Certificates Service
The certificates service also has two roles:
- `ca`: Sets up the certificate authority on a server
- `default`: Makes machines trust the CA and allows them to request certificates
Add this to your inventory:
```nix
inventory = {
instances = {
# ... coredns configuration from above ...
certificates = {
# Set up CA for .c domain
roles.ca.machines.dns-server.settings = {
tlds = [ "c" ];
acmeEmail = "admin@example.com"; # Optional: your email
};
# Add default role to all machines to trust the CA
roles.default.tags = [ "all" ];
};
};
};
```
### Complete Example Configuration
Here's a complete working example:
```nix
nventory = {
machines = {
caserver = { }; # DNS server + CA + web services
webserver = { }; # Additional web services
client = { }; # Client machine
};
instances = {
coredns = {
# Add the default role to all machines
roles.default.tags = [ "all" ];
# DNS server for the .c TLD
roles.server.machines.caserver.settings = {
ip = "192.168.8.5";
tld = "c";
};
# machine hosting https://ca.c (our CA for SSL)
roles.default.machines.caserver.settings = {
ip = "192.168.8.5";
services = [ "ca" ];
};
# machine hosting https://blub.c (some internal web-service)
roles.default.machines.webserver.settings = {
ip = "192.168.8.6";
services = [ "blub" ];
};
};
# Provide https for the .c top-level domain
certificates = {
roles.ca.machines.caserver.settings = {
tlds = [ "c" ];
acmeEmail = "admin@example.com";
};
roles.default.tags = [ "all" ];
};
};
};
```
## Testing Your Configuration
DNS resolution can be tested with:
```bash
# On any clan machine, test DNS resolution
nslookup ca.c
nslookup blub.c
```
You should also now be able to visit `https://ca.c` to access the certificate authority or visit `https://blub.c` to access your web service.
## Troubleshooting
### DNS Resolution Issues
1. **Check if DNS server is running**:
```bash
# On the DNS server machine
systemctl status coredns
```
2. **Verify DNS configuration**:
```bash
# Check if the right nameservers are configured
cat /etc/resolv.conf
systemctl status systemd-resolved
```
3. **Test DNS directly**:
```bash
# Query the DNS server directly
dig @192.168.8.5 ca.c
```
### Certificate Issues
1. **Check CA status**:
```bash
# On the CA machine
systemctl status step-ca
systemctl status nginx
```
2. **Verify certificate trust**:
```bash
# Test certificate trust
curl -v https://ca.c
openssl s_client -connect ca.c:443 -verify_return_error
```
3. **Check ACME configuration**:
```bash
# View ACME certificates
ls /var/lib/acme/
journalctl -u acme-ca.c.service
```

View File

@@ -17,13 +17,13 @@ The following tutorial will walk through setting up a Backup service where the t
## Prerequisites
- [x] [Add some machines](../getting-started/add-machines.md) to your Clan.
- [x] [Add some machines](../../getting-started/add-machines.md) to your Clan.
## Services
The inventory defines `instances` of clan services. Membership of `machines` is defined via `roles` exclusively.
See each [modules documentation](../../reference/clanServices/index.md) for its available roles.
See each [modules documentation](../../services/definition.md) for its available roles.
### Adding services to machines

View File

@@ -7,7 +7,7 @@ This guide explains how to manage macOS machines using Clan.
Currently, Clan supports the following features for macOS:
- `clan machines update` for existing [nix-darwin](https://github.com/nix-darwin/nix-darwin) installations
- Support for [vars](./vars/vars-overview.md)
- Support for [vars](../guides/vars/vars-overview.md)
## Add Your Machine to Your Clan Flake

View File

@@ -1,7 +1,7 @@
# Migrating from using `clanModules` to `clanServices`
**Audience**: This is a guide for **people using `clanModules`**.
If you are a **module author** and need to migrate your modules please consult our **new** [clanServices authoring guide](../services/community.md)
If you are a **module author** and need to migrate your modules please consult our **new** [clanServices authoring guide](../../guides/services/community.md)
## What's Changing?
@@ -157,7 +157,7 @@ instances = {
### Move `services` entries to `instances`
Check if a service that you use has been migrated [In our reference](../../reference/clanServices/index.md)
Check if a service that you use has been migrated [In our reference](../../services/definition.md)
In your inventory, move it from:
@@ -247,45 +247,45 @@ The following table shows the migration status of each deprecated clanModule:
| clanModule | Migration Status | Notes |
|--------------------------|-------------------------------------------------------------------|------------------------------------------------------------------|
| `admin` | ✅ [Migrated](../../reference/clanServices/admin.md) | |
| `admin` | ✅ [Migrated](../../services/official/admin.md) | |
| `auto-upgrade` | ❌ Removed | |
| `borgbackup-static` | ❌ Removed | |
| `borgbackup` | ✅ [Migrated](../../reference/clanServices/borgbackup.md) | |
| `data-mesher` | ✅ [Migrated](../../reference/clanServices/data-mesher.md) | |
| `borgbackup` | ✅ [Migrated](../../services/official/borgbackup.md) | |
| `data-mesher` | ✅ [Migrated](../../services/official/data-mesher.md) | |
| `deltachat` | ❌ Removed | |
| `disk-id` | ❌ Removed | |
| `dyndns` | ✅ [Migrated](../../reference/clanServices/dyndns.md) | |
| `dyndns` | ✅ [Migrated](../../services/official/dyndns.md) | |
| `ergochat` | ❌ Removed | |
| `garage` | ✅ [Migrated](../../reference/clanServices/garage.md) | |
| `garage` | ✅ [Migrated](../../services/official/garage.md) | |
| `golem-provider` | ❌ Removed | |
| `heisenbridge` | ❌ Removed | |
| `importer` | ✅ [Migrated](../../reference/clanServices/importer.md) | |
| `iwd` | ❌ Removed | Use [wifi service](../../reference/clanServices/wifi.md) instead |
| `localbackup` | ✅ [Migrated](../../reference/clanServices/localbackup.md) | |
| `importer` | ✅ [Migrated](../../services/official/importer.md) | |
| `iwd` | ❌ Removed | Use [wifi service](../../services/official/wifi.md) instead |
| `localbackup` | ✅ [Migrated](../../services/official/localbackup.md) | |
| `localsend` | ❌ Removed | |
| `machine-id` | ✅ [Migrated](../../reference/clan.core/settings.md) | Now an [option](../../reference/clan.core/settings.md) |
| `matrix-synapse` | ✅ [Migrated](../../reference/clanServices/matrix-synapse.md) | |
| `matrix-synapse` | ✅ [Migrated](../../services/official/matrix-synapse.md) | |
| `moonlight` | ❌ Removed | |
| `mumble` | ❌ Removed | |
| `mycelium` | ✅ [Migrated](../../reference/clanServices/mycelium.md) | |
| `mycelium` | ✅ [Migrated](../../services/official/mycelium.md) | |
| `nginx` | ❌ Removed | |
| `packages` | ✅ [Migrated](../../reference/clanServices/packages.md) | |
| `packages` | ✅ [Migrated](../../services/official/packages.md) | |
| `postgresql` | ✅ [Migrated](../../reference/clan.core/settings.md) | Now an [option](../../reference/clan.core/settings.md) |
| `root-password` | ✅ [Migrated](../../reference/clanServices/users.md) | See [migration guide](../../reference/clanServices/users.md#migration-from-root-password-module) |
| `root-password` | ✅ [Migrated](../../services/official/users.md) | See [migration guide](../../services/official/users.md#migration-from-root-password-module) |
| `single-disk` | ❌ Removed | |
| `sshd` | ✅ [Migrated](../../reference/clanServices/sshd.md) | |
| `sshd` | ✅ [Migrated](../../services/official/sshd.md) | |
| `state-version` | ✅ [Migrated](../../reference/clan.core/settings.md) | Now an [option](../../reference/clan.core/settings.md) |
| `static-hosts` | ❌ Removed | |
| `sunshine` | ❌ Removed | |
| `syncthing-static-peers` | ❌ Removed | |
| `syncthing` | ✅ [Migrated](../../reference/clanServices/syncthing.md) | |
| `syncthing` | ✅ [Migrated](../../services/official/syncthing.md) | |
| `thelounge` | ❌ Removed | |
| `trusted-nix-caches` | ✅ [Migrated](../../reference/clanServices/trusted-nix-caches.md) | |
| `user-password` | ✅ [Migrated](../../reference/clanServices/users.md) | |
| `trusted-nix-caches` | ✅ [Migrated](../../services/official/trusted-nix-caches.md) | |
| `user-password` | ✅ [Migrated](../../services/official/users.md) | |
| `vaultwarden` | ❌ Removed | |
| `xfce` | ❌ Removed | |
| `zerotier-static-peers` | ❌ Removed | |
| `zerotier` | ✅ [Migrated](../../reference/clanServices/zerotier.md) | |
| `zerotier` | ✅ [Migrated](../../services/official/zerotier.md) | |
| `zt-tcp-relay` | ❌ Removed | |
---
@@ -378,6 +378,6 @@ instances = {
## Further reference
* [Inventory Concept](../inventory/inventory.md)
* [Authoring a 'clan.service' module](../services/community.md)
* [ClanServices](../inventory/clanServices.md)
* [Inventory Concept](../../guides/inventory/inventory.md)
* [Authoring a 'clan.service' module](../../guides/services/community.md)
* [ClanServices](../../guides/services/introduction-to-services.md)

View File

@@ -1,9 +1,9 @@
# Migrate modules from `facts` to `vars`.
# Migrate modules from `facts` to `vars`
For a high level overview about `vars` see our [blog post](https://clan.lol/blog/vars/).
This guide will help you migrate your modules that still use our [`facts`](../secrets.md) backend
to the [`vars`](../vars/vars-overview.md) backend.
This guide will help you migrate your modules that still use our [`facts`](../../guides/migrations/migration-facts-vars.md) backend
to the [`vars`](../../guides/vars/vars-overview.md) backend.
The `vars` [module](../../reference/clan.core/vars.md) and the clan [command](../../reference/cli/vars.md) work in tandem, they should ideally be kept in sync.
@@ -33,7 +33,6 @@ vars.generators.vaultwarden = {
And this would read as follows: The vaultwarden `vars` module generates the admin file.
## Prompts
Because prompts can be a necessity for certain systems `vars` have a shorthand for defining them.
@@ -46,7 +45,9 @@ facts.services.forgejo-api = {
generator.script = "cp $prompt_value > $secret/token";
};
```
To have analogous functionality in `vars`:
```nix
vars.generators.forgejo-api = {
prompts.token = {
@@ -55,6 +56,7 @@ vars.generators.forgejo-api = {
};
};
```
This does not only simplify prompting, it also now allows us to define multiple prompts in one generator.
A more analogous way to the `fact` method is available, in case the module author needs more flexibility with the prompt input:
@@ -92,8 +94,8 @@ facts.services.syncthing = {
};
```
This would be the corresponding `vars` module, which also will migrate existing facts.
```nix
vars.generators.syncthing = {
migrateFact = "syncthing";
@@ -116,11 +118,11 @@ vars.generators.syncthing = {
'';
};
```
Most of the usage patterns stay the same, but `vars` have a more ergonomic interface.
There are not two different ways to define files anymore (public/secret).
Now files are defined under the `files` attribute and are secret by default.
## Happy Migration
We hope this gives you a clear path to start and finish your migration from `facts` to `vars`.

View File

@@ -1,4 +1,3 @@
This guide provides detailed instructions for configuring
[ZeroTier VPN](https://zerotier.com) within Clan. Follow the
outlined steps to set up a machine as a VPN controller (`<CONTROLLER>`) and to
@@ -98,11 +97,12 @@ The status should be "ONLINE":
```
## Further
Currently **Zerotier** is the only mesh-vpn that is fully integrated into clan.
In the future we plan to add additional network technologies like tinc, head/tailscale
Currently we support yggdrassil and mycelium through usage of the inventory,
though it is not yet integrated into the networking module.
Currently you can only use **Zerotier** as networking technology because this is the first network stack we aim to support.
In the future we plan to add additional network technologies like tinc, head/tailscale, yggdrassil and mycelium.
We chose zerotier because in our tests it was a straight forwards solution to bootstrap.
We chose ZeroTier because in our tests it was a straight forward solution to bootstrap.
It allows you to selfhost a controller and the controller doesn't need to be globally reachable.
Which made it a good fit for starting the project.
@@ -132,7 +132,7 @@ $ sudo zerotier-cli info
#### Manually Authorize a Machine on the Controller
=== "with ZerotierIP"
=== "with ZeroTierIP"
```bash
$ sudo zerotier-members allow --member-ip <IP>
@@ -140,10 +140,10 @@ $ sudo zerotier-cli info
Substitute `<IP>` with the ZeroTier IP obtained previously.
=== "with ZerotierID"
=== "with ZeroTierID"
```bash
$ sudo zerotier-members allow <ID>
```
Substitute `<ID>` with the ZeroTier ID obtained previously.
Substitute `<ID>` with the ZeroTier ID obtained previously.

View File

@@ -64,5 +64,5 @@ nixos-rebuild switch --flake .#my-machine --target-host root@target-ip --build-h
## Related Documentation
- [Update Your Machines](getting-started/update.md) - Using clan's update command
- [Variables (Vars)](vars/vars-overview.md) - Understanding the vars system
- [Update Your Machines](../getting-started/update-machines.md) - Using clan's update command
- [Variables (Vars)](../guides/vars/vars-overview.md) - Understanding the vars system

View File

@@ -0,0 +1,99 @@
**Q**: How should I choose the `nixpkgs` input for my flake when using `clan-core`?
**A**: Pin your flake to a recent `nixpkgs` version. Here are two common approaches, each with its trade-offs:
## Option 1: Follow `clan-core`
- **Pros**:
- Recommended for most users.
- Verified by our CI and widely used by others.
- **Cons**:
- Coupled to version bumps in `clan-core`.
- Upstream features and packages may take longer to land.
Example:
```nix
inputs = {
clan-core.url = "https://git.clan.lol/clan/clan-core/archive/main.tar.gz";
# Use the `nixpkgs` version locked in `clan-core`
nixpkgs.follows = "clan-core/nixpkgs";
};
```
## Option 2: Use Your Own `nixpkgs` Version
- **Pros**:
- Faster access to new upstream features and packages.
- **Cons**:
- Recommended for advanced users.
- Not covered by our CI — youre on the frontier.
Example:
```nix
inputs = {
# Specify your own `nixpkgs` version
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
clan-core.url = "https://git.clan.lol/clan/clan-core/archive/main.tar.gz";
# Ensure `clan-core` uses your `nixpkgs` version
clan-core.inputs.nixpkgs.follows = "nixpkgs";
};
```
## Recommended: Avoid Duplicate `nixpkgs` Entries
To prevent ambiguity or compatibility issues, check your `flake.lock` for duplicate `nixpkgs` entries. Duplicate entries indicate a missing `follows` directive in one of your flake inputs.
Example of duplicate entries in `flake.lock`:
```json
"nixpkgs": {
"locked": {
"lastModified": 315532800,
"narHash": "sha256-1tUpklZsKzMGI3gjo/dWD+hS8cf+5Jji8TF5Cfz7i3I=",
"rev": "08b8f92ac6354983f5382124fef6006cade4a1c1",
"type": "tarball",
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-25.11pre862603.08b8f92ac635/nixexprs.tar.xz"
},
"original": {
"type": "tarball",
"url": "https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1758346548,
"narHash": "sha256-afXE7AJ7MY6wY1pg/Y6UPHNYPy5GtUKeBkrZZ/gC71E=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "b2a3852bd078e68dd2b3dfa8c00c67af1f0a7d20",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
}
```
To locate the source of duplicate entries, grep your `flake.lock` file. For example, if `home-manager` is referencing `nixpkgs_2` instead of the main `nixpkgs`:
```json
"home-manager": {
"inputs": {
"nixpkgs": "nixpkgs_2"
}
}
```
Fix this by adding the following line to your `flake.nix` inputs:
```nix
home-manager.inputs.nixpkgs.follows = "nixpkgs";
```
Repeat this process until all duplicate `nixpkgs` entries are resolved. This ensures all inputs use the same `nixpkgs` source, preventing cross-version conflicts.

View File

@@ -1,5 +1,5 @@
This article provides an overview over the underlying secrets system which is used by [Vars](./vars/vars-overview.md).
Under most circumstances you should use [Vars](./vars/vars-overview.md) directly instead.
This article provides an overview over the underlying secrets system which is used by [Vars](../guides/vars/vars-overview.md).
Under most circumstances you should use [Vars](../guides/vars/vars-overview.md) directly instead.
Consider using `clan secrets` only for managing admin users and groups, as well as a debugging tool.

View File

@@ -3,9 +3,9 @@
## Service Module Specification
This section explains how to author a clan service module.
We discussed the initial architecture in [01-clan-service-modules](../../decisions/01-ClanModules.md) and decided to rework the format.
We discussed the initial architecture in [01-clan-service-modules](../../decisions/01-Clan-Modules.md) and decided to rework the format.
For the full specification and current state see: **[Service Author Reference](../../reference/clanServices/clan-service-author-interface.md)**
For the full specification and current state see: **[Service Author Reference](../../reference/options/clan_service.md)**
### A Minimal module
@@ -47,7 +47,7 @@ The imported module file must fulfill at least the following requirements:
}
```
For more attributes see: **[Service Author Reference](../../reference/clanServices/clan-service-author-interface.md)**
For more attributes see: **[Service Author Reference](../../reference/options/clan_service.md)**
### Adding functionality to the module
@@ -288,7 +288,7 @@ of their type.
In the inventory we the assign machines to a type, e.g. by using tags
```nix title="flake.nix"
instnaces.machine-type = {
instances.machine-type = {
module.input = "self";
module.name = "@pinpox/machine-type";
roles.desktop.tags.desktop = { };
@@ -300,6 +300,7 @@ instnaces.machine-type = {
## Further Reading
- [Reference Documentation for Service Authors](../../reference/clanServices/clan-service-author-interface.md)
- [Migration Guide from ClanModules to ClanServices](../migrations/migrate-inventory-services.md)
- [Decision that lead to ClanServices](../../decisions/01-ClanModules.md)
- [Reference Documentation for Service Authors](../../reference/options/clan_service.md)
- [Migration Guide from ClanModules to ClanServices](../../guides/migrations/migrate-inventory-services.md)
- [Decision that lead to ClanServices](../../decisions/01-Clan-Modules.md)
- [Testing Guide for Services with Vars](../contributing/testing.md#testing-services-with-vars)

View File

@@ -1,11 +1,11 @@
Clan's inventory system is a composable way to define and deploy services across
Clan's services are a modular way to define and deploy services across
machines.
This guide shows how to **instantiate** a `clanService`, explains how service
definitions are structured in your inventory, and how to pick or create services
This guide shows how to **instantiate** a **service**, explains how service
definitions are structured and how to pick or create services
from modules exposed by flakes.
The term **Multi-host-modules** was introduced previously in the [nixus
A similar term: **Multi-host-modules** was introduced previously in the [nixus
repository](https://github.com/infinisil/nixus) and represents a similar
concept.
@@ -68,7 +68,7 @@ inventory.instances = {
## Module Settings
Each role might expose configurable options. See clan's [clanServices
reference](../../reference/clanServices/index.md) for all available options.
reference](../../services/definition.md) for all available options.
Settings can be set in per-machine or per-role. The latter is applied to all
machines that are assigned to that role.
@@ -155,13 +155,13 @@ inventory.instances = {
You can use services exposed by Clan's core module library, `clan-core`.
🔗 See: [List of Available Services in clan-core](../../reference/clanServices/index.md)
🔗 See: [List of Available Services in clan-core](../../services/definition.md)
## Defining Your Own Service
You can also author your own `clanService` modules.
🔗 Learn how to write your own service: [Authoring a service](../services/community.md)
🔗 Learn how to write your own service: [Authoring a service](../../guides/services/community.md)
You might expose your service module from your flake — this makes it easy for other people to also use your module in their clan.
@@ -177,7 +177,5 @@ ______________________________________________________________________
## What's Next?
- [Author your own clanService →](../services/community.md)
- [Migrate from clanModules →](../migrations/migrate-inventory-services.md)
<!-- TODO: * [Understand the architecture →](../explanation/clan-architecture.md) -->
- [Author your own clanService →](../../guides/services/community.md)
- [Migrate from clanModules →](../../guides/migrations/migrate-inventory-services.md)

View File

@@ -140,5 +140,5 @@ clan machines update my-machine
## Migration from Facts
If you're currently using the legacy facts system, see our [Migration Guide](../migrations/migration-facts-vars.md) for step-by-step instructions on upgrading to vars.
If you're currently using the legacy facts system, see our [Migration Guide](../../guides/migrations/migration-facts-vars.md) for step-by-step instructions on upgrading to vars.

View File

@@ -74,17 +74,18 @@ hide:
<input type="checkbox" id="clan-readmore" class="clamp-toggle" />
<div class="clamp-content">
<p><a href="https://clan.lol/">Clan</a> is a peer-to-peer computer management framework that empowers you to selfhost in a reliable and scalable way</strong>.</p>
<p>Built on NixOS, Clan provides a declarative interface for managing machines</strong> with automated <a href="./guides/secrets.md">secret management</a>, easy <a href="./guides/mesh-vpn.md">mesh VPN connectivity</a>, and <a href="./guides/backups.md">automated backups</a>.</p>
<p>Built on NixOS, Clan provides a declarative interface for managing machines</strong> with <a href="/guides/vars/vars-overview/">Resource management</a>, <a href="/guides/networking/networking/">Networking</a>, and <a href="
/guides/backups/backup-intro/">Backups</a>.</p>
<p>Whether you're running a homelab or maintaining critical computing infrastructure, Clan will help reduce maintenance burden</strong> by allowing a git repository to define your whole network</strong> of computers.</p>
<p>In combination with <a href="https://github.com/Mic92/sops-nix">sops-nix</a>, <a href="https://github.com/nix-community/nixos-anywhere">nixos-anywhere</a> and <a href="https://github.com/nix-community/disko">disko</a>, Clan makes it possible to have collaborative infrastructure</strong>.</p>
<p>At the heart of Clan are <a href="./reference/clanServices/index.md">Clan Services</a> - the core concept that enables you to add functionality across multiple machines in your network. While Clan ships with essential core services, you can <a href="./guides/inventory/clanServices.md">create custom services</a> tailored to your specific needs.</p>
<p>At the heart of Clan are <a href="/services/definition">Clan Services</a> - the core concept that enables you to add functionality across multiple machines in your network. While Clan ships with essential core services, everyone can <a href="/guides/services/community/">create custom services</a> tailored to your specific needs.</p>
</div>
<label class="clamp-more" for="clan-readmore"></label>
</div>
---
[Get started](./guides/getting-started/index.md){ .md-button .md-button--primary }
[Get started](./getting-started/creating-your-first-clan.md){ .md-button .md-button--primary }
[View on Gitea](https://git.clan.lol/clan/clan-core){ .md-button }
## Guides
@@ -121,13 +122,13 @@ hide:
command line interface
- [Clan Options](/options)
- [Clan Options](./reference/options/clan.md)
---
Search all options
- [Services](./reference/clanServices/index.md)
- [Services](./services/definition.md)
---

View File

@@ -4,10 +4,10 @@ This section of the site provides an overview of available options and commands
---
- [Clan Configuration Option](/options) - for defining a Clan
- Learn how to use the [Clan CLI](./cli/index.md)
- Explore available [services](./clanServices/index.md)
- [NixOS Configuration Options](./clan.core/index.md) - Additional options avilable on a NixOS machine.
- Learn how to use the [Clan CLI](../reference/cli/index.md)
- Explore available [services](../services/definition.md)
- [NixOS Configuration Options](../reference/clan.core/index.md) - Additional options avilable on a NixOS machine.
- [Search Clan Option](/option-search) - for defining a Clan
---

View File

@@ -0,0 +1,14 @@
**`clanServices`** are modular building blocks that simplify the configuration and orchestration of multi-host services.
Each `clanService`:
* Is a module of class **`clan.service`**
* Can define **roles** (e.g., `client`, `server`)
* Uses **`inventory.instances`** to configure where and how it is deployed
!!! Note
`clanServices` are part of Clan's next-generation service model and are intended to replace `clanModules`.
See [Migration Guide](../guides/migrations/migrate-inventory-services.md) for help on migrating.
Learn how to use `clanServices` in practice in the [Using clanServices guide](../guides/services/introduction-to-services.md).

43
flake.lock generated
View File

@@ -13,11 +13,11 @@
]
},
"locked": {
"lastModified": 1758510393,
"narHash": "sha256-Bd7gr2RBaDJn1Zppus1WpW6CCdtJFn9Ccv4x0/HqCjo=",
"rev": "e8418ce6a514d3561ea7dd2242d4bb9b36bc003b",
"lastModified": 1759140052,
"narHash": "sha256-CpGdQRvgmBhEAlXNyrSfrDWcKoYYSGd+5Lw7mvlbt/A=",
"rev": "8332273e734aa906e7a1b2fda80e631f2dc9d4c9",
"type": "tarball",
"url": "https://git.clan.lol/api/v1/repos/clan/data-mesher/archive/e8418ce6a514d3561ea7dd2242d4bb9b36bc003b.tar.gz"
"url": "https://git.clan.lol/api/v1/repos/clan/data-mesher/archive/8332273e734aa906e7a1b2fda80e631f2dc9d4c9.tar.gz"
},
"original": {
"type": "tarball",
@@ -51,11 +51,11 @@
]
},
"locked": {
"lastModified": 1756770412,
"narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=",
"lastModified": 1759362264,
"narHash": "sha256-wfG0S7pltlYyZTM+qqlhJ7GMw2fTF4mLKCIVhLii/4M=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "4524271976b625a4a605beefd893f270620fd751",
"rev": "758cf7296bee11f1706a574c77d072b8a7baa881",
"type": "github"
},
"original": {
@@ -71,15 +71,16 @@
]
},
"locked": {
"lastModified": 1758447883,
"narHash": "sha256-yGA6MV0E4JSEXqLTb4ZZkmdJZcoQ8HUzihRRX12Bvpg=",
"lastModified": 1759509947,
"narHash": "sha256-4XifSIHfpJKcCf5bZZRhj8C4aCpjNBaE3kXr02s4rHU=",
"owner": "nix-darwin",
"repo": "nix-darwin",
"rev": "25381509d5c91bbf3c30e23abc6d8476d2143cd1",
"rev": "000eadb231812ad6ea6aebd7526974aaf4e79355",
"type": "github"
},
"original": {
"owner": "nix-darwin",
"ref": "nix-darwin-25.05",
"repo": "nix-darwin",
"type": "github"
}
@@ -114,15 +115,15 @@
},
"nixpkgs": {
"locked": {
"lastModified": 315532800,
"narHash": "sha256-1tUpklZsKzMGI3gjo/dWD+hS8cf+5Jji8TF5Cfz7i3I=",
"rev": "08b8f92ac6354983f5382124fef6006cade4a1c1",
"lastModified": 1760324802,
"narHash": "sha256-VWlJtLQ5EQQj45Wj0yTExtSjwRyZ59/qMqEwus/Exlg=",
"rev": "7e297ddff44a3cc93673bb38d0374df8d0ad73e4",
"type": "tarball",
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-25.11pre862603.08b8f92ac635/nixexprs.tar.xz"
"url": "https://releases.nixos.org/nixos/25.05/nixos-25.05.811135.7e297ddff44a/nixexprs.tar.xz"
},
"original": {
"type": "tarball",
"url": "https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz"
"url": "https://nixos.org/channels/nixos-25.05/nixexprs.tar.xz"
}
},
"root": {
@@ -146,11 +147,11 @@
]
},
"locked": {
"lastModified": 1758425756,
"narHash": "sha256-L3N8zV6wsViXiD8i3WFyrvjDdz76g3tXKEdZ4FkgQ+Y=",
"lastModified": 1759635238,
"narHash": "sha256-UvzKi02LMFP74csFfwLPAZ0mrE7k6EiYaKecplyX9Qk=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "e0fdaea3c31646e252a60b42d0ed8eafdb289762",
"rev": "6e5a38e08a2c31ae687504196a230ae00ea95133",
"type": "github"
},
"original": {
@@ -181,11 +182,11 @@
]
},
"locked": {
"lastModified": 1758206697,
"narHash": "sha256-/DbPkh6PZOgfueCbs3uzlk4ASU2nPPsiVWhpMCNkAd0=",
"lastModified": 1760120816,
"narHash": "sha256-gq9rdocpmRZCwLS5vsHozwB6b5nrOBDNc2kkEaTXHfg=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "128222dc911b8e2e18939537bed1762b7f3a04aa",
"rev": "761ae7aff00907b607125b2f57338b74177697ed",
"type": "github"
},
"original": {

View File

@@ -2,9 +2,9 @@
description = "clan.lol base operating system";
inputs = {
nixpkgs.url = "https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz";
nixpkgs.url = "https://nixos.org/channels/nixos-25.05/nixexprs.tar.xz";
nix-darwin.url = "github:nix-darwin/nix-darwin";
nix-darwin.url = "github:nix-darwin/nix-darwin/nix-darwin-25.05";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
@@ -56,55 +56,61 @@
else
(import ./devFlake/flake-compat.nix {
src = ./devFlake;
}).outputs;
}).outputs.inputs;
in
flake-parts.lib.mkFlake { inherit inputs; } (
{ ... }:
flake-parts.lib.mkFlake
{
_module.args = {
inherit inputs;
specialArgs = {
inherit privateInputs;
};
clan = {
meta.name = "clan-core";
inventory = {
machines = {
"test-darwin-machine" = {
machineClass = "darwin";
}
(
{ ... }:
{
clan = {
meta.name = "clan-core";
inventory = {
machines = {
"test-darwin-machine" = {
machineClass = "darwin";
};
};
};
# Allows downstream users to inject "unsupported" nixpkgs versions
checks.minNixpkgsVersion.ignore = true;
};
};
systems = import systems;
imports = [
flake-parts.flakeModules.modules
]
++
# only importing existing paths allows to minimize the flake for test
# by removing files
filter pathExists [
./checks/flake-module.nix
./clanModules/flake-module.nix
./clanServices/flake-module.nix
./devShell.nix
./docs/nix/flake-module.nix
./flakeModules/demo_iso.nix
./flakeModules/flake-module.nix
./lib/filter-clan-core/flake-module.nix
./lib/flake-module.nix
./lib/flake-parts/clan-nixos-test.nix
./nixosModules/clanCore/vars/flake-module.nix
./nixosModules/flake-module.nix
./pkgs/clan-cli/clan_cli/tests/flake-module.nix
./pkgs/flake-module.nix
./templates/flake-module.nix
systems = import systems;
imports = [
flake-parts.flakeModules.modules
]
++ [
(if pathExists ./flakeModules/clan.nix then import ./flakeModules/clan.nix inputs.self else { })
]
# Make treefmt-nix optional
# This only works if you set inputs.clan-core.inputs.treefmt-nix.follows
# to a non-empty input that doesn't export a flakeModule
++ optional (pathExists ./formatter.nix && inputs.treefmt-nix ? flakeModule) ./formatter.nix;
}
);
++
# only importing existing paths allows to minimize the flake for test
# by removing files
filter pathExists [
./checks/flake-module.nix
./clanModules/flake-module.nix
./clanServices/flake-module.nix
./devShell.nix
./docs/nix/flake-module.nix
./flakeModules/demo_iso.nix
./flakeModules/flake-module.nix
./lib/filter-clan-core/flake-module.nix
./lib/flake-module.nix
./lib/flake-parts/clan-nixos-test.nix
./nixosModules/clanCore/vars/flake-module.nix
./nixosModules/flake-module.nix
./pkgs/clan-cli/clan_cli/tests/flake-module.nix
./pkgs/flake-module.nix
./templates/flake-module.nix
]
++ [
(if pathExists ./flakeModules/clan.nix then import ./flakeModules/clan.nix inputs.self else { })
]
# Make treefmt-nix optional
# This only works if you set inputs.clan-core.inputs.treefmt-nix.follows
# to a non-empty input that doesn't export a flakeModule
++ optional (pathExists ./formatter.nix && inputs.treefmt-nix ? flakeModule) ./formatter.nix;
}
);
}

View File

@@ -22,26 +22,50 @@ in
default = config.flake.clan.clanInternals;
};
# The clan module
clan = lib.mkOption {
description = "Clan module. Define your clan inside here";
default = { };
type = types.submoduleWith {
class = "clan";
specialArgs =
# TODO: make these explizit options and deduplicate with lib.clan function
let
nixpkgs = inputs.nixpkgs or clan-core.inputs.nixpkgs;
nix-darwin = inputs.nix-darwin or clan-core.inputs.nix-darwin;
in
{
clan =
# TODO: make these explizit options and deduplicate with lib.clan function
let
nixpkgs = inputs.nixpkgs or clan-core.inputs.nixpkgs;
nix-darwin = inputs.nix-darwin or clan-core.inputs.nix-darwin;
in
lib.mkOption {
description = "Clan module. Define your clan inside here";
default = { };
type = types.submoduleWith {
class = "clan";
specialArgs = {
inherit self;
inherit nixpkgs nix-darwin;
};
modules = [
clan-core.modules.clan.default
];
modules = [
clan-core.modules.clan.default
{
checks.minNixpkgsVersion = {
assertion = lib.versionAtLeast nixpkgs.lib.version "25.11";
message = ''
Nixpkgs version: ${nixpkgs.lib.version} is incompatible with clan-core. (>= 25.11 is recommended)
---
Your version of 'nixpkgs' seems too old for clan-core.
Please read: https://docs.clan.lol/guides/nixpkgs-flake-input
You can ignore this check by setting:
clan.checks.minNixpkgsVersion.ignore = true;
---
'';
};
}
];
};
apply =
config:
lib.deepSeq (lib.mapAttrs (
id: check:
if check.ignore || check.assertion then
null
else
throw "clan.checks.${id} failed with message\n${check.message}"
) config.checks) config;
};
};
# Mapped flake toplevel outputs
darwinConfigurations = lib.mkOption {

View File

@@ -11,8 +11,6 @@
treefmt.programs.nixfmt.enable = true;
treefmt.programs.nixfmt.package = pkgs.nixfmt-rfc-style;
treefmt.programs.deadnix.enable = true;
treefmt.programs.sizelint.enable = true;
treefmt.programs.sizelint.failOnWarn = true;
treefmt.programs.clang-format.enable = true;
treefmt.settings.global.excludes = [
"*.png"
@@ -52,8 +50,6 @@
"checks/secrets/sops/groups/group/machines/machine"
"checks/syncthing/introducer/introducer_device_id"
"checks/syncthing/introducer/introducer_test_api"
"docs/site/static/asciinema-player/asciinema-player.css"
"docs/site/static/asciinema-player/asciinema-player.min.js"
"nixosModules/clanCore/vars/secret/sops/eval-tests/populated/vars/my_machine/my_generator/my_secret"
"pkgs/clan-cli/clan_cli/tests/data/gnupg.conf"
"pkgs/clan-cli/clan_cli/tests/data/password-store/.gpg-id"
@@ -94,9 +90,6 @@
"*.yaml"
"*.yml"
];
excludes = [
"*/asciinema-player/*"
];
};
treefmt.programs.mypy.directories = {
"clan-cli" = {

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