Compare commits

..

1086 Commits

Author SHA1 Message Date
Qubasa
45e8917679 Added demo.sh to prepare demo environment 2024-01-30 14:42:22 +07:00
Qubasa
c00e5b3df3 Demo version 2024-01-30 14:02:52 +07:00
clan-bot
4e30c4cfff Merge pull request 'URI: Fixed removed url fragment' (#775) from Qubasa-main into main 2024-01-30 06:31:29 +00:00
Qubasa
52f5c890cc URI: Fixed removed url fragment 2024-01-30 13:28:12 +07:00
clan-bot
170c461ba1 Merge pull request 'CLI: Added grouping output for clan history list.' (#774) from Qubasa-main into main 2024-01-30 05:43:02 +00:00
Qubasa
a50d0f1743 CLI: Added grouping output for clan history list. 2024-01-30 12:39:52 +07:00
clan-bot
541f8be7b7 Merge pull request 'Fixed clan uri. Expand user, then resolve' (#773) from Qubasa-main into main 2024-01-30 05:20:52 +00:00
Qubasa
119a05d999 Fixed clan uri. Expand user, then resolve 2024-01-30 12:17:24 +07:00
clan-bot
c7b9db8b49 Merge pull request 'clan-cli: implement waypipe backend' (#772) from Mic92-main into main 2024-01-30 03:42:07 +00:00
Jörg Thalheim
c417157941 clan-cli: implement waypipe backend 2024-01-30 10:37:52 +07:00
Jörg Thalheim
9fef40258a cmd: skip print for zero-length bufs 2024-01-30 10:30:25 +07:00
Jörg Thalheim
a3d92a766e clan-cli: drop unused variables 2024-01-30 10:30:25 +07:00
Jörg Thalheim
80a335eb4c drop unused unfree_nixpkgs function 2024-01-30 10:30:25 +07:00
clan-bot
846d2c0f44 Merge pull request 'syncthing: add inotify' (#771) from a-kenji-syncthing/add/initify into main 2024-01-29 10:26:55 +00:00
a-kenji
dc4e9d8dd7 syncthing: add inotify 2024-01-29 11:23:32 +01:00
clan-bot
02045c589d Merge pull request 'clan-cli machines: get flake path via flake metadata' (#770) from lassulus-flake_dir into main 2024-01-29 09:17:26 +00:00
lassulus
0366147235 clan-cli machines: get flake path via flake metadata 2024-01-29 09:54:30 +01:00
clan-bot
6b9f8b851e Merge pull request 'Revert "vm-state: fix and improve testing"' (#768) from DavHau-revert into main 2024-01-29 08:20:09 +00:00
DavHau
99092f6e76 Revert "vm-state: fix and improve testing"
This reverts commit 6adc68a354.
2024-01-29 15:16:10 +07:00
clan-bot
549a5800a5 Merge pull request 'Secret mgmt problem' (#767) from Qubasa-main into main 2024-01-29 08:15:44 +00:00
Qubasa
f6c811e531 UI: Display error logs on VM crash. Fixed inspect_vm problem. 2024-01-29 15:11:57 +07:00
clan-bot
7937f3eaae Merge pull request 'package vsock-enabled waypipe' (#766) from Mic92-main into main 2024-01-29 07:29:22 +00:00
Qubasa
155a1ee98c Secret mgmt problem 2024-01-29 14:00:38 +07:00
Jörg Thalheim
dc4634b8eb package vsock-enabled waypipe 2024-01-29 11:48:08 +07:00
clan-bot
65a2fc9b14 Merge pull request 'flake.lock: Update' (#764) from a-kenji-fix/update/nixpkgs into main 2024-01-29 04:31:36 +00:00
a-kenji
f3498f3609 flake.lock: Update
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/fa5db12d76f9e8ee11e572cdbe021230e48b6afa' (2024-01-11)
  → 'github:nix-community/disko/f67ba6552845ea5d7f596a24d57c33a8a9dc8de9' (2024-01-29)
• Updated input 'nixos-generators':
    'github:nix-community/nixos-generators/246219bc21b943c6f6812bb7744218ba0df08600' (2023-12-04)
  → 'github:nix-community/nixos-generators/896f6589db5b25023b812bbb6c1f5d3a499b1132' (2024-01-24)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/ada47602cea34540873ddf17e49c32b50fd70d2a' (2024-01-24)
  → 'github:NixOS/nixpkgs/50071d87c75300c037e28439c5176c3933b9fce5' (2024-01-28)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/c0b3a5af90fae3ba95645bbf85d2b64880addd76' (2024-01-10)
  → 'github:Mic92/sops-nix/73bf36912e31a6b21af6e0f39218e067283c67ef' (2024-01-28)
• Updated input 'treefmt-nix':
    'github:numtide/treefmt-nix/04f25d7bec9fb29d2c3bacaa48a3304840000d36' (2024-01-07)
  → 'github:numtide/treefmt-nix/c6153c2a3ff4c38d231e3ae99af29b87f1df5901' (2024-01-28)
2024-01-29 05:14:09 +01:00
clan-bot
a685dd1afe Merge pull request 'nix-direnv-watch-file -> watch-file' (#763) from Mic92-main into main 2024-01-29 04:11:13 +00:00
Jörg Thalheim
4a84d7da97 nix-direnv-watch-file -> watch-file 2024-01-29 11:02:43 +07:00
DavHau
6adc68a354 vm-state: fix and improve testing
Also adds qemu qga protocol implementation to execute commands
2024-01-26 19:41:05 +07:00
clan-bot
76c906c531 Merge pull request 'clan-cli secrets: generate secrets inside bubblewrap' (#761) from lassulus-bubblewrap into main 2024-01-24 18:23:31 +00:00
lassulus
3afed7a563 clan-cli secrets: generate secrets inside bubblewrap 2024-01-24 19:20:07 +01:00
clan-bot
a3ef8ce832 Merge pull request 'clan-cli secrets: add secret_store as python class' (#733) from lassulus-HEAD into main 2024-01-24 14:52:14 +00:00
lassulus
abaa218e27 clan-cli install: use new Machine interface, fix mypy error 2024-01-24 15:49:24 +01:00
lassulus
6ba641c974 clan-cli update: use new Machine class interface 2024-01-24 15:49:12 +01:00
lassulus
e1237499d0 clan-cli Machine: make deployment info lazy 2024-01-24 15:49:12 +01:00
lassulus
3284224440 clan-cli backups: use new machine class for eval 2024-01-24 15:49:12 +01:00
lassulus
9cf670ee29 test_vm_persistance: substitute clan-core repo 2024-01-24 15:49:12 +01:00
lassulus
6b004fca6f machines.Machine: refactor flake_dir -> flake; use Machine class in vm 2024-01-24 15:49:12 +01:00
lassulus
de885c3010 test_vm_persistance: add age keys 2024-01-24 15:49:12 +01:00
lassulus
ce5e6bfd10 secret generators: run with set -efu -o pipefail 2024-01-24 15:49:12 +01:00
lassulus
aee0ee4d5e move secret stores into clan_cli codebase 2024-01-24 15:49:12 +01:00
clan-bot
459dc0608b Merge pull request 'Fix zerotier in vms' (#759) from a-kenji-fix-zerotier-state-vm into main 2024-01-23 19:39:13 +00:00
a-kenji
f0895d5e3e fix zerotier in vms 2024-01-23 19:43:42 +01:00
Jörg Thalheim
8338944062 move python code in nixos Module to external file 2024-01-23 15:04:40 +01:00
lassulus
09887037f5 WIP: clan-cli secrets: add secret_store as python class 2024-01-23 15:04:40 +01:00
clan-bot
7b953fe7ab Merge pull request 'prepare details view' (#755) from hsjobeki-main into main 2024-01-21 11:48:36 +00:00
Johannes Kirschbauer
6b00957d38 prepare details view 2024-01-21 12:46:04 +01:00
clan-bot
9e6ffcd9f9 Merge pull request 'add search bar' (#754) from hsjobeki-main into main 2024-01-21 11:16:14 +00:00
Johannes Kirschbauer
035a9f2358 add search bar 2024-01-21 12:13:15 +01:00
clan-bot
c5aef543b2 Merge pull request 'add join to list' (#753) from hsjobeki-main into main 2024-01-20 13:54:22 +00:00
Johannes Kirschbauer
7ac0292cdd display id as subtitle 2024-01-20 14:51:37 +01:00
clan-bot
c98fdc08de Merge pull request 'add join to list' (#752) from hsjobeki-main into main 2024-01-20 12:21:23 +00:00
Johannes Kirschbauer
d0b075c217 add join to list 2024-01-20 13:18:43 +01:00
clan-bot
3be697d1e9 Merge pull request 'organize files and classes consistently' (#751) from hsjobeki-main into main 2024-01-20 09:15:48 +00:00
Johannes Kirschbauer
cd2125074f organize files and classes consistently 2024-01-20 10:12:37 +01:00
clan-bot
ceebfccc82 Merge pull request 'UI: Added signal handling for stopped and started vm.' (#750) from Qubasa-main into main 2024-01-19 17:58:10 +00:00
Qubasa
70cf75830d Remove error from qemu_command 2024-01-19 18:54:54 +01:00
Qubasa
d956dbeb77 UI: Added signal handling for stopped and started vm. 2024-01-19 18:52:51 +01:00
clan-bot
0c167d1e51 Merge pull request 'localsend: add notes about future integrations' (#749) from a-kenji-localsend-notes into main 2024-01-19 16:02:42 +00:00
a-kenji
df574b0dcc localsend: add notes about future integrations 2024-01-19 16:59:32 +01:00
clan-bot
e9d3a71dbb Merge pull request 'Otherwise we loose our build inputs' (#747) from Mic92-main into main 2024-01-19 14:05:51 +00:00
Jörg Thalheim
3271e4b6b6 don't garbage collect in nix vm tests
Otherwise we loose our build inputs
2024-01-19 15:02:25 +01:00
clan-bot
a1f8690978 Merge pull request 'Improved error messages in clan_cli' (#746) from Qubasa-main into main 2024-01-19 13:13:46 +00:00
Qubasa
2da236b362 Improved error messages in clan_cli 2024-01-19 14:10:22 +01:00
clan-bot
a23bdaa0a1 Merge pull request 'Wrapped vm.run in cmd.run. Working --wayland' (#745) from Qubasa-main into main 2024-01-19 13:00:04 +00:00
Qubasa
60c4d231f8 Wrapped vm.run in cmd.run. Working --wayland 2024-01-19 13:56:17 +01:00
Mic92
26259341d4 Merge pull request 'build-clan: force system override in secrets generators' (#744) from Mic92-main into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/744
2024-01-17 14:40:46 +00:00
Jörg Thalheim
4a3abf5fe9 build-clan: force system override in secrets generators 2024-01-17 14:40:46 +00:00
clan-bot
3bd33844c6 Merge pull request 'build-clan: don't set system with lib.mkForce' (#743) from Mic92-main into main 2024-01-17 14:28:27 +00:00
Jörg Thalheim
fb151b227d build-clan: don't set system with lib.mkForce 2024-01-17 15:25:29 +01:00
Johannes Kirschbauer
2d613e3933 Gtk4 migration (#693)
Co-authored-by: Qubasa <consulting@qube.email>
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/693
Co-authored-by: Johannes Kirschbauer <hsjobeki@gmail.com>
Co-committed-by: Johannes Kirschbauer <hsjobeki@gmail.com>
2024-01-17 12:11:49 +00:00
clan-bot
ae1745289d Merge pull request 'clanModules: init localsend module' (#741) from a-kenji-init/localsend into main 2024-01-17 10:25:29 +00:00
a-kenji
c94d2325ae clanModules: init localsend module 2024-01-17 11:12:09 +01:00
clan-bot
bd5ad0dc31 Merge pull request 'disable state home for now' (#740) from Mic92-main into main 2024-01-17 10:03:48 +00:00
Jörg Thalheim
1d2f003210 use upstream qemu for wayland feature 2024-01-17 11:00:45 +01:00
Jörg Thalheim
776b238d9c disable state home for now 2024-01-17 10:59:01 +01:00
clan-bot
5ce7819229 Merge pull request 'bump nixpkgs' (#739) from Mic92-main into main 2024-01-17 09:53:36 +00:00
Jörg Thalheim
7105ab1124 bump nixpkgs 2024-01-17 10:45:49 +01:00
clan-bot
de65c4062a Merge pull request 'docs: categorize via sub-directories for inclusion in website' (#738) from DavHau-main into main 2024-01-17 06:55:51 +00:00
DavHau
a610db7192 docs: categorize via sub-directories for inclusion in website 2024-01-17 13:53:24 +07:00
clan-bot
0b291c656f Merge pull request 'state.nix: improve docs' (#732) from DavHau-main into main 2024-01-17 06:51:55 +00:00
clan-bot
312e8b2bc6 Merge pull request 'URI: Added support for #flake_attr' (#736) from Qubasa-main into main 2024-01-16 16:14:37 +00:00
Qubasa
f1acc44488 URI: Added support for #flake_attr 2024-01-16 17:11:26 +01:00
clan-bot
4a3a585e7c Merge pull request 'CLI: History supports multiple attrs from the same url now. Errors when executing the cli are formatted better' (#735) from Qubasa-main into main 2024-01-16 15:19:10 +00:00
Qubasa
d20f47ad5b CLI: History supports multiple attrs from the same url now. Errors when executing the cli are formatted better 2024-01-16 16:16:12 +01:00
clan-bot
1c7e806bca Merge pull request 'clanModules: disable nixos manual by default' (#734) from a-kenji-disable-manual into main 2024-01-16 14:21:23 +00:00
a-kenji
98e1c629c3 clanModules: disable nixos manual by default 2024-01-16 15:14:16 +01:00
DavHau
c944fe8b48 state.nix: improve docs 2024-01-15 16:03:47 +07:00
clan-bot
07a0e1db09 Merge pull request 'add option to orbit moons' (#729) from Mic92-zerotier into main 2024-01-12 17:34:09 +00:00
Jörg Thalheim
876ffab3b1 add option to orbit moons 2024-01-12 18:31:18 +01:00
clan-bot
00876e2311 Merge pull request 'zerotier: add support for moons' (#728) from Mic92-zerotier into main 2024-01-12 17:28:42 +00:00
Jörg Thalheim
b1bb887dbf zerotier: add support for moons 2024-01-12 18:26:00 +01:00
clan-bot
50344b4937 Merge pull request 'cmd.py refactor part 7' (#727) from Qubasa-main into main 2024-01-12 16:41:21 +00:00
Qubasa
abfa2f218c cmd.py refactor part 7 2024-01-12 17:37:59 +01:00
clan-bot
c345c4c0ce Merge pull request 'cmd.py refactor part 6' (#726) from Qubasa-main into main 2024-01-12 16:25:16 +00:00
Qubasa
0c1d4a1d41 cmd.py refactor part 6 2024-01-12 17:21:48 +01:00
Qubasa
1a6983e031 cmd.py refactor part 6 2024-01-12 17:02:56 +01:00
clan-bot
6455b128a3 Merge pull request 'cmd.py refactor part 5' (#724) from Qubasa-main into main 2024-01-12 15:55:46 +00:00
Qubasa
ca5cc389ac cmd.py refactor part 5 2024-01-12 16:52:34 +01:00
clan-bot
969c79b426 Merge pull request 'Fixed duplicate logging issue with correct logging in ssh and in root logger' (#723) from Qubasa-main into main 2024-01-12 15:49:52 +00:00
Qubasa
2c2e4862ba Fixed duplicate logging issue with correct logging in ssh and in root logger 2024-01-12 16:46:44 +01:00
Jörg Thalheim
e2cc218aa6 add moonlight module 2024-01-12 16:02:24 +01:00
clan-bot
304dce0caa Merge pull request 'zerotier: configure alternative tcp fallback relay' (#721) from Mic92-HEAD into main 2024-01-12 14:15:54 +00:00
Jörg Thalheim
e941334ecf zerotier: configure alternative tcp fallback relay 2024-01-12 15:13:20 +01:00
clan-bot
30c7d61bbd Merge pull request 'revert logger changes in f7c6ab5888c5763c1ec5e4326f452946d915b1f6' (#720) from Mic92-HEAD into main 2024-01-12 13:52:27 +00:00
Jörg Thalheim
47f4ef2c31 revert logger changes in f7c6ab5888
This adds another logger to the logger in clan_cli.ssh which we do not want
2024-01-12 14:48:36 +01:00
clan-bot
25634a044b Merge pull request 'zt-tcp-relay: add clan module + test' (#719) from Mic92-HEAD into main 2024-01-12 13:27:52 +00:00
Jörg Thalheim
78cd5b3fec zt-tcp-relay: add clan module + test 2024-01-12 14:25:31 +01:00
clan-bot
50b757ab1d Merge pull request 'zt-tcp-relay: init at 2023-07-11' (#718) from Mic92-HEAD into main 2024-01-12 12:53:09 +00:00
Jörg Thalheim
e1729a0991 zt-tcp-relay: init at 2023-07-11 2024-01-12 13:49:36 +01:00
clan-bot
773630a9b9 Merge pull request 'drop qemu-rutabaga patches' (#717) from Mic92-HEAD into main 2024-01-12 11:27:07 +00:00
Jörg Thalheim
c86e465e35 drop qemu-rutabaga patches 2024-01-12 12:20:29 +01:00
clan-bot
1cdc2b8ed2 Merge pull request 'cmd: add a timeout in select' (#716) from Mic92-HEAD into main 2024-01-11 23:23:57 +00:00
Jörg Thalheim
796ef76893 cmd: add a timeout in select 2024-01-12 00:20:22 +01:00
clan-bot
a29f83de0f Merge pull request 'Re-added rlist.remove to counter busy loop' (#715) from Qubasa-main into main 2024-01-11 23:16:51 +00:00
Qubasa
05aaa180e0 cmd.py: Fix busy loop. 2024-01-12 00:13:21 +01:00
Qubasa
1d489438bd Re-added rlist.remove to counter busy loop 2024-01-12 00:08:15 +01:00
clan-bot
0c6dd1f042 Merge pull request 'cmd.py: Fix deadlock because of incorrect select usage' (#714) from Qubasa-main into main 2024-01-11 22:06:29 +00:00
Qubasa
0941367bb3 cmd.py: Fix deadlock because of incorrect select usage 2024-01-11 23:03:14 +01:00
clan-bot
c5b914594a Merge pull request 'Removed duplicate logging messages' (#713) from Qubasa-main into main 2024-01-11 21:49:30 +00:00
Qubasa
3351f87a7f Removed duplicate logging messages 2024-01-11 22:46:29 +01:00
clan-bot
04b579f2d3 Merge pull request 'cmd.py refactor part 4' (#707) from Qubasa-main into main 2024-01-11 21:31:42 +00:00
Qubasa
d1ca0eaf80 Identified deadlocking funciton 2024-01-11 22:28:35 +01:00
Qubasa
4d4c09da80 Enabled logging DEBUG in pytest 2024-01-11 22:14:55 +01:00
Qubasa
f7c6ab5888 Working test_secrets_generate 2024-01-11 21:48:39 +01:00
Qubasa
16b043f508 cmd.py: Fixing bug: missing output because of forgotten flush() call 2024-01-11 21:11:49 +01:00
Qubasa
0133ccd5f7 Fixed missing log.BOTH and error_msg at prev refactors 2024-01-11 21:11:49 +01:00
Qubasa
2ae439ec52 cmd.py refactor part 4 2024-01-11 21:11:49 +01:00
clan-bot
0d9f0c3ec1 Merge pull request 'make zerotier name configureable' (#711) from Mic92-zerotier into main 2024-01-11 17:05:54 +00:00
Jörg Thalheim
72409a800a schema-check: set clanName dummy 2024-01-11 18:02:50 +01:00
Jörg Thalheim
8d63bb8fd1 drop deadcode 2024-01-11 18:00:42 +01:00
Jörg Thalheim
32ec520fa5 drop runSchemaTests/runMockApi from checks 2024-01-11 17:53:06 +01:00
Jörg Thalheim
f6b6229f78 schema: set also clanName
this is usually set by buildClan
2024-01-11 17:41:41 +01:00
Jörg Thalheim
cedd1d7492 zerotier: set interface altname 2024-01-11 15:51:34 +01:00
clan-bot
0429291d40 Merge pull request 'zerotier-members: add ipv6 to list display' (#712) from lassulus-zerotier-list into main 2024-01-11 14:49:28 +00:00
lassulus
2b75cc4744 zerotier-members: add ipv6 to list display 2024-01-11 15:46:26 +01:00
Jörg Thalheim
7bf76eea06 zerotier: use configuration file instead to set the network name 2024-01-11 14:57:00 +01:00
Jörg Thalheim
0e62348d72 make zerotier name configureable 2024-01-11 14:57:00 +01:00
clan-bot
398cda65a1 Merge pull request 'zerotier: delete old networks' (#709) from Mic92-zerotier into main 2024-01-11 12:29:09 +00:00
Jörg Thalheim
3563b6eaa4 zerotier: delete old networks 2024-01-11 13:24:00 +01:00
Mic92
1e9032b635 Merge pull request 'meshnamed: mark networkmanager interfaces as unmanaged' (#708) from zerotier into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/708
2024-01-11 11:47:59 +00:00
Jörg Thalheim
a5132a4f81 meshnamed: mark networkmanager interfaces as unmanaged 2024-01-11 12:17:44 +01:00
clan-bot
93fa4e397b Merge pull request 'cmd.py part 3 refactor' (#706) from Qubasa-main into main 2024-01-10 17:57:51 +00:00
Qubasa
359275eee7 Improved error message. Fixed incorrect ret code check in git.py 2024-01-10 18:54:34 +01:00
Qubasa
64846eb395 Fixed bug, where exception is raised where there shouldn't be raised one 2024-01-10 18:46:54 +01:00
Qubasa
b36d0be524 cmd.py part 3 refactor 2024-01-10 18:39:19 +01:00
Mic92
14f83efcc9 Merge pull request 'open up zerotier ports' (#705) from Mic92-wayland-update into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/705
2024-01-10 17:24:41 +00:00
Jörg Thalheim
7a4b176248 open up zerotier ports 2024-01-10 17:24:41 +00:00
clan-bot
46da9eb5db Merge pull request 'Added ClanCmdError. cmd.run now returns this error' (#704) from Qubasa-main into main 2024-01-10 17:02:08 +00:00
Qubasa
699515ca89 Added ClanCmdError. cmd.run now returns this error 2024-01-10 17:58:39 +01:00
clan-bot
f34df3df02 Merge pull request 'Refactor subprocess to cmd.py part 2' (#685) from Qubasa-main into main 2024-01-10 16:34:38 +00:00
Qubasa
626e5558f3 Fix cmd to default print on all outputs. Default print on stderr 2024-01-10 17:31:11 +01:00
Qubasa
c41bc10325 nix fmt 2024-01-10 17:19:33 +01:00
Qubasa
54f2eba1cc nix fmt 2024-01-10 17:19:12 +01:00
Qubasa
40beda884c Updated cmd.py with Mic92 changes to fit previous changes 2024-01-10 17:18:21 +01:00
clan-bot
0b2439553c Merge pull request 're-anble pulseaudio in qemu' (#703) from Mic92-wayland-update into main 2024-01-10 14:36:25 +00:00
Mic92
b9613c4801 Merge branch 'main' into Mic92-wayland-update 2024-01-10 14:33:55 +00:00
Jörg Thalheim
eeac4902ab re-anble pulseaudio in qemu 2024-01-10 15:32:37 +01:00
Qubasa
ba05589af2 Refactor subprocess to cmd.py part 2 2024-01-10 12:11:29 +01:00
clan-bot
4a69912667 Merge pull request 'state: declare /home as state by default' (#702) from DavHau-main into main 2024-01-10 10:40:36 +00:00
DavHau
414f475802 state: declare /home as state by default 2024-01-10 17:37:40 +07:00
clan-bot
7266faab4e Merge pull request 'state: move options clanCore.state to a separate file' (#701) from DavHau-main into main 2024-01-10 10:13:13 +00:00
DavHau
9f8e719b48 state: move options clanCore.state to a separate file 2024-01-10 17:10:10 +07:00
clan-bot
26e9463248 Merge pull request 'cmd: rework redirecting stdout/stderr' (#700) from Mic92-wayland-update into main 2024-01-09 16:39:19 +00:00
Jörg Thalheim
fa00bb522b cmd: rework redirecting stdout/stderr 2024-01-09 17:34:43 +01:00
clan-bot
7e1be41843 Merge pull request 'VMs: ensure state dirs don't collide between clans' (#699) from DavHau-main into main 2024-01-09 10:25:39 +00:00
DavHau
520ff0b334 VMs: ensure state dirs don't collide between clans 2024-01-09 17:22:48 +07:00
clan-bot
2566fccfcf Merge pull request 'VMs: port vm_persistence test to python' (#698) from DavHau-main into main 2024-01-09 07:50:31 +00:00
DavHau
17390fc392 VMs: port vm_persistence test to python 2024-01-09 14:47:33 +07:00
clan-bot
b272eebc75 Merge pull request 'zerotier-members: print authorized state on list' (#697) from lassulus-member_list_auth into main 2024-01-08 21:32:00 +00:00
lassulus
c73818c1a5 zerotier-members: print authorized state on list 2024-01-08 22:28:13 +01:00
clan-bot
df5e6761e6 Merge pull request 'VMs: persist state folders on host' (#696) from DavHau-main into main 2024-01-08 11:42:19 +00:00
DavHau
c29e0086a4 VMs: persist state folders on host
Done:
- move vm inspect attrs from system.clan.vm.config to clanCore.vm.inspect. This gives us proper name and type checking. everything in `system` is basically freeform, so the previous option definitions were never enforced
- when running VMs, mount state directory from ~/.config/clan/vmstate/{...} from the host to /var/vmstate inside the vm
- create bind mount inside the VM from /var/vmstate/{folder} to / for all folders defined in clanCore.state.<name>.folders

TODOs:
- make sure directories in ~/.config/clan/vmstate never collide (include hash of clan-url, etc.)
- port impure test to python
2024-01-08 18:38:07 +07:00
clan-bot
4123944732 Merge pull request 'move selected_vm to the ClanListToolbar constructor' (#690) from Mic92-wayland-update into main 2024-01-04 17:53:02 +00:00
clan-bot
96e2deee1f Merge pull request 'Update start/stop button based on VM state' (#689) from Mic92-wayland-update into main 2024-01-04 17:50:25 +00:00
Jörg Thalheim
a5137efd48 move selected_vm to the ClanListToolbar constructor 2024-01-04 18:50:21 +01:00
Jörg Thalheim
c7fda31ab3 Update start/stop button based on VM state 2024-01-04 18:47:52 +01:00
Jörg Thalheim
738aaa3b5d executor: simplify running_procs 2024-01-04 18:42:13 +01:00
clan-bot
2da5b4a0ff Merge pull request 'reduce number of eval workers' (#688) from Mic92-wayland-update into main 2024-01-04 16:21:16 +00:00
clan-bot
dbfbbf8670 Merge pull request 'clan-vm-manager: make joining clan url more logical' (#687) from Mic92-wayland-update into main 2024-01-04 16:18:29 +00:00
Jörg Thalheim
4fc48f38d5 reduce number of eval workers 2024-01-04 17:18:10 +01:00
Jörg Thalheim
6a75ea56fd clan-vm-manager: make joining clan url more logical
The icon is confusing. It distracts from the actual "Join" label. Also when a user
copy in an URL we can assume they trust the content, which might be not the case
when they just clicked on an URL.
2024-01-04 17:08:01 +01:00
Jörg Thalheim
093566aa42 clan-vm-manager: rename "New" to "Join Clan" 2024-01-04 16:50:19 +01:00
Jörg Thalheim
d18c2063c3 clan-vm-manager: rename "Online" to "Status"
online means connected to some network, which is not what this field shows.
2024-01-04 16:49:21 +01:00
clan-bot
bd07d59707 Merge pull request 'strip whitespace from clan uris' (#686) from Mic92-wayland-update into main 2024-01-04 15:34:10 +00:00
clan-bot
d803cec108 Merge pull request 'switch to xwayland display :1' (#683) from Mic92-wayland-update into main 2024-01-04 15:31:10 +00:00
Jörg Thalheim
f9dd2e0926 strip whitespace from clan uris 2024-01-04 16:30:26 +01:00
Jörg Thalheim
7f21e99736 update nix-direnv 2024-01-04 16:24:26 +01:00
Jörg Thalheim
0922856fa5 switch to xwayland display :1
no conflict with Xorg
2024-01-04 16:18:27 +01:00
clan-bot
f526e1261f Merge pull request 'Fix broken executor.py' (#684) from Qubasa-main into main 2024-01-03 12:42:03 +00:00
Qubasa
ae00b3ae65 Fix broken executor.py 2024-01-03 13:26:25 +01:00
clan-bot
8870351737 Merge pull request 'clan_uri: Support all other formats by just differentiating between remote and local' (#680) from Qubasa-main into main 2024-01-02 16:24:51 +00:00
Qubasa
e4a7f68b0e Fixed cmd.py writing to stderr 2024-01-02 17:21:06 +01:00
Qubasa
3f55c688d9 Refactor subprocess to cmd.py part 1. Fixed clan_uri test. 2024-01-02 17:21:06 +01:00
Qubasa
69d08241e9 delete unecessary f.truncate 2024-01-02 17:21:06 +01:00
Qubasa
ef827af89c Fixed unsafe dirs.py urlquoting, improved cmd.py run func 2024-01-02 17:21:06 +01:00
Qubasa
7c5ed85231 clan_uri: Support all other formats by just differentiating between remote and local 2024-01-02 17:21:05 +01:00
clan-bot
4383fab8d7 Merge pull request 'Executor: drop unused in_file' (#682) from Mic92-wayland-update into main 2024-01-02 14:46:25 +00:00
Jörg Thalheim
d0b165b311 only set process title on Linux
the systemcall is not portable
2024-01-02 15:44:28 +01:00
Jörg Thalheim
c609d84273 Executor: drop unused in_file 2024-01-02 15:44:28 +01:00
clan-bot
7e662b7655 Merge pull request 'drop references to debug.py' (#681) from Mic92-wayland-update into main 2024-01-02 14:26:02 +00:00
Jörg Thalheim
0ecfaa96cf drop references to debug.py 2024-01-02 15:22:36 +01:00
clan-bot
c1e449e055 Merge pull request 'Automatic flake update - 2024-01-01T00:00+00:00' (#670) from flake-update-2024-01-01 into main 2024-01-02 14:14:59 +00:00
clan-bot
91633df0c8 Merge pull request 'fix: join workflow' (#677) from hsjobeki-main into main 2024-01-02 09:05:41 +00:00
Johannes Kirschbauer
0676d93e4b rebase 2024-01-02 10:02:25 +01:00
clan-bot
d6fe6b1d69 Merge pull request 'dirs.py: remove outdated comment' (#676) from DavHau-main into main 2024-01-02 07:29:05 +00:00
DavHau
e7bd86a9d5 dirs.py: remove outdated comment 2024-01-02 14:25:37 +07:00
clan-bot
3914d61008 Merge pull request 'vm-manager: More error handling' (#675) from Qubasa-main into main 2024-01-02 06:27:30 +00:00
Qubasa
7be42146e7 vm-manager: Added right click context menu 2024-01-02 07:24:30 +01:00
Qubasa
01977b2e2a vm-manager: More error handling 2024-01-02 06:23:55 +01:00
clan-bot
1fc524e53e Merge pull request 'Added show_error_dialogue on exception' (#674) from Qubasa-main into main 2024-01-02 04:57:05 +00:00
Qubasa
c157ecb161 Added show_error_dialogue on exception 2024-01-02 05:54:19 +01:00
clan-bot
6f6fe1c5d4 Merge pull request 'Removed unecessary debug.py and test code' (#672) from Qubasa-main into main 2024-01-01 18:01:16 +00:00
Qubasa
9ec1d594e7 Removed unecessary debug.py and test code 2024-01-01 18:58:12 +01:00
clan-bot
2423597f4e Merge pull request 'history: added vm config to FlakeConfig' (#671) from Qubasa-origin/Qubasa-main-no-flake-update into main 2024-01-01 17:27:48 +00:00
Qubasa
42235e39be Added settings attribute to history file 2024-01-01 18:24:40 +01:00
Clan Merge Bot
7a7954278c update flake lock - 2024-01-01T00:00+00:00
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/1144887c6f4d2dcbb2316a24364ef53e25b0fcfe' (2023-12-06)
  → 'github:nix-community/disko/0ce1b15b99ac7c280384f136eae00b968f5b3f72' (2023-12-28)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/1f8d62a69936dd899d0e7c955537b2f4ca5bc623' (2023-12-10)
  → 'github:NixOS/nixpkgs/eae82ed71467a19374437376fbb7f5e3ad486aeb' (2023-12-31)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/d806e546f96c88cd9f7d91c1c19ebc99ba6277d9' (2023-12-10)
  → 'github:Mic92/sops-nix/cfdbaf68d00bc2f9e071f17ae77be4b27ff72fa6' (2023-12-31)
• Updated input 'treefmt-nix':
    'github:numtide/treefmt-nix/afdd5e48a0869b389027307652a658051c0d2f96' (2023-12-10)
  → 'github:numtide/treefmt-nix/2961375283668d867e64129c22af532de8e77734' (2023-12-19)
2024-01-01 00:00:16 +00:00
Qubasa
7069d746ad Added write and read history file functions 2023-12-31 15:17:12 +01:00
Qubasa
e0bba046ea history: added vm config to FlakeConfig 2023-12-31 14:56:03 +01:00
clan-bot
9649e43da5 Merge pull request 'vm-manager: Fixed quit application not working bug' (#668) from Qubasa-main into main 2023-12-31 13:16:16 +00:00
Qubasa
f1642c6c71 vm-manager: Fixed quit application not working bug 2023-12-31 14:13:11 +01:00
clan-bot
ae41eb3ff5 Merge pull request 'cli: fixed run vm not working with url' (#667) from Qubasa-main into main 2023-12-31 13:00:03 +00:00
Qubasa
33afa04b38 cli: fixed run vm not working with url 2023-12-31 13:56:55 +01:00
clan-bot
e247225f6d Merge pull request 'cli: Switched b64 encoding of gcroot names to urlparse' (#666) from Qubasa-main into main 2023-12-31 12:54:29 +00:00
Qubasa
fcadaca010 cli: Switched b64 encoding of gcroot names to urlparse 2023-12-31 13:51:13 +01:00
clan-bot
2db632f1d2 Merge pull request 'Removed unused ui-assets workflow file.' (#665) from Qubasa-main into main 2023-12-30 23:53:14 +00:00
Qubasa
c4799f1e9a Added gcroot for clan Icon and VM 2023-12-31 00:49:57 +01:00
Qubasa
ffea26f1c7 Removed unused ui-assets workflow file. 2023-12-30 23:14:32 +01:00
clan-bot
c05d6f8e35 Merge pull request 'Removed python deal.' (#664) from Qubasa-main into main 2023-12-30 22:13:48 +00:00
Qubasa
330ef00a7c Removed python deal. 2023-12-30 23:10:43 +01:00
clan-bot
b6b0ca7aa0 Merge pull request 'dialog prepare flash usb window' (#663) from hsjobeki-main into main 2023-12-30 10:17:34 +00:00
Johannes Kirschbauer
36e7488da1 prepare flash usb window 2023-12-30 11:14:45 +01:00
clan-bot
269063f868 Merge pull request 'new clan; Join page with none as initial value' (#662) from hsjobeki-main into main 2023-12-30 09:47:01 +00:00
Johannes Kirschbauer
d39d3a9a45 error handling. add: dialog 2023-12-30 10:43:03 +01:00
Johannes Kirschbauer
f5b578d0c7 error handling. add: dialog 2023-12-30 10:41:33 +01:00
clan-bot
a8230e749e Merge pull request 'new clan; Join page with none as initial value' (#661) from hsjobeki-main into main 2023-12-28 13:34:30 +00:00
Johannes Kirschbauer
968adf24b2 new clan; Join page with none as initial value 2023-12-28 14:30:58 +01:00
clan-bot
98020847d4 Merge pull request 'UI: Added process executor. Display vm status correctly in list. | CLI: Added get_qemu_version(), fixed virtio audio bug.' (#660) from Qubasa-main into main 2023-12-26 17:23:35 +00:00
Qubasa
cb06353451 pytest: Removed -s flag for CI 2023-12-26 18:20:41 +01:00
Qubasa
ca265b0c59 UI: Added process executor. Display vm status correctly in list. | CLI: Added get_qemu_version(), fixed virtio audio bug. 2023-12-26 18:02:43 +01:00
clan-bot
4d8c20f284 Merge pull request 'cli/install: add option to specify alternative kexec url' (#659) from Mic92-wayland-update into main 2023-12-26 13:40:29 +00:00
Jörg Thalheim
ed643e3829 cli/install: add option to specify alternative kexec url 2023-12-26 14:36:51 +01:00
clan-bot
d73b04bdfa Merge pull request 'qemu-wayland: upgrade to latest 8.2.0 & enable virtio-audio' (#657) from Mic92-wayland-update into main 2023-12-21 14:54:23 +00:00
Jörg Thalheim
55f91079c7 rutabaga_gfx_ffi: unstable-2023-12-05 -> unstable-2023-12-20 2023-12-21 15:46:31 +01:00
Jörg Thalheim
b6ecb0b2e2 gfxstream: unstable-2023-12-11 -> unstable-2023-12-19 2023-12-21 15:41:57 +01:00
Jörg Thalheim
fe60a1a381 aemu: unstable-2023-11-10 -> unstable-2023-08-31 2023-12-21 15:41:21 +01:00
Jörg Thalheim
df9aa4ccb2 qemu-wayland: upgrade to latest 8.2.0 2023-12-21 15:40:50 +01:00
Jörg Thalheim
de38ce47ee switch to virtio-audio 2023-12-21 15:39:27 +01:00
clan-bot
30e7e06f59 Merge pull request 'clan_vm_manager: Partially working process executor with killpg' (#656) from Qubasa-main into main 2023-12-19 17:05:21 +00:00
Qubasa
a1575ec19c nix fmt 2023-12-19 18:02:06 +01:00
Qubasa
e0e7324876 Improved spawn interface. Added garbage collector 2023-12-19 17:51:43 +01:00
Qubasa
9d877969c9 Fully working executor 2023-12-19 16:44:36 +01:00
Qubasa
baaa860e63 Added proc executor 2023-12-19 16:44:36 +01:00
Qubasa
57bbe19c1a merge 2023-12-19 16:44:36 +01:00
Qubasa
0c33d14ba5 clan_vm_manager: Partially working process executor with killpg 2023-12-19 16:44:36 +01:00
clan-bot
2d71bfbd20 Merge pull request 'modules/syncthing: use generator path' (#655) from a-kenji-syncthing-add-path into main 2023-12-19 13:17:34 +00:00
a-kenji
6cd3a8e58f modules/syncthing: use generator path 2023-12-19 14:14:29 +01:00
clan-bot
fdba3f0c48 Merge pull request 'join window' (#654) from hsjobeki-main into main 2023-12-19 12:58:04 +00:00
Johannes Kirschbauer
784317eb69 join window 2023-12-19 13:39:22 +01:00
clan-bot
284bec3299 Merge pull request 'add installer test' (#653) from lassulus-ssh_test into main 2023-12-18 22:46:18 +00:00
lassulus
142fe15e80 checks: add test-installation 2023-12-18 23:41:31 +01:00
lassulus
bbc55743a6 checks backups: remove debug output 2023-12-18 23:41:31 +01:00
lassulus
a4075510c8 flake: define option for clanInternals
We need this to define test machines in different flake modules
2023-12-18 23:41:31 +01:00
clan-bot
7ff884cd71 Merge pull request 'checks: move ssh_keys to lib/ssh' (#651) from lassulus-ssh_test into main 2023-12-16 21:53:57 +00:00
lassulus
ae6f3fa7d7 checks: move ssh_keys to lib/ssh 2023-12-16 22:52:18 +01:00
clan-bot
1eec814e4e Merge pull request 'checks: add backup test' (#650) from lassulus-backups_test into main 2023-12-16 21:04:06 +00:00
lassulus
cc3701f22f checks backup: limit to linux systems 2023-12-16 22:02:36 +01:00
lassulus
e98f037dd8 clan_cli: remove incorrect clan_flake check 2023-12-16 21:46:19 +01:00
lassulus
56dafff109 machines build_machine_data: raise ClanError on error 2023-12-16 21:46:19 +01:00
lassulus
902ccbc90b backups borgbackup: remove dry-run from restore 2023-12-16 21:46:19 +01:00
lassulus
5c1cf947ab checks: add backup test 2023-12-16 21:46:19 +01:00
clan-bot
d74080f4c7 Merge pull request 'multi window mess' (#649) from hsjobeki-main into main 2023-12-16 14:02:16 +00:00
Johannes Kirschbauer
32f17783dd add debugging help 2023-12-16 15:00:43 +01:00
clan-bot
218e49770e Merge pull request 'multi window mess' (#648) from hsjobeki-main into main 2023-12-16 13:57:52 +00:00
Johannes Kirschbauer
efc7df3aa7 move list hook 2023-12-16 14:56:20 +01:00
Johannes Kirschbauer
dfe5c250b3 multi window mess 2023-12-16 14:49:45 +01:00
clan-bot
a12fdabf8f Merge pull request 'window switcher' (#647) from hsjobeki-main into main 2023-12-16 12:06:56 +00:00
Johannes Kirschbauer
09cf4a9ff4 fix formatting 2023-12-16 13:05:17 +01:00
Johannes Kirschbauer
e7fa998241 fix typing 2023-12-16 13:04:50 +01:00
Johannes Kirschbauer
89165cc65e format 2023-12-16 13:03:10 +01:00
Johannes Kirschbauer
d60cfbc0a6 window switcher 2023-12-16 12:52:10 +01:00
clan-bot
590d39a29b Merge pull request 'Automatic flake update - 2023-12-11T00:00+00:00' (#637) from flake-update-2023-12-11 into main 2023-12-15 13:18:21 +00:00
clan-bot
a7d48fefb0 Merge pull request 'add wayland-proxy-virtwl module' (#646) from Mic92-wayland-update into main 2023-12-15 13:15:59 +00:00
Jörg Thalheim
9dfc3f9613 add wayland-proxy-virtwl module 2023-12-15 14:14:20 +01:00
Jörg Thalheim
8ee72ba5fa clanCore: refactor flake-module.nix into smaller files 2023-12-15 14:14:20 +01:00
clan-bot
fbea4dcaf1 Merge pull request 'use nix-unit from nixpkgs, drop floco from flake inputs' (#645) from Mic92-wayland-update into main 2023-12-15 11:37:43 +00:00
Jörg Thalheim
963533e6c1 add wayland-proxy-virtwl fork 2023-12-15 12:36:07 +01:00
Jörg Thalheim
bd7cbb331f drop floco from flake inputs 2023-12-15 12:36:07 +01:00
Jörg Thalheim
0bdf55b09f use nix-unit from nixpkgs 2023-12-15 12:36:07 +01:00
clan-bot
ad5559974c Merge pull request 'qemu-wayland: add patch to fix vulkaninfo' (#644) from Mic92-wayland-update into main 2023-12-15 11:16:38 +00:00
Jörg Thalheim
9caf9a131e qemu-wayland: add patch to fix vulkaninfo 2023-12-15 12:12:46 +01:00
clan-bot
b7bda330b3 Merge pull request 'fixed history allowing adding the same clan twice' (#643) from Qubasa-main into main 2023-12-14 19:59:14 +00:00
Qubasa
5c143bf2da Finished clan history command. Ported remaining async to sync funcs 2023-12-14 20:57:31 +01:00
Qubasa
962a5641b4 fixed history allowing adding the same clan twice 2023-12-14 18:54:00 +01:00
clan-bot
cf899cbee9 Merge pull request 'Moved history to own subcommand' (#638) from Qubasa-main into main 2023-12-14 17:48:32 +00:00
Qubasa
7dc2c21517 Deleted everything webui 2023-12-14 18:47:14 +01:00
Qubasa
1a36ef242f Fixed failing tests in machines and history cli, removed test_machines_api.py 2023-12-14 18:25:42 +01:00
Qubasa
e139628fbd Improved ClanURI 2023-12-14 18:21:10 +01:00
Qubasa
c90053834a Reworked machines list, and history commands 2023-12-14 18:21:10 +01:00
Qubasa
9d952ba534 Fixed pytest 2023-12-14 18:21:10 +01:00
Qubasa
a1ebe663ce Fixing pytest 2023-12-14 18:21:10 +01:00
Qubasa
b00f4554d8 Improved history command 2023-12-14 18:21:10 +01:00
Qubasa
771c0e43ca Moved history to own subcommand 2023-12-14 18:21:10 +01:00
clan-bot
87a8f5518b Merge pull request 'vms/run: remove superfluous command' (#642) from a-kenji-refactor-run into main 2023-12-14 14:54:08 +00:00
a-kenji
8e84f7997a vms/run: remove superfluous command 2023-12-14 15:45:45 +01:00
kenji
d678c3ac14 Merge pull request 'vms/run: fix virtual machines spawning multiple windows' (#641) from vms-fix-run into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/641
2023-12-14 12:01:47 +00:00
a-kenji
7b5fffdaf4 vms/run: fix virtual machines spawning multiple windows 2023-12-14 08:55:12 +01:00
clan-bot
e46f644233 Merge pull request 'qemu-wayland: 8.2.0-rc2 -> 8.2.0-rc3' (#639) from Mic92-wayland-update into main 2023-12-13 15:29:03 +00:00
Jörg Thalheim
83e49f742e qemu-wayland: 8.2.0-rc2 -> 8.2.0-rc3 2023-12-13 16:21:41 +01:00
Clan Merge Bot
483a21a51b update flake lock - 2023-12-11T00:00+00:00
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/3cb78c93e6a02f494aaf6aeb37481c27a2e2ee22' (2023-11-25)
  → 'github:nix-community/disko/1144887c6f4d2dcbb2316a24364ef53e25b0fcfe' (2023-12-06)
• Updated input 'nixos-generators':
    'github:nix-community/nixos-generators/150f38bd1e09e20987feacb1b0d5991357532fb5' (2023-09-30)
  → 'github:nix-community/nixos-generators/246219bc21b943c6f6812bb7744218ba0df08600' (2023-12-04)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/0b62f5adfd6635f8013d800ceb0cf39411a8216f' (2023-12-03)
  → 'github:NixOS/nixpkgs/1f8d62a69936dd899d0e7c955537b2f4ca5bc623' (2023-12-10)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/8bca48cb9a12bbd8766f359ad00336924e91b7f7' (2023-12-03)
  → 'github:Mic92/sops-nix/d806e546f96c88cd9f7d91c1c19ebc99ba6277d9' (2023-12-10)
• Updated input 'treefmt-nix':
    'github:numtide/treefmt-nix/e82f32aa7f06bbbd56d7b12186d555223dc399d1' (2023-11-12)
  → 'github:numtide/treefmt-nix/afdd5e48a0869b389027307652a658051c0d2f96' (2023-12-10)
2023-12-11 00:00:51 +00:00
clan-bot
3633e4ac3f Merge pull request 'Used inspect commands in vm-manager' (#636) from Qubasa-main into main 2023-12-08 23:47:50 +00:00
Qubasa
30d55fc67e Used inspect commands in vm-manager 2023-12-09 00:45:12 +01:00
clan-bot
6833104c21 Merge pull request 'Added clan flakes inspect command. Improved ClanURI. Added democlan as dependency in flake.nix' (#635) from Qubasa-main into main 2023-12-08 23:25:37 +00:00
Qubasa
030d31c8b4 Removed democlan dependency 2023-12-09 00:23:19 +01:00
Qubasa
b319db0df9 Fixed democlan dep 2023-12-09 00:21:33 +01:00
Qubasa
136246de79 Removed democlan dependency 2023-12-09 00:19:30 +01:00
Qubasa
d4b8cef242 Added clan flakes inspect command. Improved ClanURI. Added democlan as dependency in flake.nix 2023-12-09 00:09:21 +01:00
clan-bot
9f4ab67fc2 Merge pull request 'clanCore: Fixed missing type null for clanIcon' (#634) from Qubasa-main into main 2023-12-08 18:33:58 +00:00
Qubasa
4a5e5feb73 clanCore: Fixed missing type null for clanIcon 2023-12-08 19:30:04 +01:00
Qubasa
d6052c3497 clanCore: Fixed missing type null for clanIcon 2023-12-08 19:27:58 +01:00
clan-bot
28a6613bde Merge pull request 'backups: support services for restore' (#631) from lassulus-HEAD into main 2023-12-08 18:16:08 +00:00
clan-bot
aad4073a70 Merge pull request 'Changed clanIcon to be included into clanCore' (#633) from Qubasa-main into main 2023-12-08 18:11:48 +00:00
lassulus
8340d8f5f2 clan-cli Machines: implement eval/build-cache 2023-12-08 19:09:29 +01:00
lassulus
dec431e69f backups: support services for restore 2023-12-08 19:09:29 +01:00
Qubasa
eba34bf2f7 Changed clanIcon to be included into clanCore 2023-12-08 19:08:57 +01:00
clan-bot
003b5a77c6 Merge pull request 'Added clanIcon' (#632) from Qubasa-main into main 2023-12-08 18:04:15 +00:00
Qubasa
31d95e64f8 Added clanIcon 2023-12-08 19:01:11 +01:00
clan-bot
57bded996b Merge pull request 'move clanName into nixos machine configuration' (#630) from Mic92-main into main 2023-12-08 15:21:59 +00:00
Jörg Thalheim
9704b5bd6f disable tty0 when using wayland
we don't vga output and use our serial console instead
2023-12-08 16:19:09 +01:00
Jörg Thalheim
2a0a50fb5e switch to initrd.systemd by default 2023-12-08 16:17:58 +01:00
Mic92
73973c1f5e Merge pull request 'move clanName into nixos machine configuration' (#629) from Mic92-main into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/629
2023-12-08 15:05:56 +00:00
Jörg Thalheim
4aa60317fa move clanName into nixos machine configuration 2023-12-08 15:05:56 +00:00
Jörg Thalheim
4b9635c706 move clanName into nixos machine configuration 2023-12-08 16:03:29 +01:00
clan-bot
c22280b864 Merge pull request 'add wayland option' (#628) from Mic92-main into main 2023-12-08 14:16:43 +00:00
Jörg Thalheim
1496f45fe2 prefix nixpkgs# explicitly in nix_shell
This makes the function usage less confusing (you can now tell from the call side what are flags and what is passed to nix-shell) and allows to use different flakes to download packages.
2023-12-08 15:14:14 +01:00
Jörg Thalheim
f6d4c721c4 vms/run: split large vm run method into smaller ones 2023-12-08 15:09:48 +01:00
Jörg Thalheim
c4a8193047 add wayland option 2023-12-08 14:13:47 +01:00
clan-bot
fca3cff4bf Merge pull request 'make vm inspect non-async' (#627) from Mic92-main into main 2023-12-08 13:02:02 +00:00
Jörg Thalheim
a98b5e205f make vm inspect non-async 2023-12-08 13:59:24 +01:00
clan-bot
9bc75943e3 Merge pull request 'syncthing: restrict access of peers to vpn' (#626) from a-kenji-restrict-introducer into main 2023-12-08 12:56:35 +00:00
a-kenji
c8ffcadad9 syncthing: restrict access of peers to vpn 2023-12-08 13:53:32 +01:00
clan-bot
3c04d14917 Merge pull request 'Added windows folder' (#624) from Qubasa-main into main 2023-12-08 12:49:07 +00:00
Qubasa
ae8029e560 clan_cli: URI parser now only has HTTP and FILE. Also clan:///home/user or clan://~/Downloads is supported 2023-12-08 13:46:21 +01:00
clan-bot
2c1533b7e2 Merge pull request 'vms/run: rename flake_url to flake-url' (#623) from Mic92-main into main 2023-12-08 12:42:59 +00:00
Jörg Thalheim
b8b4bedfdb vms/run: rename flake_url to flake-url 2023-12-08 13:40:28 +01:00
clan-bot
11772eb13e Merge pull request 'add rutabaga-gfx-ffi patches' (#622) from Mic92-main into main 2023-12-08 12:14:56 +00:00
Jörg Thalheim
4bf0bb9e45 add rutabaga-gfx-ffi patches 2023-12-08 13:08:36 +01:00
clan-bot
76c3c77886 Merge pull request 'add serial module to vms' (#621) from Mic92-main into main 2023-12-08 11:37:50 +00:00
Jörg Thalheim
64944f896a add serial module to vms
This is useful for debugging in the cli.
2023-12-08 12:35:33 +01:00
Qubasa
7c6902f70a Replaced Status with checkbox 2023-12-08 12:18:55 +01:00
clan-bot
edb503a760 Merge pull request 'always provide a clan_flake_toplevel value' (#620) from Mic92-main into main 2023-12-08 11:12:57 +00:00
Jörg Thalheim
48d7d5f38c vms/run/inspect: also make it more type-safe
nix will show proper error messages when it cannot find a flake.
2023-12-08 12:08:48 +01:00
Jörg Thalheim
31196e3d3c vms/run: make flake field option always have a value 2023-12-08 12:08:45 +01:00
Qubasa
7d22f7c9fc Added join window 2023-12-08 11:56:27 +01:00
clan-bot
72327093c2 Merge pull request 'make cli options more type safe using a dataclass' (#619) from Mic92-main into main 2023-12-08 10:33:44 +00:00
Jörg Thalheim
fa0a7ce122 make cli options more type safe using a dataclass 2023-12-08 11:31:29 +01:00
clan-bot
01291c55c1 Merge pull request 'make sure that flake url is always set in the cli' (#618) from Mic92-main into main 2023-12-08 10:07:50 +00:00
Jörg Thalheim
f261578187 make sure that flake url is always set in the cli 2023-12-08 11:05:22 +01:00
clan-bot
b885c3d052 Merge pull request 'backups: implement list the easy way' (#617) from lassulus-backups2 into main 2023-12-07 17:25:56 +00:00
lassulus
cf68bd41d6 backups: implement list/create and dry-run restore 2023-12-07 18:23:22 +01:00
clan-bot
ec2653f2fa Merge pull request 'init: syncthing module' (#616) from a-kenji-init/syncthing-module into main 2023-12-07 13:14:33 +00:00
a-kenji
ff3b8f1db0 init: syncthing module
Assumes one `introducer` peer, which can AutoShare configured folders,
with peers that know the `deviceID` of the introducer.
2023-12-07 14:10:15 +01:00
clan-bot
7f68da2715 Merge pull request 'backups: implement list the easy way' (#614) from lassulus-backups2 into main 2023-12-07 12:32:47 +00:00
lassulus
45e9ab45f7 backups: implement list the easy way 2023-12-07 13:22:41 +01:00
Qubasa
6b8216b3ac Added windows folder 2023-12-06 18:38:19 +01:00
clan-bot
a5caed0de9 Merge pull request 're-add 'U' ruff type category' (#615) from Mic92-main into main 2023-12-06 16:18:29 +00:00
Jörg Thalheim
bbc411135c move mypy/ipdb to devshell 2023-12-06 17:16:28 +01:00
Jörg Thalheim
807b53c71b modernize code with ruff 2023-12-06 17:13:58 +01:00
Jörg Thalheim
8ea149de07 re-add 'U' ruff type category
This should have been not removed
2023-12-06 17:11:17 +01:00
clan-bot
28df338527 Merge pull request 'pending-script: add @ before username' (#613) from Mic92-main into main 2023-12-06 15:17:42 +00:00
Jörg Thalheim
2f56c73b47 pending-script: add @ before username 2023-12-06 16:15:42 +01:00
clan-bot
006ce36b8a Merge pull request 'add qemu-wayland' (#612) from Mic92-main into main 2023-12-06 14:55:24 +00:00
Jörg Thalheim
7bc54cb524 get rid of task_manager 2023-12-06 15:53:23 +01:00
Jörg Thalheim
9576047adb add qemu-wayland 2023-12-06 15:53:23 +01:00
clan-bot
0eb2f2c708 Merge pull request 'clan_cli: ClanURI fixed non executing tests' (#611) from Qubasa-main into main 2023-12-06 12:41:16 +00:00
Qubasa
b48fb10f86 clan_cli: ClanURI fixed non executing tests 2023-12-06 13:38:22 +01:00
clan-bot
87b664d3b1 Merge pull request 'clan_cli: Remodeled ClanURI parser' (#610) from Qubasa-main into main 2023-12-05 17:19:42 +00:00
Qubasa
cb984f6d43 clan_cli: Remodeled ClanURI parser 2023-12-05 18:16:51 +01:00
Qubasa
22d5a61a51 clan_cli: Remodeled ClanURI parser 2023-12-05 18:08:27 +01:00
clan-bot
d694ef9bad Merge pull request 'Improved desktop file installation' (#609) from Qubasa-main into main 2023-12-05 15:20:03 +00:00
Qubasa
63c820ed86 clan_cli: Added ClanURI class parser 2023-12-05 16:17:15 +01:00
Qubasa
0cadbe0f1d Improved desktop file installation 2023-12-05 16:05:13 +01:00
clan-bot
95354fadd8 Merge pull request 'clan-vm-manager: fix meta.mainProgram' (#608) from DavHau-main into main 2023-12-05 13:33:29 +00:00
DavHau
4c093ea2d9 clan-vm-manager: fix meta.mainProgram 2023-12-05 20:31:14 +07:00
clan-bot
062594029a Merge pull request 'clan-vm-manager: Fixed vm-manager start' (#607) from Qubasa-main into main 2023-12-05 12:44:07 +00:00
Qubasa
fcf21093ac nix fmt 2023-12-05 13:41:41 +01:00
Qubasa
af441e71d2 clan-vm-manager: Fixed vm-manager start 2023-12-05 13:41:02 +01:00
clan-bot
c701b43edb Merge pull request 'clan-vm-manager: Fixed assets folder not included' (#606) from Qubasa-main into main 2023-12-04 18:26:51 +00:00
Qubasa
f183e759d3 clan-vm-manager: Added join subcommand 2023-12-04 19:23:35 +01:00
Qubasa
60bd3a3888 clan-vm-manager: Added URI xdg-mime installation into devshell 2023-12-04 17:53:22 +01:00
clan-bot
0b772668a8 Merge pull request 'backups: add clanCore backup & clan borgbackup module' (#605) from lassulus-backups into main 2023-12-04 16:51:33 +00:00
lassulus
e772d29f44 implement backup cli for borgbackup 2023-12-04 17:47:23 +01:00
Qubasa
d7b1a9f959 clan-vm-manager: Fixed assets folder not included 2023-12-04 16:56:42 +01:00
clan-bot
442551cd24 Merge pull request 'clan-vm-manager: Preserved selection on view change' (#604) from Qubasa-main into main 2023-12-04 13:31:37 +00:00
Qubasa
82fb1c36fe clan-vm-manager: Preserved selection on view change 2023-12-04 14:29:05 +01:00
clan-bot
625e2fd23c Merge pull request 'Automatic flake update - 2023-12-04T00:00+00:00' (#603) from flake-update-2023-12-04 into main 2023-12-04 00:05:07 +00:00
Clan Merge Bot
dd8e1ce758 update flake lock - 2023-12-04T00:00+00:00
Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/8c9fa2545007b49a5db5f650ae91f227672c3877' (2023-11-01)
  → 'github:hercules-ci/flake-parts/34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5' (2023-12-01)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/173b74db07f26344f3517716edd4bff6987b512d' (2023-11-26)
  → 'github:NixOS/nixpkgs/0b62f5adfd6635f8013d800ceb0cf39411a8216f' (2023-12-03)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/4be58d802693d7def8622ff34d36714f8db40371' (2023-11-26)
  → 'github:Mic92/sops-nix/8bca48cb9a12bbd8766f359ad00336924e91b7f7' (2023-12-03)
2023-12-04 00:00:56 +00:00
clan-bot
354291440a Merge pull request 'gui add stack switcher, remove notebook tabs' (#602) from hsjobeki-main into main 2023-12-03 13:11:26 +00:00
Johannes Kirschbauer
493b377266 gui add stack switcher, remove notebook tabs 2023-12-03 14:09:09 +01:00
clan-bot
a7d26e8851 Merge pull request 'extend clan history model' (#601) from hsjobeki-main into main 2023-12-02 15:19:20 +00:00
Johannes Kirschbauer
b4370c54e1 gui re-rendering & cleanup 2023-12-02 16:16:48 +01:00
Johannes Kirschbauer
bdcf5dbe8b extend clan history model 2023-12-02 16:16:38 +01:00
clan-bot
c346e9e613 Merge pull request 'partiall working run VM' (#600) from Qubasa-main into main 2023-12-01 23:18:34 +00:00
Qubasa
0e6d4cb0bb nix fmt 2023-12-02 00:15:55 +01:00
Qubasa
4dbf355ce2 partiall working run VM 2023-12-02 00:15:25 +01:00
clan-bot
0180385d4a Merge pull request 'Improved Table with feedback from W' (#598) from Qubasa-main into main 2023-12-01 22:18:31 +00:00
Qubasa
3883f5378c Removed submodule 2023-12-01 23:16:45 +01:00
Qubasa
8012bd5870 VMBase dataclass added 2023-12-01 23:13:36 +01:00
Qubasa
cfe7f4b50f VMBase dataclass added 2023-12-01 19:31:57 +01:00
Qubasa
9908ba447c moved code-workspace 2023-12-01 16:11:59 +01:00
Qubasa
34e8f42c52 remove breakpoint 2023-12-01 15:51:44 +01:00
Qubasa
583311fcda nix fmt 2023-12-01 15:46:27 +01:00
Qubasa
3db73d3396 Added better error handling in --flake argument 2023-12-01 15:45:05 +01:00
Qubasa
f9b7c5a468 Extracted class from app.py 2023-12-01 15:18:05 +01:00
Qubasa
a4a16361c9 Extracted class from app.py 2023-12-01 15:17:54 +01:00
Qubasa
5c9b95c0b9 fixed assert bug 2023-12-01 14:24:44 +01:00
Qubasa
5aa27044e5 Implemented working double click on table with information extraction 2023-12-01 14:22:50 +01:00
Qubasa
468e8d7718 nix fmt 2023-12-01 13:15:34 +01:00
Qubasa
a931d73e4f Improved Table with feedback from W 2023-12-01 13:14:38 +01:00
clan-bot
c88e9d93a2 Merge pull request 'remove outdated comment' (#597) from DavHau-dave into main 2023-12-01 09:56:45 +00:00
DavHau
703f3dd6ee remove outdated comment 2023-12-01 16:31:35 +07:00
clan-bot
c51c63087c Merge pull request 'docs: add API guidelines' (#596) from DavHau-dave into main 2023-12-01 09:30:20 +00:00
DavHau
2b2e30a72f docs: add API guidelines 2023-12-01 16:28:14 +07:00
clan-bot
2ac92ae308 Merge pull request 'remove outdated comment' (#595) from DavHau-dave into main 2023-12-01 09:14:07 +00:00
DavHau
e46d13d626 remove outdated comment 2023-12-01 16:11:31 +07:00
clan-bot
3a478c4880 Merge pull request 'flake history: make operations atomic' (#594) from DavHau-dave into main 2023-12-01 07:03:19 +00:00
DavHau
261322fae8 flake history: make operations atomic 2023-12-01 14:00:15 +07:00
clan-bot
6d6460ffca Merge pull request 'clan-cli: also package mimetypes' (#593) from Mic92-type-checking into main 2023-11-30 13:33:49 +00:00
Jörg Thalheim
b5afb3f9c0 clan-cli: also package mimetypes 2023-11-30 14:31:37 +01:00
Jörg Thalheim
4fd84d1c48 disallow variable shadowing 2023-11-30 14:31:37 +01:00
Jörg Thalheim
780ffb9c8f make type checking more strict 2023-11-30 14:31:37 +01:00
clan-bot
65cdd51af2 Merge pull request 'add option to extend path for generator' (#591) from generator into main 2023-11-30 13:18:07 +00:00
Jörg Thalheim
373fc83160 add option to extend path for generator 2023-11-30 14:15:40 +01:00
clan-bot
c6c9ea4f4a Merge pull request 'nix-direnv: update to 2.5.1' (#590) from Mic92-opengl-vm into main 2023-11-30 10:32:25 +00:00
Jörg Thalheim
7d3801a916 nix-direnv: update to 2.5.1 2023-11-30 11:29:49 +01:00
clan-bot
76b177778e Merge pull request 'integegrate remote-viewer instead of spicy' (#589) from Mic92-opengl-vm into main 2023-11-30 10:11:10 +00:00
Jörg Thalheim
31ce8f7357 fix build 2023-11-30 11:08:50 +01:00
Jörg Thalheim
ee705c5976 task-manager: spam select() without timeout 2023-11-30 10:57:58 +01:00
Jörg Thalheim
d0362bb757 error if age key cannot be decoded 2023-11-30 10:57:58 +01:00
Jörg Thalheim
3ae1c9cf75 integegrate remote-viewer instead of spicy 2023-11-29 16:07:12 +01:00
Mic92
0ee95d1054 Merge pull request 'more-linting' (#584) from more-linting into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/584
2023-11-29 13:29:45 +00:00
Jörg Thalheim
f1b223d0a1 modernisation for python 3.11 2023-11-29 13:29:45 +00:00
Jörg Thalheim
26e3e3872c enable more linting 2023-11-29 13:29:45 +00:00
clan-bot
7ae02d86af Merge pull request 'clan-core/secrets: escape trailing newline in facts' (#586) from a-kenji-trim-facts into main 2023-11-29 13:27:03 +00:00
a-kenji
41afc65f34 clan-core/secrets: escape facts trailing newline 2023-11-29 13:29:20 +01:00
clan-bot
28d18ee501 Merge pull request 'secret fixes' (#572) from Mic92-cli into main 2023-11-29 10:40:22 +00:00
Jörg Thalheim
f3b3aba6c5 run_upload_secrets: don't swallow stdout output 2023-11-29 11:38:01 +01:00
Jörg Thalheim
977bbbbd59 install: fix secrets upload 2023-11-29 11:38:01 +01:00
Jörg Thalheim
02a6162a1d test: add ipv6 example without port 2023-11-29 11:38:01 +01:00
Jörg Thalheim
179d1ed2c6 add sops command to sync keys with secrets 2023-11-29 11:34:19 +01:00
clan-bot
f4ad6d1f61 Merge pull request 'clan-vm-manager/devshell: set PYTHONBREAKPOINT with nix' (#577) from Mic92-HEAD into main 2023-11-29 10:32:41 +00:00
Jörg Thalheim
1497e37d2f clan-vm-manager/devshell: set PYTHONBREAKPOINT with nix 2023-11-29 11:29:58 +01:00
clan-bot
85e3a48702 Merge pull request 'clan-vm-manager: drop rants from README' (#576) from Mic92-HEAD into main 2023-11-29 10:29:52 +00:00
Jörg Thalheim
ee5a4ea7d9 clan-vm-manager: drop rants from README
they could be reformulated as pitfall documentation but in the current form it looks unprofessional
2023-11-29 11:26:46 +01:00
clan-bot
be6ae589e2 Merge pull request 'Made TreeView resizable' (#574) from Qubasa-main into main 2023-11-28 19:14:16 +00:00
Qubasa
91c1e91e47 nix fmt 2023-11-28 20:11:51 +01:00
Qubasa
9c20c5b25b Made TreeView resizable 2023-11-28 20:11:04 +01:00
clan-bot
753a8af510 Merge pull request 'Fully working clan select' (#573) from Qubasa-main into main 2023-11-28 18:58:39 +00:00
Qubasa
2fa124f274 nix fmt 2023-11-28 19:55:40 +01:00
Qubasa
50590ecdc4 Added UI structure and first clan vm manager 2023-11-28 19:52:29 +01:00
Qubasa
f0f6bdce96 Fully working clan select 2023-11-28 18:19:01 +01:00
lassulus
4ace326aeb add dummy backups cli 2023-11-28 13:23:48 +01:00
clan-bot
b1a4c502dd Merge pull request 'init: vm manager list view' (#570) from hsjobeki-main into main 2023-11-28 09:33:58 +00:00
Johannes Kirschbauer
e032575ec0 GUI: select handler to vm list 2023-11-28 10:31:25 +01:00
Johannes Kirschbauer
ebe411d50d init: vm manager list view 2023-11-28 10:29:38 +01:00
clan-bot
0ae454c8a9 Merge pull request 'allow ipv6 addresses in deployment addresses' (#569) from Mic92-cli into main 2023-11-28 09:08:31 +00:00
Jörg Thalheim
303df741e9 allow ipv6 addresses in deployment addresses 2023-11-28 10:05:45 +01:00
clan-bot
f7422e2a35 Merge pull request 'Automatic flake update - 2023-11-27T00:00+00:00' (#568) from flake-update-2023-11-27 into main 2023-11-27 00:05:51 +00:00
Clan Merge Bot
665487c147 update flake lock - 2023-11-27T00:00+00:00
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/2d7d77878c5d70f66f3d676ff66708d8d4f9d7df' (2023-11-12)
  → 'github:nix-community/disko/3cb78c93e6a02f494aaf6aeb37481c27a2e2ee22' (2023-11-25)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/3fb937a1e9f4157f57011965b99fcb7f4139d9ad' (2023-11-20)
  → 'github:NixOS/nixpkgs/173b74db07f26344f3517716edd4bff6987b512d' (2023-11-26)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/0e3a94167dcd10a47b89141f35b2ff9e04b34c46' (2023-11-14)
  → 'github:Mic92/sops-nix/4be58d802693d7def8622ff34d36714f8db40371' (2023-11-26)
2023-11-27 00:00:56 +00:00
clan-bot
44badce35b Merge pull request 'Added spice-gtk' (#567) from Qubasa-main into main 2023-11-25 01:28:27 +00:00
Qubasa
a90d0cc806 Added spice-gtk 2023-11-25 02:25:49 +01:00
clan-bot
f6e436a591 Merge pull request 'Added snarky comments into README' (#566) from Qubasa-main into main 2023-11-25 01:07:33 +00:00
Qubasa
2bd76231a0 Added snarky comments into README 2023-11-25 02:04:55 +01:00
clan-bot
8a577b1868 Merge pull request 'Added basic GTK window handling' (#565) from Qubasa-main into main 2023-11-25 00:58:04 +00:00
Qubasa
6df833d59b Added basic GTK window handling 2023-11-25 01:55:01 +01:00
ui-asset-bot
bb7f92f9aa update ui-assets.nix 2023-11-24 14:59:09 +00:00
clan-bot
272f0e6c8a Merge pull request 'openapi: put a static version into the repository' (#564) from Mic92-cli into main 2023-11-24 14:58:34 +00:00
Jörg Thalheim
d033f523b8 openapi: put a static version into the repository
This avoids a lot of rebuilds and we can also track api changes better
2023-11-24 15:56:27 +01:00
clan-bot
7cbd8f914b Merge pull request 'rename vms create to vms run' (#563) from Mic92-cli into main 2023-11-24 14:03:29 +00:00
Jörg Thalheim
884c200061 rename vms create to vms run 2023-11-24 15:00:08 +01:00
clan-bot
e8d7321e26 Merge pull request 'nix-unit: add missing wrapper' (#562) from Mic92-cli into main 2023-11-24 07:30:21 +00:00
Jörg Thalheim
6d670fed42 nix-unit: pin nix version
This will always break and this way we can delay how often we update it.
2023-11-24 08:28:08 +01:00
Jörg Thalheim
882a5011c0 nix-unit: add missing wrapper 2023-11-24 08:22:13 +01:00
clan-bot
2c048a8a74 Merge pull request 'WIP backups' (#557) from lassulus-backups into main 2023-11-23 17:18:55 +00:00
lassulus
640430075a backups: add clanCore backup & clan borgbackup module 2023-11-23 18:12:49 +01:00
clan-bot
db5af7ea67 Merge pull request 'clan-cli: drop unused mypy overrides for gi' (#561) from Mic92-cli into main 2023-11-23 17:06:01 +00:00
Jörg Thalheim
ce1ad9f8c2 clan-cli: drop unused mypy overrides for gi 2023-11-23 18:01:40 +01:00
clan-bot
7369978218 Merge pull request 'start spice in background' (#560) from Mic92-cli into main 2023-11-23 16:59:27 +00:00
Jörg Thalheim
81512b99a3 start spice in background 2023-11-23 17:56:05 +01:00
clan-bot
e13844ff46 Merge pull request 'fake_deal: fixup call wrapper' (#559) from Mic92-cli into main 2023-11-23 16:37:40 +00:00
Jörg Thalheim
63a74ced2e spice: use unix socket instead of tcp 2023-11-23 17:34:06 +01:00
Jörg Thalheim
c701ab7514 fake_deal: fixup call wrapper 2023-11-23 17:32:37 +01:00
clan-bot
fad3108218 Merge pull request 'switch to spice for graphical vms' (#558) from Mic92-cli into main 2023-11-23 16:07:31 +00:00
Jörg Thalheim
8a0ecd802e switch to spice for graphical vms 2023-11-23 16:59:07 +01:00
Jörg Thalheim
47d0dd297f vms: start with cpu=max
This unlocks some cpu extensions
2023-11-23 16:55:36 +01:00
clan-bot
4b1f5f873c Merge pull request 'clan-vm-manager' (#556) from clan-vm-manager into main 2023-11-23 14:32:52 +00:00
Jörg Thalheim
948ed521f9 nix-direnv: update to 2.4.0 2023-11-23 15:30:44 +01:00
Jörg Thalheim
136ccc89f1 clan-vm-manager: add desktop-icon 2023-11-23 15:30:44 +01:00
Jörg Thalheim
79d0f441d9 clan-vm-manager: prepend local clan-cli to python path 2023-11-23 15:30:44 +01:00
Jörg Thalheim
b8f5c13553 clan-vm-manager: simplify shellHook 2023-11-23 15:30:44 +01:00
Jörg Thalheim
f68c10a008 clan-vm-manager: add nix package 2023-11-23 15:30:44 +01:00
Jörg Thalheim
2e54575474 clan-cli: drop dependency on deal 2023-11-23 15:03:46 +01:00
Jörg Thalheim
9eed5a7fec drop glade backup file 2023-11-23 15:03:46 +01:00
Jörg Thalheim
a838c4da17 mv clan-vm-manager to its own package 2023-11-23 15:03:46 +01:00
Qubasa
832c41df7e Added gtk demo app 2023-11-23 15:03:38 +01:00
Qubasa
17c71d2f40 Added more deal tests 2023-11-21 16:44:38 +01:00
clan-bot
c39eb24318 Merge pull request 'drop desktop item from cli' (#554) from joerg-ci into main 2023-11-21 14:29:55 +00:00
Jörg Thalheim
7d3ccb23ea drop desktop item from cli 2023-11-21 15:26:36 +01:00
clan-bot
6072159020 Merge pull request 'drop dependency on fastapi in the cli' (#551) from Mic92-cli into main 2023-11-21 14:13:13 +00:00
Jörg Thalheim
8759e5a049 drop dependency on fastapi in the cli 2023-11-21 15:09:18 +01:00
clan-bot
dc39f04371 Merge pull request 'drop join from cli' (#549) from Mic92-cli into main 2023-11-21 13:31:36 +00:00
Jörg Thalheim
f9f2f7bb65 drop join from cli 2023-11-21 14:25:51 +01:00
clan-bot
38440e644f Merge pull request 'Revert "nix-unit; update"' (#548) from Mic92-cli into main 2023-11-21 13:00:49 +00:00
Jörg Thalheim
90ff10eac1 Revert "nix-unit; update"
This reverts commit bd7899e48a.
2023-11-21 13:58:05 +01:00
clan-bot
c901133a81 Merge pull request 'schemathesis: Add as runnable application instead of library to resolve httpx dependency collision issue' (#543) from Qubasa-main into main 2023-11-21 12:49:38 +00:00
Mic92
9997f95a4b Merge pull request 'cli' (#547) from cli into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/547
2023-11-21 12:48:35 +00:00
Jörg Thalheim
48008c9b7f fix compilation of frontend 2023-11-21 12:48:35 +00:00
Jörg Thalheim
7afaaf8c5a get rid of pydantic in cli 2023-11-21 12:48:35 +00:00
clan-bot
f9b3fe0765 Merge pull request 'jsonschema: support mdDoc description' (#544) from DavHau-jsonschema into main 2023-11-21 10:33:30 +00:00
DavHau
f54ad0f739 jsonschema: support mdDoc description 2023-11-21 17:29:22 +07:00
Qubasa
48f0381fb5 schemathesis: Add as runnable application instead of library to resolve httpx dependency collision issue 2023-11-20 17:14:12 +01:00
clan-bot
9af58c7bac Merge pull request 'lib/jsonschema: add more types and excludes' (#542) from DavHau-jsonschema into main 2023-11-20 12:43:51 +00:00
DavHau
3c4c2995ca lib/jsonschema: add more types and excludes
- Complete the types to cover almost everything
- exclude specific types like functionTo or package
2023-11-20 19:40:27 +07:00
clan-bot
d47662730f Merge pull request 'nix-unit; update' (#540) from DavHau-jsonschema into main 2023-11-20 10:07:03 +00:00
DavHau
e779bc2d11 lib/jsonschema: support listOf unspecified 2023-11-20 17:03:42 +07:00
DavHau
bd7899e48a nix-unit; update 2023-11-20 17:03:37 +07:00
ui-asset-bot
ef72523f54 update ui-assets.nix 2023-11-20 08:34:25 +00:00
clan-bot
bf837dc842 Merge pull request 'extend toolbar styling, add support for atomic menu' (#539) from hsjobeki-main into main 2023-11-20 08:33:01 +00:00
Johannes Kirschbauer
b83a440cb2 move join url 2023-11-20 09:29:46 +01:00
Johannes Kirschbauer
f7f3bd2e35 decompose join/create clan, move to manage page 2023-11-20 09:22:39 +01:00
Johannes Kirschbauer
b4550b3dd9 extend toolbar styling, add support for atomic menu 2023-11-20 09:21:59 +01:00
clan-bot
59eb8af2ce Merge pull request 'history: fix: store entries only once' (#537) from DavHau-dave into main 2023-11-20 04:42:09 +00:00
DavHau
9f63f725d3 history: fix: store entries only once 2023-11-20 11:39:00 +07:00
ui-asset-bot
9d99f93b37 update ui-assets.nix 2023-11-19 11:10:43 +00:00
clan-bot
12d742f95f Merge pull request 'ui: add clan tool bar' (#535) from DavHau-dave into main 2023-11-19 11:10:06 +00:00
Johannes Kirschbauer
8922bcc8f0 fix imports & class order 2023-11-19 12:06:36 +01:00
DavHau
648c6157ad ui: add clan tool bar
To use for selecting a clan from the history
2023-11-18 18:32:02 +07:00
ui-asset-bot
ff03944ff4 update ui-assets.nix 2023-11-18 10:18:20 +00:00
DavHau
46188f70de Merge pull request 'removed unused part' (#534) from hsjobeki-main into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/534
2023-11-18 10:17:42 +00:00
Johannes Kirschbauer
efa59abac6 prepare for select clan from history 2023-11-18 11:00:16 +01:00
Johannes Kirschbauer
3d7f9fefa8 removed unused part 2023-11-18 11:00:16 +01:00
ui-asset-bot
ee9d7fe6cb update ui-assets.nix 2023-11-18 09:43:34 +00:00
clan-bot
584bcc5334 Merge pull request 'ui: display overlay when no machines available' (#533) from DavHau-dave into main 2023-11-18 09:42:58 +00:00
DavHau
30f22acaf5 ui: display overlay when no machines available 2023-11-18 16:40:09 +07:00
ui-asset-bot
8767e9900d update ui-assets.nix 2023-11-18 08:38:57 +00:00
clan-bot
fb7d0ff8f2 Merge pull request 'start machine list cleanup' (#532) from hsjobeki-main into main 2023-11-18 08:38:18 +00:00
Johannes Kirschbauer
fb474a926a removed unused part 2023-11-18 15:35:13 +07:00
Johannes Kirschbauer
808bd3defd start machine list cleanup 2023-11-17 16:10:09 +01:00
clan-bot
778349b72d Merge pull request 'api/flake/history: implement review requests' (#531) from DavHau-dave into main 2023-11-17 11:30:13 +00:00
DavHau
c46638f589 api/flake/history: implement review requests 2023-11-17 18:26:55 +07:00
clan-bot
bf2b8b4cca Merge pull request 'hide root from api schema' (#529) from hsjobeki-hsjobeki into main 2023-11-17 11:07:11 +00:00
Johannes Kirschbauer
f07fb05220 hide root from api schema 2023-11-17 12:03:40 +01:00
clan-bot
4f0b132088 Merge pull request 'api/flake/list_history: init' (#530) from DavHau-dave into main 2023-11-17 11:00:15 +00:00
DavHau
64649ff7a9 api/flake/list_history: init
Add an api endpoint to list the history of clan flakes that have been interacted with

Also add `clan flake list`
2023-11-17 17:56:14 +07:00
Johannes Kirschbauer
02c3222f6b hide root from api schema 2023-11-17 11:54:17 +01:00
ui-asset-bot
a01cb9434b update ui-assets.nix 2023-11-17 10:47:47 +00:00
clan-bot
a7d46a561e Merge pull request 'fix ui' (#528) from hsjobeki-hsjobeki into main 2023-11-17 10:46:19 +00:00
Johannes Kirschbauer
f419ff842a fix ui 2023-11-17 11:42:43 +01:00
clan-bot
1233ff2644 Merge pull request 'api/flake/add: init' (#527) from DavHau-dave into main 2023-11-17 10:08:12 +00:00
DavHau
999ad67277 api/flake/add: init
Adds an endpoint to memoize clans.
clan flakes can be added to the history either via the endpoint or by executing `clan flakes add`
2023-11-17 17:05:15 +07:00
clan-bot
43dbdf20d4 Merge pull request 'meshname: fix mx records and support for reverse-ips' (#526) from Mic92-sops-nix into main 2023-11-16 16:36:11 +00:00
Jörg Thalheim
5e280674fa meshname: fix mx records and support for reverse-ips 2023-11-16 17:32:05 +01:00
clan-bot
95d41323b0 Merge pull request 'Fix typo' (#525) from a-kenji-fix/typo into main 2023-11-16 13:49:30 +00:00
a-kenji
1f03a9b7ec Fix typo 2023-11-16 14:39:15 +01:00
kenji
97793c5b70 Merge pull request 'Configure nix inside the machines' (#524) from a-kenji-init/nix-settings into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/524
2023-11-16 13:22:28 +00:00
a-kenji
0604d5a83d Configure nix inside the machines
Add sane nix defaults for debugging and usability reasons
2023-11-16 14:08:50 +01:00
clan-bot
20cdcbcb44 Merge pull request 'clanCore: install essential tools for debugging + flake nixpkgs registry pin' (#523) from Mic92-sops-nix into main 2023-11-16 12:52:26 +00:00
Jörg Thalheim
7f6b0dfaea pin nixos-wide registry to nixpkgs used to build the machine itself
Instead of downloading archives and filling up vm disk space we can juse the nixpkgs version we already use for evaluating
2023-11-16 13:49:35 +01:00
Jörg Thalheim
d2fecd0a94 clanCore: install essential tools for debugging 2023-11-16 13:46:13 +01:00
clan-bot
91b6094704 Merge pull request 'secrets/generate-private-key: just create parent opportunistically' (#522) from Mic92-sops-nix into main 2023-11-16 12:21:39 +00:00
Jörg Thalheim
978d9efd7e secrets/generate-private-key: just create parent opportunistically 2023-11-16 13:19:12 +01:00
lassulus
2f870d2c83 Merge pull request 'clan_cli: create key directory' (#521) from a-kenji-mkdir/clan/cli into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/521
2023-11-16 11:18:33 +00:00
kenji
12930b4057 clan_cli: create key directory 2023-11-15 23:15:12 +01:00
clan-bot
5c495e3cdc Merge pull request 'machines.update: remove redundant flake argument' (#519) from lassulus-update-fix into main 2023-11-15 21:01:02 +00:00
lassulus
5640b84433 machines.update: remove redundant flake argument 2023-11-15 21:57:08 +01:00
clan-bot
e185ab971c Merge pull request 'bump nix-unit' (#517) from joerg-ci into main 2023-11-15 15:51:47 +00:00
Jörg Thalheim
1f558954af drop schemathesis
This creates conflicting python packages when included
2023-11-15 16:48:46 +01:00
Jörg Thalheim
89b235e18a bump nix-unit 2023-11-15 16:39:48 +01:00
clan-bot
1d7e8046fe Merge pull request 'pending-reviews: add bullet points to prs' (#516) from Mic92-sops-nix into main 2023-11-15 15:36:58 +00:00
Jörg Thalheim
df0bdb5b5f pending-reviews: add bullet points to prs 2023-11-15 16:34:21 +01:00
clan-bot
13019e17f0 Merge pull request 'refactor flake_name -> flake_dir' (#491) from flakes2 into main 2023-11-15 15:30:54 +00:00
lassulus
a3e42a958f disable ui 2023-11-15 16:28:09 +01:00
lassulus
1ea13646ea clan_cli: flake_name -> flake_dir 2023-11-15 16:23:28 +01:00
clan-bot
7c50846f00 Merge pull request 'add pending-reviews script' (#514) from Mic92-sops-nix into main 2023-11-15 12:51:20 +00:00
Jörg Thalheim
56f135faed add pending-reviews script 2023-11-15 13:48:52 +01:00
clan-bot
6af96a6f87 Merge pull request 'tea-create-pr: automatic needs-review label' (#513) from Mic92-sops-nix into main 2023-11-15 12:00:35 +00:00
Jörg Thalheim
7ec378ca62 tea-create-pr: automatic needs-review label 2023-11-15 12:55:30 +01:00
clan-bot
1a6f2fe9cb Merge pull request 'Fix incorrect machine name for shell.nix' (#512) from Qubasa-main into main 2023-11-15 10:32:39 +00:00
Qubasa
aa39a631ac Fix incorrect machine name for shell.nix 2023-11-15 11:29:07 +01:00
Mic92
f98df10330 Merge pull request 'zerotier: fix ip not beeing persistent for peers' (#511) from Mic92-sops-nix into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/511
2023-11-15 10:23:07 +00:00
Jörg Thalheim
2bda2293cb meshnamed: fix container 2023-11-15 11:20:56 +01:00
Jörg Thalheim
df1e166afb clanCore/networking: allow ping unconditionally 2023-11-15 11:07:03 +01:00
Jörg Thalheim
1e49bf3378 zerotier: also install identity secrets for non-controllers 2023-11-15 11:07:03 +01:00
Jörg Thalheim
a84d628b81 deltachat: fixup default usernames 2023-11-15 11:07:03 +01:00
Jörg Thalheim
fcb22f254c move resolved configuration to a dummy interface 2023-11-15 11:07:03 +01:00
clan-bot
9802933ea9 Merge pull request 'zerotier: fix eval if meshname is not known yet' (#510) from Mic92-sops-nix into main 2023-11-15 06:23:38 +00:00
Jörg Thalheim
9358dfb666 drop verbose command logging in task manager 2023-11-15 07:21:26 +01:00
Jörg Thalheim
c1f6c0db66 pytest: add missing with-core marker 2023-11-15 07:21:26 +01:00
Jörg Thalheim
dca61fa5fa explicitly set networkd as the default 2023-11-15 07:21:26 +01:00
Jörg Thalheim
8cda86d34c integrated meshnamed with systemd-resolved 2023-11-15 07:21:26 +01:00
Jörg Thalheim
75f1815f98 move clan-imports into clanCore 2023-11-15 07:21:26 +01:00
Jörg Thalheim
30eb6a3ae2 deltachat: use zerotier address if available 2023-11-15 07:21:26 +01:00
Jörg Thalheim
2306b2ec50 zerotier: fix eval if meshname is not known yet 2023-11-15 07:21:26 +01:00
clan-bot
5cc3e88de6 Merge pull request 'zerotier: also enable meshnamed for non-controllers' (#509) from Mic92-sops-nix into main 2023-11-14 16:47:40 +00:00
Jörg Thalheim
fdfe02fb77 zerotier: also enable meshnamed for non-controllers 2023-11-14 17:45:30 +01:00
Jörg Thalheim
b2422f9c74 zerotier: write hostname to file 2023-11-14 17:45:30 +01:00
clan-bot
8968160221 Merge pull request 'also regenerate secrets if a fact is missing' (#508) from Mic92-sops-nix into main 2023-11-14 16:11:10 +00:00
Jörg Thalheim
6cb41cb006 also regenerate secrets if a fact is missing 2023-11-14 17:07:58 +01:00
clan-bot
ae1f177d10 Merge pull request 'fix exception when file does not exist' (#507) from Mic92-sops-nix into main 2023-11-14 16:00:20 +00:00
Jörg Thalheim
b9618e57c5 fix exception when file does not exist
fixes https://git.clan.lol/clan/clan-core/issues/488
2023-11-14 16:57:05 +01:00
clan-bot
c89ed67f30 Merge pull request 'add cors headers in exception handler in cors' (#506) from Mic92-sops-nix into main 2023-11-14 15:42:46 +00:00
Jörg Thalheim
19d7f17310 add cors headers in exception handler in cors 2023-11-14 16:39:20 +01:00
clan-bot
d815091f10 Merge pull request 'make openapi spec content addressed' (#505) from Mic92-sops-nix into main 2023-11-14 14:35:35 +00:00
Jörg Thalheim
18627baa9c only enable corsmiddleware when in dev mode and allow all origins 2023-11-14 15:32:03 +01:00
clan-bot
b2bbddd1f9 Merge pull request 'enable meshnamed in zerotier module' (#504) from Mic92-sops-nix into main 2023-11-14 13:42:43 +00:00
Jörg Thalheim
d2303df18b enable meshnamed in zerotier module 2023-11-14 14:40:26 +01:00
clan-bot
df363a8cfb Merge pull request 'zerotier: add leading zeros at subnet' (#503) from Mic92-sops-nix into main 2023-11-14 13:28:13 +00:00
Jörg Thalheim
cf9f24a3b2 zerotier: add leading zeros at subnet 2023-11-14 14:25:58 +01:00
clan-bot
a314f8390c Merge pull request 'zerotier: compute ipv6 subnets' (#502) from Mic92-sops-nix into main 2023-11-14 13:09:26 +00:00
Jörg Thalheim
99649f77d4 zerotier: compute ipv6 subnets 2023-11-14 14:04:05 +01:00
clan-bot
f34abb0034 Merge pull request 'drop zerotier-subnet, we can compute this.' (#501) from Mic92-sops-nix into main 2023-11-14 12:53:18 +00:00
Jörg Thalheim
5d41bcee7f drop zerotier-subnet, we can compute this. 2023-11-14 13:50:44 +01:00
clan-bot
f2e2d50c06 Merge pull request 'add module for meshnamed' (#499) from Mic92-sops-nix into main 2023-11-14 12:01:26 +00:00
Jörg Thalheim
bdc8ef63ed add module for meshnamed 2023-11-14 12:58:15 +01:00
Jörg Thalheim
eb788393e6 update flake lock 2023-11-14 11:29:43 +01:00
clan-bot
b47e38271e Merge pull request 'api/machines: add test ensuring empty config is valid' (#497) from DavHau-dave into main 2023-11-13 14:59:51 +00:00
DavHau
2dcdf738ce api/machines: add test ensuring empty config is valid 2023-11-13 21:56:02 +07:00
clan-bot
ace0ae5c49 Merge pull request 'api/machines: allow config verification on imaginary machines' (#496) from DavHau-dave into main 2023-11-13 14:29:11 +00:00
DavHau
6a52c5f15b api/machines: allow config verification on imaginary machines
Machines do not need to exist in order to verify their configuration.

This allows verifying a config before creating an actual machine with it.
2023-11-13 21:24:05 +07:00
clan-bot
7eb664fd08 Merge pull request 'api/machines: verify config by evaluating the .vm output' (#495) from DavHau-dave into main 2023-11-13 13:53:42 +00:00
DavHau
55a1df7868 api/machines: verify config by evaluating the .vm output
This fixes the problem where fileSystems were missing, or boot.loader was not set.

SInce we want VMs anyways for now, this strategy aligns well
2023-11-13 20:50:11 +07:00
ui-asset-bot
f55fcc1551 update ui-assets.nix 2023-11-13 13:31:33 +00:00
clan-bot
8b60c68206 Merge pull request 'api/machines: init put_machine replacing create_machine and set_machine_config' (#494) from DavHau-dave into main 2023-11-13 13:30:53 +00:00
DavHau
1652b5c27b api/machines: init put_machine replacing create_machine and set_machine_config
This allows creating and configuring a machine in one single step.
2023-11-13 20:25:52 +07:00
DavHau
2395119d21 task_manager.py: fix index out of range bug 2023-11-13 20:21:51 +07:00
DavHau
14c4b99891 commit_file: fix diff computation
previously computed diff over all files
2023-11-13 19:59:20 +07:00
DavHau
42dba72239 chore: remove unnecessary comment 2023-11-12 07:57:48 +07:00
DavHau
236ca4f98c api/machines: ensure name is valid hostname 2023-11-12 07:57:48 +07:00
clan-bot
eec22d7d39 Merge pull request 'fix sops-nix override' (#492) from sops-nix into main 2023-11-11 17:31:09 +00:00
Jörg Thalheim
b2998e2e94 fix sops-nix override 2023-11-11 18:28:18 +01:00
ui-asset-bot
3a2c407ae0 update ui-assets.nix 2023-11-11 14:30:55 +00:00
clan-bot
4ed42540ba Merge pull request 'feat/configure-modules' (#490) from feat/configure-modules into main 2023-11-11 14:30:16 +00:00
Johannes Kirschbauer
74c8b85e4a fix type errors 2023-11-11 15:27:57 +01:00
Johannes Kirschbauer
7a02483534 merge main 2023-11-11 15:11:06 +01:00
Johannes Kirschbauer
d7476c967e clean up join workflow 2023-11-11 15:01:18 +01:00
Johannes Kirschbauer
97b8c7a701 add & configure machine: added formular integration 2023-11-11 10:08:39 +01:00
clan-bot
04c754caad Merge pull request 'vms/create: drop extra flake argument and make it work with local flakes' (#487) from Mic92-zerotier into main 2023-11-10 12:46:45 +00:00
Jörg Thalheim
54ede8a0ff vms/create: drop extra flake argument and make it work with local flakes 2023-11-10 13:43:14 +01:00
clan-bot
e1bccaa54f Merge pull request 'rename luispkgs to nixpkgs-for-deal' (#485) from zerotier into main 2023-11-10 12:17:03 +00:00
Jörg Thalheim
c8e1acac2b rename luispkgs to nixpkgs-for-deal 2023-11-10 13:14:06 +01:00
clan-bot
4170fce7e8 Merge pull request 'move flake configuration to .config/clan/flakes rather than $XDG_DATA_DIRS' (#484) from zerotier into main 2023-11-10 12:01:30 +00:00
Jörg Thalheim
c0be813a4c dirs: opportuniscally create directories 2023-11-10 12:55:46 +01:00
Jörg Thalheim
657cdd6e67 drop unused clan_data_dir 2023-11-10 12:55:46 +01:00
Jörg Thalheim
df1acebd87 move flake configuration to .config/clan/flakes rather than $XDG_DATA_DIRS 2023-11-10 12:50:51 +01:00
Jörg Thalheim
46191b9a9c drop unused ClanDataPath 2023-11-10 12:46:15 +01:00
clan-bot
d848298017 Merge pull request 'moving deal dependencies to tests only' (#483) from zerotier into main 2023-11-10 11:43:45 +00:00
Jörg Thalheim
85a06d47e5 breakpoint_shell: make work_dir optional 2023-11-10 12:40:51 +01:00
Jörg Thalheim
13b685f7af moving deal dependencies to tests only 2023-11-10 12:39:24 +01:00
clan-bot
b518d92678 Merge pull request 'zerotier: allow to persist zerotier identities/ips/meshnames for non-controller' (#482) from zerotier into main 2023-11-10 10:59:48 +00:00
Jörg Thalheim
c28089d4b2 allow to persist zerotier identities/ips/meshnames for non-controller 2023-11-10 11:56:54 +01:00
clan-bot
078c211292 Merge pull request 'api/schema: return list of missing modules' (#480) from DavHau-dave into main 2023-11-10 08:10:53 +00:00
DavHau
39607a0925 api/schema: return list of missing modules 2023-11-10 15:07:15 +07:00
clan-bot
53ce82984d Merge pull request 'api/schema: don't crash on eval error' (#479) from DavHau-dave into main 2023-11-10 07:30:06 +00:00
DavHau
97ea9312ac api/schema: don't crash on eval error 2023-11-10 14:27:03 +07:00
Jörg Thalheim
b8ed607658 also override XDG_DATA_HOME in tests
otherwise tests will fail if XDG_DATA_HOME is set by a user
2023-11-09 17:45:24 +01:00
Jörg Thalheim
af0714132d clan: use .local/share as default for XDG_DATA_HOME 2023-11-09 17:45:24 +01:00
Jörg Thalheim
0206210b7e fix error message if clan flake does not exist 2023-11-09 17:44:44 +01:00
ui-asset-bot
c194adc181 update ui-assets.nix 2023-11-09 08:34:03 +00:00
clan-bot
163374dc6a Merge pull request 'api/schema: get schema without having a machine' (#478) from DavHau-dave into main 2023-11-09 08:33:23 +00:00
DavHau
2a6e329e40 api/schema: get schema without having a machine
Also done:
- add @pytest.mark.with_core indicating that a test depends on clan-core and cannot be cached
- separate unit tests into two derivations, ones that can be cached and ones that cannot.
- fix frontend typescript code
2023-11-09 15:30:25 +07:00
clan-bot
f2062db56c Merge pull request 'Fixed wrong examples' (#477) from Qubasa-main into main 2023-11-08 20:43:27 +00:00
Qubasa
10e52699be Fixed wrong examples 2023-11-08 21:40:17 +01:00
clan-bot
4f39abd1de Merge pull request 'Flake: Added python package deal as dependency' (#476) from Qubasa-main into main 2023-11-08 19:16:58 +00:00
Qubasa
ce90b02e06 Added deal as python dependency 2023-11-08 20:14:32 +01:00
Qubasa
7d030f85a1 Updated flake.lock 2023-11-08 20:02:53 +01:00
Qubasa
7240727b26 Added deal contract framework and testing documentation 2023-11-08 19:56:07 +01:00
Qubasa
32aa287da5 Added schemathesis dependency 2023-11-08 19:56:05 +01:00
Qubasa
798fbe3839 Added documentation on contract and property based testing 2023-11-08 19:55:12 +01:00
Qubasa
9cb46bf1cd Flake: Added python package deal as dependency 2023-11-08 19:55:11 +01:00
clan-bot
766a5a2ae7 Merge pull request 'drop bloatware module' (#475) from Mic92-HEAD into main 2023-11-08 13:49:35 +00:00
Jörg Thalheim
0efbb461e6 drop bloatware module 2023-11-08 14:47:31 +01:00
clan-bot
2a189995c5 Merge pull request 'package meshnamed' (#474) from Mic92-HEAD into main 2023-11-08 13:34:54 +00:00
Jörg Thalheim
0e0803f000 package meshnamed 2023-11-08 14:32:49 +01:00
clan-bot
c66272761e Merge pull request 'switch back to main' (#473) from Mic92-maddy into main 2023-11-08 09:23:53 +00:00
Jörg Thalheim
9beb302b9a switch back to main 2023-11-08 10:17:00 +01:00
clan-bot
231f1fe322 Merge pull request 'api/machines: better input/output validation' (#472) from DavHau-dave into main 2023-11-06 10:59:14 +00:00
DavHau
7e99454462 api/machines: better input/output validation
Also move contents tof 'config' to the top-level
2023-11-06 17:56:27 +07:00
clan-bot
c47e59d32d Merge pull request 'clan-cli secrets: flake_name -> flake_dir' (#450) from flakes into main 2023-11-05 16:27:13 +00:00
lassulus
7b3d3e20b4 clan-cli secrets: flake_name -> flake_dir 2023-11-05 16:58:48 +01:00
ui-asset-bot
1cd7fed34d update ui-assets.nix 2023-11-04 14:13:47 +00:00
clan-bot
0df53d068c Merge pull request 'add error handling' (#467) from feat/configure-modules into main 2023-11-04 14:12:27 +00:00
Johannes Kirschbauer
15a136b266 add error handling
prevent the user to go into next step if schema cannot be retrieved
2023-11-04 15:10:37 +01:00
ui-asset-bot
651056739a update ui-assets.nix 2023-11-04 13:58:39 +00:00
clan-bot
462535a808 Merge pull request 'style & explanation text' (#466) from feat/configure-modules into main 2023-11-04 13:57:20 +00:00
Johannes Kirschbauer
223b6bbca7 style & explanation text 2023-11-04 14:55:32 +01:00
ui-asset-bot
1025901fb3 update ui-assets.nix 2023-11-04 13:05:01 +00:00
clan-bot
c9afa54c32 Merge pull request 'select modules' (#465) from feat/configure-modules into main 2023-11-04 13:04:27 +00:00
Johannes Kirschbauer
92eebd7ea7 format stuff 2023-11-04 14:02:32 +01:00
Johannes Kirschbauer
a34d5d20e0 select modules.Prefetched schema depends only on modules 2023-11-04 13:53:30 +01:00
ui-asset-bot
eda80579d6 update ui-assets.nix 2023-11-04 08:58:19 +00:00
clan-bot
a15ddd5998 Merge pull request 'add create/join switch' (#447) from feat/create-flake into main 2023-11-04 08:57:42 +00:00
Johannes Kirschbauer
bdcdf59a49 fix changed api imports 2023-11-04 09:55:53 +01:00
Johannes Kirschbauer
8bebe90b52 disable lint rule 2023-11-04 09:46:14 +01:00
Johannes Kirschbauer
6188957b65 format 2023-11-04 09:16:37 +01:00
Johannes Kirschbauer
fec748fbfd merge main 2023-11-04 09:15:15 +01:00
ui-asset-bot
896c68bd72 update ui-assets.nix 2023-11-03 21:45:18 +00:00
clan-bot
d4f73cb32f Merge pull request 'contributing.md: Fixed missing direnv install step' (#457) from Qubasa-main into main 2023-11-03 21:44:44 +00:00
Qubasa
08dbdc0711 Fixed UI incorrectly not deleting api folder. Fixing new import paths for UI 2023-11-03 22:43:03 +01:00
Qubasa
b09bb155c1 nix fmt 2023-11-03 22:22:16 +01:00
Qubasa
2d4a20457b Fixing failing test 2023-11-03 22:21:22 +01:00
Qubasa
efa48052cf API: Added /api/flake/list. Added API grouping and description for better visibility 2023-11-03 22:05:33 +01:00
Qubasa
90a1311365 contributing.md: Fixed missing direnv install step 2023-11-03 20:33:27 +01:00
clan-bot
7e42ca0746 Merge pull request 'deltachat: allow other ports to access smtp port' (#455) from Mic92-maddy into main 2023-11-03 14:47:38 +00:00
Jörg Thalheim
86afcbe14b deltachat: allow other ports to access smtp port 2023-11-03 15:45:29 +01:00
clan-bot
5a2ee70282 Merge pull request 'flake.lock: Update' (#454) from Mic92-maddy into main 2023-11-03 14:26:41 +00:00
Jörg Thalheim
754d3bb125 flake.lock: Update
Flake lock file updates:

• Updated input 'sops-nix':
    'github:Mic92/sops-nix/c59da7ac29f041954c0864bc7bbb2c66ee18eba5' (2023-11-03)
  → 'github:Mic92/sops-nix/275b28593ef3a1b9d05b6eeda3ddce2f45f5c06f' (2023-11-03)
2023-11-03 15:24:51 +01:00
clan-bot
9845efad71 Merge pull request 'flake.lock: Update' (#452) from Mic92-maddy into main 2023-11-03 13:52:50 +00:00
clan-bot
e967ab3849 Merge pull request 'cli: merge nix options correctly; ruff format' (#451) from maddy into main 2023-11-03 13:50:30 +00:00
Jörg Thalheim
29c5951932 flake.lock: Update
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/4122a18340094151d7911e838237ec7627f0d0c5' (2023-10-22)
  → 'github:nix-community/disko/944d338d24a9d043a3f7461c30ee6cfe4f9cca30' (2023-10-27)
• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4' (2023-10-03)
  → 'github:hercules-ci/flake-parts/8c9fa2545007b49a5db5f650ae91f227672c3877' (2023-11-01)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/30a0ba4a20703b4bfe047fe5def1fc24978e322c' (2023-10-22)
  → 'github:Mic92/sops-nix/c59da7ac29f041954c0864bc7bbb2c66ee18eba5' (2023-11-03)
• Updated input 'treefmt-nix':
    'github:numtide/treefmt-nix/aae39f64f5ecbe89792d05eacea5cb241891292a' (2023-10-15)
  → 'github:numtide/treefmt-nix/5deb8dc125a9f83b65ca86cf0c8167c46593e0b1' (2023-10-27)
2023-11-03 14:49:49 +01:00
Jörg Thalheim
c5007ce7e3 fix clan_error_handler type 2023-11-03 14:48:14 +01:00
Jörg Thalheim
557a0db7d1 deltachat: import module from clanModules 2023-11-03 14:02:07 +01:00
Jörg Thalheim
b92052dbfb container-driver: fix eval 2023-11-03 14:01:43 +01:00
Jörg Thalheim
94177d827d switch to deltachat branch 2023-11-03 13:50:05 +01:00
Jörg Thalheim
742886b8d5 switch to back to nixos-unstable-small 2023-11-03 13:44:12 +01:00
Jörg Thalheim
5cb4019942 switch from black to ruff for formatting 2023-11-03 13:38:13 +01:00
Jörg Thalheim
15dc4fd497 cli: merge nix options correctly 2023-11-03 13:31:36 +01:00
Mic92
85357ec137 Merge pull request 'add nix option flag that is passed to underlying nix commands' (#449) from maddy into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/449
2023-11-03 12:19:22 +00:00
Jörg Thalheim
e1efaedc38 add nix option flag that is passed to underlying nix commands 2023-11-03 12:28:26 +01:00
Mic92
96053b679c Merge pull request 'add deltachat module' (#448) from maddy into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/448
2023-11-03 10:39:51 +00:00
Jörg Thalheim
f71e56b111 add deltachat module 2023-11-03 10:39:51 +00:00
Jörg Thalheim
2ee68fb0e2 drop xmpp setup again 2023-11-03 10:39:51 +00:00
Johannes Kirschbauer
8677c14aaa add create/join switch 2023-10-31 19:05:37 +01:00
clan-bot
331529c1df Merge pull request 'ejabberd: fix sqlite and access' (#446) from Mic92-main into main 2023-10-31 17:45:16 +00:00
Jörg Thalheim
3e989c57fa drop ejabberd again 2023-10-31 18:43:51 +01:00
Jörg Thalheim
2e35554e9f add prosody 2023-10-31 17:41:36 +01:00
Jörg Thalheim
4361eb3a19 ejabberd: fix sqlite and access 2023-10-31 16:46:02 +01:00
clan-bot
b2c6965ec3 Merge pull request 'zerotier: enable networkd, better qemu vga' (#445) from Mic92-main into main 2023-10-31 14:40:22 +00:00
Jörg Thalheim
52a56701ff zerotier: enable networkd 2023-10-31 15:35:09 +01:00
Jörg Thalheim
d562c6ac5f vms/create: try virtio for vga
seems to suck less than std.
2023-10-31 15:34:53 +01:00
Qubasa
9875d5d2a3 Fixing tea-create-pr 2023-10-31 15:34:47 +01:00
Qubasa
e11b0481a0 nix fmt 2023-10-31 15:34:47 +01:00
Qubasa
291cb091c5 Added contributing.md and improved README.md 2023-10-31 15:34:47 +01:00
lassulus
370485403d switch flake to main branch again 2023-10-31 15:34:47 +01:00
lassulus
c9d7a96844 cli machines update: find flake dir automatic if not provided, support flake as path 2023-10-31 15:34:47 +01:00
clan-bot
65eaece901 Merge pull request 'clanModules: add xfce/dino' (#444) from Mic92-main into main 2023-10-31 12:56:32 +00:00
Jörg Thalheim
06aaa35119 vms/create: use tmpdir again 2023-10-31 13:53:54 +01:00
Jörg Thalheim
60721e442d vms/create: allow xchg/secrets dir to exist 2023-10-31 13:53:54 +01:00
Jörg Thalheim
cb87ccbfc4 improve error message if flake_dir does not exists 2023-10-31 13:53:54 +01:00
Jörg Thalheim
61abc96581 clanModules: add ejabberd 2023-10-31 13:53:54 +01:00
clan-bot
1524952eb0 Merge pull request 'Added contributing.md and improved README.md' (#443) from Qubasa-main into main 2023-10-31 12:18:53 +00:00
Qubasa
638416a9c0 Fixing tea-create-pr 2023-10-31 13:16:19 +01:00
lassulus
6fdd1d56ad Merge pull request 'cli machines update: find flake dir automatic if not provided, support flake as path' (#441) from lassulus-HEAD into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/441
2023-10-31 12:09:35 +00:00
lassulus
f4e7828725 switch flake to main branch again 2023-10-31 13:01:16 +01:00
Qubasa
8113260f49 nix fmt 2023-10-31 13:00:48 +01:00
Qubasa
fe689d4840 Added contributing.md and improved README.md 2023-10-31 12:57:28 +01:00
Jörg Thalheim
3fd7b4ef29 clanModules: add xfce/dino 2023-10-31 12:49:51 +01:00
lassulus
17176f25de cli machines update: find flake dir automatic if not provided, support flake as path 2023-10-29 20:52:38 +01:00
ui-asset-bot
0590e4456a update ui-assets.nix 2023-10-29 18:55:11 +00:00
Luis Hebendanz
845d743d99 Merge pull request 'Adding state directory, rearchitecturing API endpoints' (#425) from Qubasa-main into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/425
2023-10-29 18:54:34 +00:00
Qubasa
7a8eef0648 Fixed test_webui only failing in nix_sandbox also fixed test_create_flake 2023-10-29 19:51:35 +01:00
Qubasa
4209da96e9 Fixed test_webui only failing in nix_sandbox 2023-10-29 19:35:29 +01:00
Johannes Kirschbauer
e6675cb4d9 format pytest 2023-10-28 18:38:14 +02:00
Johannes Kirschbauer
5c9f826a23 fix frontend 2023-10-28 18:34:36 +02:00
Qubasa
032cdd731a Fixing test_clan_modules test 2023-10-27 23:39:02 +02:00
Qubasa
00ef406713 Updated to main branch. Removed cluttering asyncio and httpx log messages 2023-10-27 23:36:45 +02:00
Qubasa
410b7c1158 Updated to main branch 2023-10-27 19:26:51 +02:00
Qubasa
ce66ab036f next lint now throws at least an equal amount of errors as next build if not more. 2023-10-27 19:26:03 +02:00
Qubasa
40f4227413 Fixed missing FlakeName argument 2023-10-27 19:26:03 +02:00
Qubasa
eafc55f2e7 Fixing deadlock 2023-10-27 19:26:03 +02:00
Qubasa
f9b1a8fa89 Removing find_git_repo 2023-10-27 19:26:03 +02:00
Qubasa
0378e01cbb Fixing test_vms_api test 2023-10-27 19:26:03 +02:00
Qubasa
4aac2012cf Fixing test_vms_api test 2023-10-27 19:26:03 +02:00
Qubasa
674d84a43a Fixing test_vms_api test 2023-10-27 19:26:03 +02:00
Qubasa
86790a6282 Commit only for debugging Container 2023-10-27 19:26:03 +02:00
Qubasa
b1d0129fc0 Commit only for debugging Container 2023-10-27 19:26:03 +02:00
Qubasa
efd201c7c5 nix fmt 2023-10-27 19:26:03 +02:00
Qubasa
a28f910e35 nix fmt 2023-10-27 19:26:03 +02:00
Qubasa
3f87ec851f All tests passing babyyy !! 2023-10-27 19:26:03 +02:00
Qubasa
c1b4fa6d55 nix fmt 2023-10-27 19:21:50 +02:00
Qubasa
3581e0c9a8 Fixing a multitude of tests 2023-10-27 19:21:50 +02:00
Qubasa
d1c35301e3 Added repro_env_break debugging command. This spawn a terminal inside the temp home folder with the same environment as the python test 2023-10-27 19:20:17 +02:00
Qubasa
59393bb35e Working test_create_flake 2023-10-27 19:20:17 +02:00
Qubasa
26bfb793b1 Added ref to Qubasa-main in template/new-clan/flake.nix 2023-10-27 19:20:17 +02:00
Qubasa
a71584d9d2 Added clanName argument to clan-core.lib.builClan 2023-10-27 19:20:17 +02:00
Qubasa
d02acbe04b nix fmt 2023-10-27 19:19:45 +02:00
Qubasa
9f464dd14e Added ipdb as breakpoint console. Improved logging. 2023-10-27 19:19:45 +02:00
Qubasa
af3f04736b Improved logging messages. Added ClanError if flake create or machine create already exist 2023-10-27 19:18:45 +02:00
Qubasa
8482bc79f6 Secrets tests passing. nix fmt doesn't complain 2023-10-27 19:18:45 +02:00
Qubasa
03cabda2d4 Improved test logging with frame inspection 2023-10-27 19:18:45 +02:00
Qubasa
8cc1c2c4bd Fixed cyclic dependencie AND swapped pytest-parallel for pytest-xdist to fix deadlock in tests 2023-10-27 19:18:45 +02:00
Qubasa
2ca54afe7f Added new type FlakeName 2023-10-27 19:18:45 +02:00
Qubasa
32e60f5adc Added flake_name:str argument everywhere, nix fmt doesn't complain anymore 2023-10-27 19:15:40 +02:00
Qubasa
fdcd7ad1d9 Updated to main 2023-10-27 19:15:11 +02:00
Qubasa
711c70d1f0 Added state directory. 2023-10-27 19:11:27 +02:00
Qubasa
fa5f39f226 API: Added Path validators. api/flake/create inits git repo. Fixed vscode interpreter problem 2023-10-27 19:11:27 +02:00
clan-bot
cc96fcf916 Merge pull request 'move breakpoint checks out of default build' (#440) from Mic92-main into main 2023-10-27 15:42:28 +00:00
Jörg Thalheim
a7848de3a3 extending machines documentation 2023-10-27 17:40:20 +02:00
Jörg Thalheim
04836fa9e8 improve output of installer iso
Now it also includes local addresses.
2023-10-27 17:40:20 +02:00
Jörg Thalheim
79e707b044 fix updating multiple machines 2023-10-27 17:40:20 +02:00
Jörg Thalheim
b2c3b3840f move breakpoint checks out of default build
this allows to debug builds with breakpoints
2023-10-27 17:40:20 +02:00
clan-bot
902a95d04d Merge pull request 'docs: fix clan create command' (#439) from Mic92-main into main 2023-10-27 12:30:32 +00:00
Jörg Thalheim
3e4ad8ae1b cli/vms/create: fix trailing newlines in log output 2023-10-27 14:27:52 +02:00
Jörg Thalheim
ba50ce45f1 docs: fix clan create command 2023-10-27 13:28:34 +02:00
clan-bot
5d186d9fd4 Merge pull request 'api/machines: split off config validation into separate endpoint' (#438) from DavHau-dave into main 2023-10-25 23:25:56 +00:00
DavHau
0e5c7d2d13 api/machines: split off config validation into separate endpoint
- This speeds up PUT /machines{name}/config as it doesn't do the expensive check anymore
- instead use PUT /machines/{name}/verify which allows a dry-run evaluation of a config which is passed without writing it to disk
2023-10-25 17:48:37 +01:00
clan-bot
ed87aefbad Merge pull request '/api/clan_modules: init' (#437) from DavHau-dave into main 2023-10-25 16:25:05 +00:00
DavHau
25708d1a1a /api/clan_modules: init
- add GET /api/clan_modules entry point returning a list of modules available for import
2023-10-25 17:22:35 +01:00
clan-bot
a6f51d4dae Merge pull request 'api/machines: allow importing extra modules' (#436) from DavHau-dave into main 2023-10-25 15:39:00 +00:00
DavHau
bf176ad277 api/machines: allow importing extra modules
- add top-level option `clanImports` to clanCore
- clanImports can be set and checked as any other option
- buildClan resolves the clanImports from the settings.json before calling evalModules to prevent infinite recursions
- new endpoint PUT machines/{name}/schema to allow getting the schema for a specific list of imports
- to retrieve the currently imported modules, cimply do a GET or PU on machines/{name}/config which will return `clanImports` as part of the config

Still missing: get list of available modules
2023-10-25 16:36:30 +01:00
Mic92
1d45d493ef Merge pull request 'add container test driver' (#435) from container into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/435
2023-10-25 13:16:13 +00:00
Jörg Thalheim
5753f32930 add container test driver 2023-10-25 13:16:13 +00:00
clan-bot
f7031bdbdb Merge pull request 'PUT /machines/{name}/config; ensure is idempotent' (#434) from DavHau-dave into main 2023-10-24 17:50:51 +00:00
DavHau
9f6e01671f PUT /machines/{name}/config; ensure is idempotent 2023-10-24 18:48:14 +01:00
clan-bot
362e36c0b9 Merge pull request 'PUT api/machines/{name}/config: ensure only valid config is ever written' (#433) from DavHau-dave into main 2023-10-24 17:43:37 +00:00
DavHau
588bde069f PUT api/machines/{name}/config: ensure only valid config is ever written
- add CLAN_MACHINE_SETTINGS_FILE variable to temporarily override the machine settings file
- do a dry-run evaluation first with the new config before persisting it.
2023-10-24 18:40:48 +01:00
clan-bot
c9ef7d6e80 Merge pull request 'machines: add endpoint machines/{name}/ verify' (#432) from DavHau-dave into main 2023-10-24 15:34:05 +00:00
DavHau
a539fb6dc6 machines: add endpoint machines/{name}/ verify 2023-10-24 16:31:37 +01:00
clan-bot
a1a9c73660 Merge pull request 'clan config: refactor - reorder functions' (#431) from DavHau-dave into main 2023-10-24 14:35:34 +00:00
DavHau
cd940abc4e clan config: refactor - reorder functions 2023-10-24 15:27:19 +01:00
clan-bot
2a22348373 Merge pull request 'clan-cli/shell.nix: rename repo_root -> source' (#429) from DavHau-dave into main 2023-10-23 15:20:15 +00:00
DavHau
7ddd624e8e clan-cli/shell.nix: rename repo_root -> source 2023-10-23 16:15:46 +01:00
clan-bot
65c7867542 Merge pull request 'Automatic flake update - 2023-10-23T00:00+00:00' (#428) from flake-update-2023-10-23 into main 2023-10-23 00:02:46 +00:00
Clan Merge Bot
12e210ad12 update flake lock - 2023-10-23T00:00+00:00
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/6ad5c9c17cbd5514ce0cc2692dd82dd6d8e5d879' (2023-10-13)
  → 'github:nix-community/disko/4122a18340094151d7911e838237ec7627f0d0c5' (2023-10-22)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/51186b8012068c417dac7c31fb12861726577898' (2023-10-15)
  → 'github:Mic92/sops-nix/30a0ba4a20703b4bfe047fe5def1fc24978e322c' (2023-10-22)
2023-10-23 00:00:17 +00:00
clan-bot
c4e98667ef Merge pull request 'Automatic flake update - 2023-10-16T00:00+00:00' (#427) from flake-update-2023-10-16 into main 2023-10-16 00:02:26 +00:00
Clan Merge Bot
cd4c14b82e update flake lock - 2023-10-16T00:00+00:00
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/cde886a1c97ef2399b4f91409db045785020291f' (2023-10-05)
  → 'github:nix-community/disko/6ad5c9c17cbd5514ce0cc2692dd82dd6d8e5d879' (2023-10-13)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/d7380c38d407eaf06d111832f4368ba3486b800e' (2023-10-08)
  → 'github:Mic92/sops-nix/51186b8012068c417dac7c31fb12861726577898' (2023-10-15)
• Updated input 'treefmt-nix':
    'github:numtide/treefmt-nix/720bd006d855b08e60664e4683ccddb7a9ff614a' (2023-09-27)
  → 'github:numtide/treefmt-nix/aae39f64f5ecbe89792d05eacea5cb241891292a' (2023-10-15)
2023-10-16 00:00:17 +00:00
clan-bot
a650d9c341 Merge pull request 'machines/install: call correct upload function' (#426) from Mic92-main into main 2023-10-14 14:06:59 +00:00
Jörg Thalheim
c82a4df9f9 machines/install: call correct upload function 2023-10-14 15:56:04 +02:00
DavHau
2f9ec882b2 Merge pull request 'vms.create: don't generate secrets if clan is remote' (#424) from lassulus-vm_generate into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/424
2023-10-11 10:10:26 +00:00
lassulus
3dad667f97 vms.create: don't generate secrets if clan is remote 2023-10-11 12:01:42 +02:00
clan-bot
1cca1faedd Merge pull request 'API: Added /api/flake/create. Fixed vscode search settings. Moved clan create to clan flake create' (#423) from Qubasa-main into main 2023-10-09 12:04:02 +00:00
Qubasa
b49433958b API: Added /api/flake/create. Fixed vscode search settings. Moved clan create to clan flake create 2023-10-09 14:01:34 +02:00
clan-bot
3650ab491d Merge pull request 'Automatic flake update - 2023-10-09T00:00+00:00' (#422) from flake-update-2023-10-09 into main 2023-10-09 00:04:23 +00:00
Clan Merge Bot
603b48a0fe update flake lock - 2023-10-09T00:00+00:00
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/646ee25c25fffee122a66282861f5f56ad3e0fd9' (2023-10-02)
  → 'github:nix-community/disko/cde886a1c97ef2399b4f91409db045785020291f' (2023-10-05)
• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/7f53fdb7bdc5bb237da7fefef12d099e4fd611ca' (2023-09-01)
  → 'github:hercules-ci/flake-parts/c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4' (2023-10-03)
• Updated input 'nixos-generators':
    'github:nix-community/nixos-generators/8ee78470029e641cddbd8721496da1316b47d3b4' (2023-09-04)
  → 'github:nix-community/nixos-generators/150f38bd1e09e20987feacb1b0d5991357532fb5' (2023-09-30)
• Updated input 'nixpkgs':
    'github:Mic92/nixpkgs/bc160df717ed1e9defe6044092ea66950976e3ed' (2023-09-26)
  → 'github:Mic92/nixpkgs/c3bd4f19ef0062d4462444aa413e26c917187ae9' (2023-09-30)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/2f375ed8702b0d8ee2430885059d5e7975e38f78' (2023-09-21)
  → 'github:Mic92/sops-nix/d7380c38d407eaf06d111832f4368ba3486b800e' (2023-10-08)
• Updated input 'treefmt-nix':
    'github:numtide/treefmt-nix/e951529be2e7c669487de78f5aef8597bbae5fca' (2023-09-21)
  → 'github:numtide/treefmt-nix/720bd006d855b08e60664e4683ccddb7a9ff614a' (2023-09-27)
2023-10-09 00:00:16 +00:00
ui-asset-bot
78758319f3 update ui-assets.nix 2023-10-08 15:27:26 +00:00
clan-bot
4fa2056834 Merge pull request 'cleanup work' (#421) from chore/fixes into main 2023-10-08 15:26:08 +00:00
ui-asset-bot
2874cf3bdb update ui-assets.nix 2023-10-08 15:24:32 +00:00
clan-bot
ded13b2da5 Merge pull request 'add coporate theme color variables' (#419) from feat/theme into main 2023-10-08 15:23:54 +00:00
Johannes Kirschbauer
5483018783 cleanup work 2023-10-08 17:20:43 +02:00
clan-bot
26b7effe99 Merge pull request 'CLI: Fixed bug in firefox opening addon page because of new profile' (#420) from Qubasa-main into main 2023-10-08 14:42:49 +00:00
Johannes Kirschbauer
6312f47545 remove: tailwindcss/plugin until we find solution 2023-10-08 16:31:16 +02:00
Johannes Kirschbauer
9ea71c90a6 resolve conflicts 2023-10-08 15:53:43 +02:00
Johannes Kirschbauer
d3310f861b add coporate theme color variables 2023-10-08 15:46:33 +02:00
Qubasa
9c74c4d661 CLI: Fixed bug in firefox opening addon page because of new profile 2023-10-08 14:39:31 +02:00
clan-bot
af1b8f68e7 Merge pull request 'clan join: test create vm for clan join' (#418) from DavHau-dave into main 2023-10-06 17:17:15 +00:00
DavHau
ceb6bdd474 clan join: test create vm for clan join
This adds a vm create test for the `clan join` scenario where:
  - there is no local clan to write changes to
  - a machine from a remote flake needs to be built and run
  - no users and no secrets need to be or can be managed (no flake to write files to)
2023-10-06 19:15:25 +02:00
clan-bot
e72f9ff8ae Merge pull request 'secrets: fix: don't generate secrets if no secrets are defined' (#417) from DavHau-dave into main 2023-10-06 16:50:45 +00:00
DavHau
c5b2e9b5f3 secrets: fix: don't generate secrets if no secrets are defined 2023-10-06 18:34:49 +02:00
ui-asset-bot
5ab0840939 update ui-assets.nix 2023-10-06 07:52:25 +00:00
clan-bot
60b868c4cb Merge pull request 'clean up theme' (#416) from feat/corp-theme into main 2023-10-06 07:51:07 +00:00
Johannes Kirschbauer
0e1b4ab96f clean up theme 2023-10-06 09:41:37 +02:00
clan-bot
cc47206fd6 Merge pull request 'password-store: generate each secret in tmpdir' (#414) from lassulus-HEAD into main 2023-10-05 18:36:52 +00:00
lassulus
2d2e097f6d secrets.password-store: mkdir correct fact folder 2023-10-05 20:22:30 +02:00
lassulus
386da9e6c4 zerotier generate-network: terminate fakeroot for process cleanup 2023-10-05 19:14:10 +02:00
lassulus
13e8dba417 password-store: generate each secret in tmpdir 2023-10-05 19:14:10 +02:00
clan-bot
dd04847f93 Merge pull request 'clan-cli: improve debug logging' (#415) from DavHau-dave into main 2023-10-05 15:39:24 +00:00
DavHau
f885c877bc clan-cli: improve debug logging 2023-10-05 17:37:33 +02:00
clan-bot
8856758dbc Merge pull request 'clanCore: specify interface for system.clan' (#413) from DavHau-dave into main 2023-10-05 15:10:23 +00:00
DavHau
9559357c56 clanCore: specify interface for system.clan 2023-10-05 17:08:59 +02:00
clan-bot
8ab0e9b7cd Merge pull request 'zerotier: fix: find free port without collissions' (#412) from DavHau-dave into main 2023-10-05 15:05:27 +00:00
DavHau
dbf80595fd zerotier: fix: find free port without collissions 2023-10-05 17:03:01 +02:00
clan-bot
48408f6a49 Merge pull request 'tests: add fixtures to test_vms_cli' (#411) from lassulus-HEAD into main 2023-10-05 13:58:28 +00:00
lassulus
bdb0a6484a tests: add fixtures to test_vms_cli 2023-10-05 15:56:15 +02:00
clan-bot
1870847aab Merge pull request 'clan-cli: unset LD_LIBRARY_PATH' (#410) from DavHau-dave into main 2023-10-05 11:46:27 +00:00
DavHau
6abbf4bacd clan-cli: unset LD_LIBRARY_PATH
This prevents problems with mixed glibc versions that might occur when the cli is called through a browser built against another glibc
2023-10-05 13:44:08 +02:00
clan-bot
d90becfd80 Merge pull request 'machines update: add --target-host' (#409) from lassulus-HEAD into main 2023-10-04 21:30:53 +00:00
lassulus
4af74ee5a5 machines update: add --target-host 2023-10-04 23:28:15 +02:00
clan-bot
fa013b3a0e Merge pull request 'secrets upload: skip on exit 23, cleanup' (#408) from lassulus-secrets-fix into main 2023-10-04 19:31:38 +00:00
lassulus
3fb36b3ac1 secrets upload: skip on exit 23, cleanup 2023-10-04 21:29:19 +02:00
clan-bot
dfed8fdcb2 Merge pull request 'test_secrets_password_store: create gpghome with save permissions' (#407) from Mic92-main into main 2023-10-04 17:59:18 +00:00
Jörg Thalheim
41106a67e2 test_secrets_password_store: create gpghome with save permissions 2023-10-04 19:56:18 +02:00
clan-bot
03c8c6f4e4 Merge pull request 'clan join: init' (#406) from DavHau-dave into main 2023-10-04 16:57:10 +00:00
DavHau
bdd4cfc7d8 clan join: init 2023-10-04 18:53:59 +02:00
clan-bot
a2597717b3 Merge pull request 'webui: drop deadcode' (#405) from Mic92-main into main 2023-10-04 16:20:23 +00:00
Jörg Thalheim
d0c1eddf79 task_manager: log stdout/stderr correctly for processes 2023-10-04 18:17:30 +02:00
Jörg Thalheim
d156218775 drop dead daemonize code 2023-10-04 18:17:30 +02:00
clan-bot
d015e3ff60 Merge pull request 'vm_secrets' (#401) from vm_secrets into main 2023-10-04 16:15:54 +00:00
lassulus
99433ac290 test_vms_api: supply age key for secret creation 2023-10-04 18:13:25 +02:00
lassulus
bc36ec4c1a vms: support secrets and fix cross compilation 2023-10-04 18:04:27 +02:00
clan-bot
994c190d0f Merge pull request 'fix task manager race conditions' (#404) from lassulus-taskmanager into main 2023-10-04 15:54:37 +00:00
lassulus
e8c9f27515 tests test_flake: disable dhcp 2023-10-04 17:52:06 +02:00
lassulus
fe1a3f0541 task_manager: fix race conditions 2023-10-04 17:52:06 +02:00
clan-bot
827fcbfe46 Merge pull request 'webui: open browser in new window' (#403) from DavHau-dave into main 2023-10-04 15:30:58 +00:00
DavHau
544322ee6e webui: open browser in new window
This gets closer to an app like feeling
2023-10-04 17:26:55 +02:00
clan-bot
018590d30b Merge pull request 'improve task manager to report exceptions better' (#402) from Mic92-main into main 2023-10-04 14:51:41 +00:00
Jörg Thalheim
04ba80f614 improve task manager to report exceptions better 2023-10-04 16:49:58 +02:00
clan-bot
a02a7e1fc5 Merge pull request 'clan-cli: add install command' (#383) from lassulus-install into main 2023-10-04 14:49:53 +00:00
lassulus
966a33e711 vm.create: define tmpdir 2023-10-04 16:46:30 +02:00
lassulus
b25af9f0f4 clan_cli: refactor secrets code into Machine class 2023-10-04 16:41:16 +02:00
lassulus
ffb7c63640 clan-cli: add machines install 2023-10-04 16:34:37 +02:00
lassulus
3c1d7a0553 secrets.password-store: ignore ssh errors 2023-10-04 16:34:37 +02:00
clan-bot
ff1fb784e7 Merge pull request 'clan-cli devShell: add editable install' (#397) from DavHau-dave into main 2023-10-04 09:43:27 +00:00
DavHau
e6d22e6426 clan-cli devShell: add editable install 2023-10-04 11:39:31 +02:00
clan-bot
5e1a26df1a Merge pull request 'rename test_basic to test_create_flake' (#396) from Mic92-main into main 2023-10-04 09:04:09 +00:00
Jörg Thalheim
1575e4a391 rename test_basic to test_create_flake 2023-10-04 11:01:12 +02:00
clan-bot
ba9b2f6de7 Merge pull request 'clan-cli: stop propagating build inputs, remove wrapper' (#395) from DavHau-dave into main 2023-10-04 08:38:44 +00:00
DavHau
017221febb clan-cli: stop propagating build inputs, remove wrapper 2023-10-04 10:36:39 +02:00
clan-bot
c0e2bfbcb8 Merge pull request 'quickstart: add user creation' (#394) from DavHau-dave into main 2023-10-04 08:20:31 +00:00
DavHau
9e6009b454 quickstart: add user creation 2023-10-04 10:18:28 +02:00
clan-bot
6059b262f1 Merge pull request 'restore possibility to update all machines without having to specify them' (#393) from Mic92-kvm-fix into main 2023-10-04 06:39:22 +00:00
Jörg Thalheim
fcd1d18e15 restore possibility to update all machines without having to specify them 2023-10-04 08:35:59 +02:00
clan-bot
061b91406d Merge pull request 'don't register global logger, this interferes currently with that we have in ssh.py' (#392) from Mic92-kvm-fix into main 2023-10-04 06:14:28 +00:00
Jörg Thalheim
7842c24c9d add binary cache and switch back to main branch of disko 2023-10-04 08:08:06 +02:00
Jörg Thalheim
80e37483a3 don't register global logger, this interferes currently with that we have in ssh.py 2023-10-04 08:08:06 +02:00
clan-bot
02086463eb Merge pull request 'make vm test also work in ci' (#391) from Mic92-kvm-fix into main 2023-10-03 16:53:15 +00:00
Jörg Thalheim
4abb7d7bf0 make vm test also work in ci 2023-10-03 18:50:14 +02:00
Mic92
4a1a6f525a Merge pull request 'clan_cli.secrets.groups: update keys if members are added/removed' (#389) from lassulus-secrets_cli into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/389
2023-10-03 16:15:36 +00:00
Jörg Thalheim
b2ef8bf1a3 also test that updating a group works 2023-10-03 16:15:36 +00:00
lassulus
6f7109dab6 clan_cli.secrets.groups: update keys if members are added/removed 2023-10-03 16:15:36 +00:00
clan-bot
f27f056fca Merge pull request 'task_manager: return task directly instead of uuid' (#390) from Mic92-HEAD into main 2023-10-03 15:53:25 +00:00
Jörg Thalheim
b23d2b65e1 task_manager: return task directly instead of uuid 2023-10-03 17:48:56 +02:00
Mic92
de3084066c Merge pull request 'Restructuring CLI to use API' (#387) from Qubasa-main into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/387
2023-10-03 15:34:33 +00:00
Jörg Thalheim
c0f6f78c9e Merge remote-tracking branch 'origin/main' into HEAD 2023-10-03 17:32:19 +02:00
Jörg Thalheim
2502422bc1 add test for vm cli 2023-10-03 17:24:08 +02:00
Jörg Thalheim
361ad990ab clan-cli/tests: skip tests if has no /dev/kvm 2023-10-03 17:24:08 +02:00
Jörg Thalheim
b1d045131a add missing e2fsprogs to runtime inputs 2023-10-03 17:24:08 +02:00
Jörg Thalheim
ff11340507 move out vm logic out of controller 2023-10-03 17:24:08 +02:00
Qubasa
dbe289f702 nix fmt 2023-10-03 15:22:41 +02:00
Qubasa
8fa241a36b Fixed upload_secrets_test 2023-10-03 15:14:50 +02:00
Qubasa
7dde66c0df Fixed upload_secrets_test 2023-10-03 15:10:22 +02:00
ui-asset-bot
986008cef7 update ui-assets.nix 2023-10-03 13:05:51 +00:00
clan-bot
7d114dee54 Merge pull request 'coporate color system: init' (#388) from feat/corp-theme into main 2023-10-03 13:04:48 +00:00
Johannes Kirschbauer
7eed3d9aa9 add build output 2023-10-03 15:02:47 +02:00
Qubasa
be9d3d43bf Fixing PYTHONPATH in secrets/generate test 2023-10-03 15:01:13 +02:00
Johannes Kirschbauer
e9f3be0056 coporate color system: init 2023-10-03 14:58:31 +02:00
Qubasa
cb2815c4d0 nix fmt 2023-10-03 14:39:29 +02:00
Qubasa
d8b69ec883 Added newlines against buffering for log streaming. Fixed cli 2023-10-03 14:38:51 +02:00
Qubasa
d25c3a0940 Added newlines against buffering 2023-10-03 14:36:15 +02:00
Qubasa
2bbed10117 Added better logging 2023-10-03 14:16:07 +02:00
Qubasa
8e98c50ccd Merge branch 'Qubasa-main' of git.clan.lol:clan/clan-core 2023-10-03 13:24:31 +02:00
Qubasa
e0051a0cba Updated to main 2023-10-03 13:20:22 +02:00
Qubasa
da72ec18ad API: Added test for inspect_flake 2023-10-03 13:19:20 +02:00
Qubasa
c1c68ee1d8 Fixed failing tests 2023-10-03 13:15:01 +02:00
Qubasa
7e180d2f12 CLI: Restructured TaskManager and log collection 2023-10-03 13:15:01 +02:00
Qubasa
af17c1bd7a Updated to main 2023-10-03 13:12:44 +02:00
Qubasa
167533d9ee API: Added test for inspect_flake 2023-10-03 12:50:47 +02:00
Qubasa
653ad99b22 Fixed failing tests 2023-10-03 11:51:31 +02:00
clan-bot
1c0c11a954 Merge pull request 'add error handling to endpoint' (#386) from feat/flake-attr into main 2023-10-03 09:44:50 +00:00
Johannes Kirschbauer
c40a7bf3fb smoke check error handling for create vm 2023-10-03 11:43:06 +02:00
Johannes Kirschbauer
16f44900a3 Beyoncé rule 2023-10-03 11:21:34 +02:00
Johannes Kirschbauer
3c11eece4d add error handling to endpoint 2023-10-03 11:12:06 +02:00
ui-asset-bot
1adcf6980b update ui-assets.nix 2023-10-03 08:59:15 +00:00
clan-bot
4075b355f3 Merge pull request 'AppState context add' (#382) from feat/join-workflow into main 2023-10-03 08:58:13 +00:00
Johannes Kirschbauer
a461024f82 reformat 2023-10-03 10:56:35 +02:00
Johannes Kirschbauer
b27dad1cc4 clean up unused js parts 2023-10-03 10:39:49 +02:00
Qubasa
814d81c1d2 CLI: Restructured TaskManager and log collection 2023-10-02 18:36:50 +02:00
Qubasa
6640c78089 CLI: Use API functions 2023-10-02 15:36:02 +02:00
Johannes Kirschbauer
7c1e04a7d6 Merge branch 'main' into feat/join-workflow 2023-10-02 15:27:13 +02:00
Johannes Kirschbauer
f9c35ceaa4 AppState context add 2023-10-01 22:47:09 +02:00
clan-bot
29efda9608 Merge pull request 'API: Added /api/flake_attrs' (#380) from Qubasa-main into main 2023-10-01 10:53:08 +00:00
Qubasa
ce7ae81a35 API: Added endpoint & test for /api/flake/attrs 2023-10-01 12:50:54 +02:00
ui-asset-bot
84bcfc3929 update ui-assets.nix 2023-09-30 14:13:37 +00:00
clan-bot
d6b5bac1ce Merge pull request 'refine join workflow' (#381) from feat/join-workflow into main 2023-09-30 14:12:39 +00:00
Johannes Kirschbauer
82db33d047 refine join workflow 2023-09-30 16:00:21 +02:00
clan-bot
332f5dc824 Merge pull request 'API: Improved vm_status and added some tests' (#379) from Qubasa-main into main 2023-09-30 09:10:45 +00:00
Qubasa
f224deace9 API: Improved vm_status and added some tests. Skip vm tests in VM 2023-09-30 11:08:42 +02:00
clan-bot
8d38ba93ff Merge pull request 'secrets.password-store: optimize secret existence check' (#378) from lassulus-no_facts into main 2023-09-30 07:39:00 +00:00
lassulus
62caf98f15 secrets.password-store: optimize secret existence check 2023-09-30 09:36:39 +02:00
clan-bot
55743928ae Merge pull request 'secrets: allow empty facts' (#377) from lassulus-no_facts into main 2023-09-30 07:29:34 +00:00
lassulus
347d9676c5 secrets.password-store: fix multi-secret check 2023-09-30 09:27:25 +02:00
clan-bot
b878df8813 Merge pull request 'secrets: allow empty facts' (#376) from lassulus-no_facts into main 2023-09-30 07:21:01 +00:00
lassulus
d810d2b4e1 secrets: allow empty facts 2023-09-30 09:18:24 +02:00
clan-bot
a6698c8301 Merge pull request 'clan-cli: init vm command' (#373) from lassulus-cli-vm into main 2023-09-29 18:30:17 +00:00
lassulus
6cdf5615fe clanCore.zerotier: create network-id only if fact exists 2023-09-29 20:05:35 +02:00
lassulus
6e3f2b1ce2 tests: add test_secrets_password_store 2023-09-29 20:05:35 +02:00
lassulus
89b7ffce6c clan-cli secrets upload: secrets are populated into tmpdir 2023-09-29 20:05:35 +02:00
lassulus
7ca9c49163 restore clanInternals with valid nixos config 2023-09-29 19:39:35 +02:00
lassulus
a5f181a430 clan-cli: init vm command 2023-09-29 19:18:27 +02:00
Mic92
7cb0b57e8f Merge pull request 'add zerotier documentation' (#375) from Mic92-main into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/375
2023-09-29 15:38:44 +00:00
Jörg Thalheim
09b6dcacfe add zerotier documentation 2023-09-29 15:38:44 +00:00
clan-bot
6a182bd910 Merge pull request 'add zerotier-members script' (#374) from Mic92-main into main 2023-09-29 15:11:46 +00:00
Jörg Thalheim
89e69e5cb6 add treewide pyproject.toml
Than we don't need a pyproject.toml per script
2023-09-29 16:41:14 +02:00
Jörg Thalheim
9daeaf5c62 zerotier: fix creating controller directory 2023-09-29 16:41:14 +02:00
Jörg Thalheim
5f15ec4495 add zerotier-members script 2023-09-29 16:07:22 +02:00
clan-bot
36fc57c0be Merge pull request 'also encrypt secret for the machine itself' (#372) from Mic92-main into main 2023-09-28 16:01:03 +00:00
Jörg Thalheim
739d3b3578 zerotier: document mdns ports; drop duplicate udp firewall rules
the nixos module already opens the zerotier port
2023-09-28 17:58:42 +02:00
Jörg Thalheim
be6592c82c also generate zerotier secret for vm 2023-09-28 17:57:44 +02:00
Jörg Thalheim
0c91bb90ab also encrypt secret for the machine itself 2023-09-28 17:51:37 +02:00
clan-bot
6fafae56b6 Merge pull request 'pregenerate ssh_host keys for tests' (#371) from Mic92-main into main 2023-09-28 14:37:52 +00:00
Jörg Thalheim
7184fe277d webui: fix warning 2023-09-28 16:31:59 +02:00
Jörg Thalheim
2375bafbae pregenerate ssh_host keys for tests
Then we are free to choose where to put the ssh config
2023-09-28 16:31:59 +02:00
clan-bot
6e8e12df6d Merge pull request 'drop bear from buildinputs of nix-unit' (#370) from Mic92-main into main 2023-09-28 14:03:46 +00:00
Jörg Thalheim
9242b3d118 also evaluate for aarch64-darwin 2023-09-28 16:01:42 +02:00
Jörg Thalheim
156f792bf3 drop bear from buildinputs of nix-unit 2023-09-28 15:56:52 +02:00
clan-bot
6963e22dfc Merge pull request 'fix secrets script not beeing fetched' (#369) from Mic92-main into main 2023-09-28 13:53:35 +00:00
Jörg Thalheim
b366beeb2e fix secrets script not beeing fetched 2023-09-28 15:51:09 +02:00
clan-bot
440e0ddcdf Merge pull request 'fix pname of clan-cli for nix run' (#368) from Mic92-main into main 2023-09-28 13:26:20 +00:00
Jörg Thalheim
5a7c4120b6 tests: increase timeout to 60 2023-09-28 15:24:06 +02:00
Jörg Thalheim
16b33eb0a8 add toplevel machines-json that can deploy all hosts 2023-09-28 15:23:25 +02:00
Jörg Thalheim
293e7f8ae6 drop unused findNixFiles function 2023-09-28 14:21:03 +02:00
Jörg Thalheim
91c8b9c64f fix pname of clan-cli for nix run 2023-09-28 14:06:35 +02:00
clan-bot
deba9ebffd Merge pull request 'clan-cli: symlink cli into an otherwise empty package' (#366) from Mic92-main into main 2023-09-28 10:22:56 +00:00
Jörg Thalheim
1a926f6cf3 clan-cli: fix eval 2023-09-28 12:20:26 +02:00
clan-bot
115193a06b Merge pull request 'clan-cli: symlink cli into an otherwise empty package' (#365) from Mic92-main into main 2023-09-28 10:19:51 +00:00
Jörg Thalheim
0f1b7cf916 clan-cli: symlink cli into an otherwise empty package
This avoids propagating unneeded python libraries
2023-09-28 12:19:16 +02:00
clan-bot
2abaab401d Merge pull request 'don't propagate python libraries into a devshell' (#364) from Mic92-main into main 2023-09-28 10:00:46 +00:00
Jörg Thalheim
8467457283 don't propagate python libraries into a devshell 2023-09-28 11:58:09 +02:00
clan-bot
8014bd7181 Merge pull request 'use buildPythonApplication to shield against external PYTHONPATH' (#363) from Mic92-main into main 2023-09-28 09:23:36 +00:00
Jörg Thalheim
d55abacfcb use buildPythonApplication to shield against external PYTHONPATH 2023-09-28 11:19:16 +02:00
clan-bot
5d09299870 Merge pull request 'webui: pretty urls by also appending .html' (#362) from Mic92-main into main 2023-09-28 09:12:43 +00:00
Jörg Thalheim
cc70537a91 webui: pretty urls by also appending .html 2023-09-28 11:09:31 +02:00
clan-bot
96df913184 Merge pull request 'secrets.password-store: readd targetDirectory' (#361) from lassulus-HEAD into main 2023-09-27 19:28:42 +00:00
lassulus
b587bd1b49 secrets.password-store: readd targetDirectory 2023-09-27 21:26:58 +02:00
clan-bot
1bf4ab22e4 Merge pull request 'clan update: fix deploymentAddress' (#360) from Mic92-main into main 2023-09-27 19:14:07 +00:00
Jörg Thalheim
3f814c1e5f clan update: fix deploymentAddress 2023-09-27 21:11:52 +02:00
clan-bot
192c396000 Merge pull request 'docs/quickstart: fix typo' (#359) from lassulus-stuff into main 2023-09-27 17:10:14 +00:00
lassulus
dafceb6fea clan-cli: add desktop item 2023-09-27 19:04:12 +02:00
lassulus
0bc8f88276 docs/quickstart: fix typo 2023-09-27 19:02:16 +02:00
clan-bot
73a9b6a172 Merge pull request 'clanInternals.machines: expose information as json' (#358) from Mic92-main into main 2023-09-27 16:45:18 +00:00
Jörg Thalheim
85f7e2f2cd clanInternals.machines: expose information as json 2023-09-27 18:42:49 +02:00
clan-bot
628fcd5e04 Merge pull request 'clanInternals.machines: invert system and machine name' (#357) from Mic92-main into main 2023-09-27 15:29:03 +00:00
Jörg Thalheim
756820e4ca clanInternals.machines: invert system and machine name 2023-09-27 17:26:44 +02:00
clan-bot
a158ab0421 Merge pull request 'fix clan-pytest build' (#356) from Mic92-main into main 2023-09-27 14:22:11 +00:00
Jörg Thalheim
59f0a912ea fix clan-pytest build 2023-09-27 16:20:05 +02:00
clan-bot
bf49bacb4e Merge pull request 'move temporary directory to .direnv' (#355) from Mic92-main into main 2023-09-27 14:15:34 +00:00
Jörg Thalheim
e970dcb658 move temporary directory to .direnv 2023-09-27 16:13:04 +02:00
ui-asset-bot
5b1c5eaef0 update ui-assets.nix 2023-09-27 13:20:43 +00:00
clan-bot
36b37f6fdd Merge pull request 'only pass experimental-features onces to nix-build' (#354) from Mic92-main into main 2023-09-27 13:19:53 +00:00
Jörg Thalheim
66210d176f ui/envrc: watch more files 2023-09-27 15:18:51 +02:00
Mic92
612a9e411c Merge pull request 'jsonschema: fix eval' (#353) from Mic92-main into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/353
2023-09-27 13:08:24 +00:00
Jörg Thalheim
c0799ce425 jsonschema: fix eval 2023-09-27 13:08:24 +00:00
Jörg Thalheim
166a2f795f only pass experimental-features onces to nix-build 2023-09-27 13:08:24 +00:00
clan-bot
e5cfafe924 Merge pull request 'drop requirement for importing qemu-vm.nix' (#352) from Mic92-main into main 2023-09-27 12:55:59 +00:00
Jörg Thalheim
2f73e6b472 drop requirement for importing qemu-vm.nix 2023-09-27 14:54:01 +02:00
clan-bot
c2f276235b Merge pull request 'vms: simplify args passed to create_subprocess_exec' (#351) from Mic92-main into main 2023-09-27 10:32:25 +00:00
Jörg Thalheim
974f07628b vms: simplify args passed to create_subprocess_exec 2023-09-27 12:30:06 +02:00
Mic92
041a98fae4 Merge pull request 'api/vm/create: start vm' (#327) from lassulus-start-vm into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/327
2023-09-27 09:47:50 +00:00
Jörg Thalheim
4317e681cf cli: fix remaining typing errors 2023-09-27 09:47:50 +00:00
Jörg Thalheim
244ae37144 cli: simplify log handler 2023-09-27 09:47:50 +00:00
Jörg Thalheim
e5899c8e10 custom_logger: fix type errror in format_time 2023-09-27 09:47:50 +00:00
Jörg Thalheim
80aa7f06fb task_manager: assert stdout/stderr exist to make mypy happy 2023-09-27 09:47:50 +00:00
Jörg Thalheim
b343650771 make vm terminate after boot 2023-09-27 09:47:50 +00:00
Jörg Thalheim
dea49073cb cli/vms: serialize uuid already in the api 2023-09-27 09:47:50 +00:00
Qubasa
08eab785c6 Completely working log streaming 2023-09-27 09:47:50 +00:00
Qubasa
8d390af122 Working log streaming 2023-09-27 09:47:50 +00:00
Qubasa
82c3d91e85 Working version 2023-09-27 09:47:50 +00:00
Qubasa
a8bab7bb96 Working log streaming 2023-09-27 09:47:50 +00:00
Qubasa
98028d121f Working log streaming 2023-09-27 09:47:50 +00:00
Qubasa
3a11c0a746 Fixed vscode test debugging problem 2023-09-27 09:47:50 +00:00
Qubasa
991181bf3c Integrated pytest into vscode 2023-09-27 09:47:50 +00:00
Qubasa
c2fb42e953 Extracted threadpool to task_manager.py 2023-09-27 09:47:50 +00:00
Qubasa
04f3547be0 Added test 2023-09-27 09:47:50 +00:00
Qubasa
f6c8b963c1 Improving endpoint 2023-09-27 09:47:50 +00:00
Qubasa
d16bb5db26 Added threaded create_vm endpoint 2023-09-27 09:47:50 +00:00
Qubasa
7479fca82b Started working on vm_create 2023-09-27 09:47:50 +00:00
Qubasa
b86e02e183 vscode debugging integration added + README updated 2023-09-27 09:47:50 +00:00
Qubasa
9dca1a4672 CLI: Added custom logger 2023-09-27 09:47:50 +00:00
lassulus
904301c20e api/vm/create: start vm 2023-09-27 09:47:50 +00:00
clan-bot
2e5811e052 Merge pull request 'clanCore.secrets: facts.value can be null or str' (#350) from lassulus-facts_null into main 2023-09-27 09:06:10 +00:00
lassulus
c1a124d0bf clan.networking.zerotier: create init script only if fact exists 2023-09-27 11:02:54 +02:00
lassulus
5cf9b4428f clanCore.secrets: facts.value can be null or str 2023-09-27 10:34:53 +02:00
Mic92
51c1940a1b Merge pull request 'zerotier: fix eval' (#349) from Mic92-docs into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/349
2023-09-26 16:24:26 +00:00
Jörg Thalheim
cbd8efeb85 nix-unit: bump version 2023-09-26 16:24:26 +00:00
Mic92
4b966ae642 Merge pull request 'zerotier: fix eval' (#348) from Mic92-docs into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/348
2023-09-26 16:19:43 +00:00
Jörg Thalheim
0d41bec9ef zerotier: fix eval 2023-09-26 16:19:43 +00:00
Mic92
dd870ae903 Merge pull request 'move zerotier secret generation into nixos module' (#347) from Mic92-docs into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/347
2023-09-26 16:17:44 +00:00
Jörg Thalheim
6e1a5ad81f move zerotier secret generation into nixos module 2023-09-26 18:14:00 +02:00
clan-bot
079d727a2c Merge pull request 'make zerotier module a directory' (#346) from Mic92-docs into main 2023-09-26 16:03:12 +00:00
Jörg Thalheim
c771339259 fix nix-unit build 2023-09-26 18:00:16 +02:00
Jörg Thalheim
74a3c85c29 move zerotier secret generation into nixos module 2023-09-26 17:57:43 +02:00
Jörg Thalheim
5d9ee64ddc make zerotier module a directory 2023-09-26 15:55:41 +02:00
clan-bot
45ae86f001 Merge pull request 'use shellSession everywhere for markdown' (#345) from Mic92-docs into main 2023-09-26 13:52:23 +00:00
Jörg Thalheim
49c17cc6d0 drop wonky ipdb PYTHONBREAKPOINT 2023-09-26 15:50:02 +02:00
Jörg Thalheim
5ea6c7790f use shellSession everywhere for markdown 2023-09-26 15:49:45 +02:00
clan-bot
8ab7d97301 Merge pull request 'replace bubblewrap with fakeroot' (#344) from Mic92-docs into main 2023-09-26 13:48:58 +00:00
Mic92
3a413a811c Merge pull request 'replace bubblewrap with fakeroot' (#343) from joerg-ci into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/343
2023-09-26 13:48:30 +00:00
Jörg Thalheim
87aa063e86 create test_flake unique per test
otherwise we will have race conditions
2023-09-26 15:46:40 +02:00
Jörg Thalheim
7eab8c22cf replace bubblewrap with fakeroot
this restores macOS support.
2023-09-26 15:33:45 +02:00
clan-bot
677494811b Merge pull request 'clan config: print command in more instances' (#342) from Mic92-docs into main 2023-09-26 12:13:09 +00:00
clan-bot
da1927581d Merge pull request 'unpin nix-fast-build' (#341) from Mic92-docs into main 2023-09-26 12:02:05 +00:00
clan-bot
11d13cd03f Merge pull request 'clan.networking.zerotier: fix controller mode' (#340) from lassulus-zerotier into main 2023-09-26 11:15:09 +00:00
lassulus
2cdc959a77 clan.networking.zerotier: fix controller mode 2023-09-25 19:11:16 +02:00
clan-bot
0b50e2d29c Merge pull request 'Automatic flake update - 2023-09-25T00:00+00:00' (#339) from flake-update-2023-09-25 into main 2023-09-25 00:03:45 +00:00
Clan Merge Bot
e3f4bddcd0 update flake lock - 2023-09-25T00:00+00:00
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/ace5093e36ab1e95cb9463863491bee90d5a4183' (2023-09-15)
  → 'github:NixOS/nixpkgs/e35dcc04a3853da485a396bdd332217d0ac9054f' (2023-09-22)
• Updated input 'sops-nix':
    'github:Mic92/sops-nix/ea208e55f8742fdcc0986b256bdfa8986f5e4415' (2023-09-12)
  → 'github:Mic92/sops-nix/2f375ed8702b0d8ee2430885059d5e7975e38f78' (2023-09-21)
• Updated input 'treefmt-nix':
    'github:numtide/treefmt-nix/7a49c388d7a6b63bb551b1ddedfa4efab8f400d8' (2023-09-12)
  → 'github:numtide/treefmt-nix/e951529be2e7c669487de78f5aef8597bbae5fca' (2023-09-21)
2023-09-25 00:00:15 +00:00
clan-bot
01441b1f5a Merge pull request 'clan config: support new types nullOr and passwdEntry' (#338) from DavHau-dave into main 2023-09-24 13:30:35 +00:00
DavHau
3783359f08 clan config: support new types nullOr and passwdEntry 2023-09-24 14:24:48 +01:00
clan-bot
851e33d794 Merge pull request 'clan config: match dynamic options containing <name>' (#337) from DavHau-dave into main 2023-09-24 12:06:54 +00:00
DavHau
ec70b34470 clan config: match dynamic options containing <name> 2023-09-24 13:04:37 +01:00
clan-bot
765f982d11 Merge pull request 'quickstart: improve and add machines section' (#336) from DavHau-dave into main 2023-09-24 07:54:36 +00:00
DavHau
26972ca194 clan-cli: add --debug section 2023-09-24 08:53:26 +01:00
DavHau
45009d52ee quickstart: improve and add machines section 2023-09-24 08:53:26 +01:00
Mic92
bf53dd56c5 Merge pull request 'unpin nix-fast-build' (#334) from Mic92-docs into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/334
2023-09-23 12:27:35 +00:00
Jörg Thalheim
ae2ab090bf unpin nix-fast-build 2023-09-23 12:27:35 +00:00
ui-asset-bot
178a52722e update ui-assets.nix 2023-09-23 11:28:08 +00:00
clan-bot
22fe132348 Merge pull request 'inspect flake before configure VM' (#335) from feat/inspect-flake into main 2023-09-23 11:27:20 +00:00
Johannes Kirschbauer
f3e66bd5a6 format python 2023-09-23 13:25:43 +02:00
Johannes Kirschbauer
09364671b3 inspect flake before configure VM 2023-09-23 13:20:25 +02:00
1458 changed files with 11886 additions and 100777 deletions

10
.envrc
View File

@@ -1,13 +1,5 @@
# shellcheck shell=bash
if ! has nix_direnv_version || ! nix_direnv_version 3.0.4; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.4/direnvrc" "sha256-DzlYZ33mWF/Gs8DDeyjr8mnVmQGx7ASYqA5WlxwvBG4="
fi
watch_file .direnv/selected-shell
watch_file formatter.nix
if [ -e .direnv/selected-shell ]; then
use flake ".#$(cat .direnv/selected-shell)"
else
use flake
fi
use flake

View File

@@ -1,20 +0,0 @@
name: Build Clan App (Darwin)
on:
schedule:
# Run every 4 hours
- cron: "0 */4 * * *"
workflow_dispatch:
push:
branches:
- main
jobs:
build-clan-app-darwin:
runs-on: nix
steps:
- uses: actions/checkout@v4
- name: Build clan-app for x86_64-darwin
run: |
nix build .#packages.x86_64-darwin.clan-app --system x86_64-darwin --log-format bar-with-logs

View File

@@ -0,0 +1,12 @@
name: checks-impure
on:
pull_request:
push:
branches: main
jobs:
test:
if: ${{ github.actor != 'ui-asset-bot' }}
runs-on: nix
steps:
- uses: actions/checkout@v3
- run: nix run .#impure-checks

View File

@@ -1,9 +1,12 @@
name: checks
on:
pull_request:
push:
branches: main
jobs:
checks-impure:
test:
if: ${{ github.actor != 'ui-asset-bot' }}
runs-on: nix
steps:
- uses: actions/checkout@v4
- run: nix run .#impure-checks
- uses: actions/checkout@v3
- run: nix run --refresh github:Mic92/nix-fast-build -- --no-nom --eval-workers 20

View File

@@ -1,82 +0,0 @@
#!/bin/sh
# Shared script for creating pull requests in Gitea workflows
set -eu
# Required environment variables:
# - CI_BOT_TOKEN: Gitea bot token for authentication
# - PR_BRANCH: Branch name for the pull request
# - PR_TITLE: Title of the pull request
# - PR_BODY: Body/description of the pull request
if [ -z "${CI_BOT_TOKEN:-}" ]; then
echo "Error: CI_BOT_TOKEN is not set" >&2
exit 1
fi
if [ -z "${PR_BRANCH:-}" ]; then
echo "Error: PR_BRANCH is not set" >&2
exit 1
fi
if [ -z "${PR_TITLE:-}" ]; then
echo "Error: PR_TITLE is not set" >&2
exit 1
fi
if [ -z "${PR_BODY:-}" ]; then
echo "Error: PR_BODY is not set" >&2
exit 1
fi
# Push the branch
git push origin "+HEAD:${PR_BRANCH}"
# Create pull request
resp=$(nix run --inputs-from . nixpkgs#curl -- -X POST \
-H "Authorization: token $CI_BOT_TOKEN" \
-H "Content-Type: application/json" \
-d "{
\"head\": \"${PR_BRANCH}\",
\"base\": \"main\",
\"title\": \"${PR_TITLE}\",
\"body\": \"${PR_BODY}\"
}" \
"https://git.clan.lol/api/v1/repos/clan/clan-core/pulls")
if ! pr_number=$(echo "$resp" | jq -r '.number'); then
echo "Error parsing response from pull request creation" >&2
exit 1
fi
if [ "$pr_number" = "null" ]; then
echo "Error creating pull request:" >&2
echo "$resp" | jq . >&2
exit 1
fi
echo "Created pull request #$pr_number"
# Merge when checks succeed
while true; do
resp=$(nix run --inputs-from . nixpkgs#curl -- -X POST \
-H "Authorization: token $CI_BOT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"Do": "merge",
"merge_when_checks_succeed": true,
"delete_branch_after_merge": true
}' \
"https://git.clan.lol/api/v1/repos/clan/clan-core/pulls/$pr_number/merge")
if ! msg=$(echo "$resp" | jq -r '.message'); then
echo "Error parsing merge response" >&2
exit 1
fi
if [ "$msg" != "Please try again later" ]; then
break
fi
echo "Retrying in 2 seconds..."
sleep 2
done
echo "Pull request #$pr_number merge initiated"

View File

@@ -1,13 +0,0 @@
name: deploy
on:
push:
branches:
- main
jobs:
deploy-docs:
runs-on: nix
steps:
- uses: actions/checkout@v4
- run: nix run .#deploy-docs
env:
SSH_HOMEPAGE_KEY: ${{ secrets.SSH_HOMEPAGE_KEY }}

View File

@@ -1,28 +0,0 @@
name: "Update pinned clan-core for checks"
on:
repository_dispatch:
workflow_dispatch:
schedule:
- cron: "51 2 * * *"
jobs:
update-pinned-clan-core:
runs-on: nix
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Update clan-core for checks
run: nix run .#update-clan-core-for-checks
- name: Create pull request
env:
CI_BOT_TOKEN: ${{ secrets.CI_BOT_TOKEN }}
run: |
export GIT_AUTHOR_NAME=clan-bot GIT_AUTHOR_EMAIL=clan-bot@clan.lol GIT_COMMITTER_NAME=clan-bot GIT_COMMITTER_EMAIL=clan-bot@clan.lol
git commit -am "Update pinned clan-core for checks"
# Use shared PR creation script
export PR_BRANCH="update-clan-core-for-checks"
export PR_TITLE="Update Clan Core for Checks"
export PR_BODY="This PR updates the pinned clan-core flake input that is used for checks."
./.gitea/workflows/create-pr.sh

View File

@@ -1,26 +0,0 @@
name: Update Flake Inputs
on:
schedule:
# Run every 5 hours
- cron: "0 */5 * * *"
workflow_dispatch:
repository_dispatch:
jobs:
update-flake-inputs:
runs-on: nix
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update flake inputs
uses: Mic92/update-flake-inputs-gitea@main
with:
# Exclude private flakes and update-clan-core checks flake
exclude-patterns: "devFlake/private/flake.nix,checks/impure/flake.nix"
auto-merge: true
gitea-token: ${{ secrets.CI_BOT_TOKEN }}
github-token: ${{ secrets.CI_BOT_GITHUB_TOKEN }}

View File

@@ -1,40 +0,0 @@
name: "Update private flake inputs"
on:
repository_dispatch:
workflow_dispatch:
schedule:
- cron: "0 3 * * *" # Run daily at 3 AM
jobs:
update-private-flake:
runs-on: nix
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Update private flake inputs
run: |
# Update the private flake lock file
cd devFlake/private
nix flake update
cd ../..
# Update the narHash
bash ./devFlake/update-private-narhash
- name: Create pull request
env:
CI_BOT_TOKEN: ${{ secrets.CI_BOT_TOKEN }}
run: |
export GIT_AUTHOR_NAME=clan-bot GIT_AUTHOR_EMAIL=clan-bot@clan.lol GIT_COMMITTER_NAME=clan-bot GIT_COMMITTER_EMAIL=clan-bot@clan.lol
# Check if there are any changes
if ! git diff --quiet; then
git add devFlake/private/flake.lock devFlake/private.narHash
git commit -m "Update dev flake"
# Use shared PR creation script
export PR_BRANCH="update-dev-flake"
export PR_TITLE="Update dev flake"
export PR_BODY="This PR updates the dev flake inputs and corresponding narHash."
else
echo "No changes detected in dev flake inputs"
fi

View File

@@ -1,6 +0,0 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

View File

@@ -1,28 +0,0 @@
name: Github<->Gitea sync
on:
schedule:
- cron: "39 * * * *"
workflow_dispatch:
permissions:
contents: write
jobs:
repo-sync:
if: github.repository_owner == 'clan-lol'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.CI_APP_ID }}
private-key: ${{ secrets.CI_PRIVATE_KEY }}
- name: repo-sync
uses: repo-sync/github-sync@v2
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
with:
source_repo: "https://git.clan.lol/clan/clan-core.git"
source_branch: "main"
destination_branch: "main"

44
.gitignore vendored
View File

@@ -1,23 +1,17 @@
.direnv
.nixos-test-history
.hypothesis
***/.hypothesis
out.log
.coverage.*
pkgs/repro-hook
testdir
**/qubeclan
**/testdir
democlan
example_clan
result*
/pkgs/clan-cli/clan_lib/nixpkgs
/pkgs/clan-cli/clan_cli/nixpkgs
/pkgs/clan-cli/clan_cli/webui/assets
/machines
nixos.qcow2
*.glade~
/docs/out
/pkgs/clan-cli/clan_lib/select
.local.env
# macOS stuff
.DS_Store
**/*.glade~
# python
__pycache__
@@ -27,29 +21,3 @@ __pycache__
.reports
.ruff_cache
htmlcov
# node
node_modules
dist
.webui
# TODO: remove after bug in select is fixed
select
# Generated files
pkgs/clan-app/ui/api/API.json
pkgs/clan-app/ui/api/API.ts
pkgs/clan-app/ui/api/Inventory.ts
pkgs/clan-app/ui/api/modules_schemas.json
pkgs/clan-app/ui/api/schema.json
pkgs/clan-app/ui/.fonts
# To avoid accidentally committing large files
# Can be added with `git add -f` after reviewing the filesize
# Large files should be avoided or stored externally i.e. a gitea release
*.jpg
*.png
*.jpeg
*.gif
*.mp4
*.mkv

View File

@@ -1,2 +0,0 @@
nixosModules/clanCore/vars/.* @lopter
pkgs/clan-cli/clan_cli/(secrets|vars)/.* @lopter

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

@@ -1,19 +0,0 @@
Copyright 2023-2024 Clan contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,45 +1,23 @@
# Clan core repository
# cLAN Core Repository
Welcome to the Clan core repository, the heart of the [clan.lol](https://clan.lol/) project! This monorepo is the foundation of Clan, a revolutionary open-source project aimed at restoring fun, freedom, and functionality to computing. Here, you'll find all the essential packages, NixOS modules, CLI tools, and tests needed to contribute to and work with the Clan project. Clan leverages the Nix system to ensure reliability, security, and seamless management of digital environments, putting the power back into the hands of users.
Welcome to the cLAN Core Repository, the heart of the [clan.lol](https://clan.lol/) project! This monorepo houses all the essential packages, NixOS modules, CLI tools, and tests you need to contribute and work with the cLAN project.
## Why Clan?
## Getting Started
Our mission is simple: to democratize computing by providing tools that empower users, foster innovation, and challenge outdated paradigms. Clan represents our contribution to a future where technology serves humanity, not the other way around. By participating in Clan, you're joining a movement dedicated to creating a secure, user-empowered digital future.
If you're new to cLAN and eager to dive in, start with our quickstart guide:
## Features of Clan
- **Quickstart Guide**: Check out [quickstart.md](docs/quickstart.md) to get up and running with cLAN in no time.
- **Full-Stack System Deployment:** Utilize Clans toolkit alongside Nix's reliability to build and manage systems effortlessly.
- **Overlay Networks:** Secure, private communication channels between devices.
- **Virtual Machine Integration:** Seamless operation of VM applications within the main operating system.
- **Robust Backup Management:** Long-term, self-hosted data preservation.
- **Intuitive Secret Management:** Simplified encryption and password management processes.
## Managing Secrets
## Getting started with Clan
Security is paramount, and cLAN provides guidelines for handling secrets effectively:
If you're new to Clan and eager to dive in, start with our quickstart guide and explore the core functionalities that Clan offers:
- **Secrets Management**: Learn how to manage secrets securely by reading [secrets-management.md](docs/secrets-management.md).
- **Quickstart Guide**: Check out [getting started](https://docs.clan.lol/#starting-with-a-new-clan-project)<!-- [docs/site/index.md](docs/site/index.md) --> to get up and running with Clan in no time.
## Contributing to cLAN
### Managing secrets
We welcome contributions from the community, and we've prepared a comprehensive guide to help you get started:
In the Clan ecosystem, security is paramount. Learn how to handle secrets effectively:
- **Secrets Management**: Securely manage secrets by consulting [Vars](https://docs.clan.lol/guides/vars-backend/)<!-- [secrets.md](docs/site/guides/vars-backend.md) -->.
### Contributing to Clan
The Clan project thrives on community contributions. We welcome everyone to contribute and collaborate:
- **Contribution Guidelines**: Make a meaningful impact by following the steps in [contributing](https://docs.clan.lol/contributing/contributing/)<!-- [contributing.md](docs/CONTRIBUTING.md) -->.
## Join the revolution
Clan is more than a tool; it's a movement towards a better digital future. By contributing to the Clan project, you're part of changing technology for the better, together.
### Community and support
Connect with us and the Clan community for support and discussion:
- [Matrix channel](https://matrix.to/#/#clan:clan.lol) for live discussions.
- IRC bridge on [hackint#clan](https://chat.hackint.org/#/connect?join=clan) for real-time chat support.
- **Contribution Guidelines**: Find out how to contribute and make a meaningful impact on the cLAN project by reading [contributing.md](docs/contributing.md).
Whether you're a newcomer or a seasoned developer, we look forward to your contributions and collaboration on the cLAN project. Let's build amazing things together!

View File

@@ -1,41 +0,0 @@
{ self, pkgs, ... }:
{
name = "app-ocr-smoke-test";
enableOCR = true;
nodes = {
wayland =
{ modulesPath, ... }:
{
imports = [ (modulesPath + "/../tests/common/wayland-cage.nix") ];
services.cage.program = "${self.packages.${pkgs.system}.clan-app}/bin/clan-app";
virtualisation.memorySize = 2047;
# TODO: get rid of this and fix debus-proxy error instead
services.cage.environment.WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS = "1";
};
xorg =
{ pkgs, modulesPath, ... }:
{
imports = [
(modulesPath + "/../tests/common/user-account.nix")
(modulesPath + "/../tests/common/x11.nix")
];
virtualisation.memorySize = 2047;
services.xserver.enable = true;
services.xserver.displayManager.sessionCommands = "${
self.packages.${pkgs.system}.clan-app
}/bin/clan-app";
test-support.displayManager.auto.user = "alice";
};
};
testScript = ''
start_all()
wayland.wait_for_unit('graphical.target')
xorg.wait_for_unit('graphical.target')
wayland.wait_for_text('Welcome to Clan')
xorg.wait_for_text('Welcome to Clan')
'';
}

View File

@@ -1,106 +1,52 @@
{ self, ... }:
{
clan.machines.test-backup = {
imports = [ self.nixosModules.test-backup ];
fileSystems."/".device = "/dev/null";
boot.loader.grub.device = "/dev/null";
};
clan.inventory.services = {
borgbackup.test-backup = {
roles.client.machines = [ "test-backup" ];
roles.server.machines = [ "test-backup" ];
let
clan = self.lib.buildClan {
clanName = "testclan";
directory = ../..;
machines = {
test_backup_client = {
imports = [ self.nixosModules.test_backup_client ];
fileSystems."/".device = "/dev/null";
boot.loader.grub.device = "/dev/null";
};
};
};
in
{
flake.nixosConfigurations = { inherit (clan.nixosConfigurations) test_backup_client; };
flake.clanInternals.machines = clan.clanInternals.machines;
flake.nixosModules = {
test-backup =
{
pkgs,
lib,
...
}:
test_backup_server = { ... }: {
imports = [
self.clanModules.borgbackup
];
services.sshd.enable = true;
services.borgbackup.repos.testrepo = {
authorizedKeys = [
(builtins.readFile ../lib/ssh/pubkey)
];
};
};
test_backup_client = { pkgs, lib, config, ... }:
let
dependencies =
[
pkgs.stdenv.drvPath
]
++ builtins.map (i: i.outPath) (builtins.attrValues (builtins.removeAttrs self.inputs [ "self" ]));
dependencies = [
self
pkgs.stdenv.drvPath
clan.clanInternals.machines.x86_64-linux.test_backup_client.config.system.clan.deployment.file
] ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs);
closureInfo = pkgs.closureInfo { rootPaths = dependencies; };
in
{
imports = [
# Do not import inventory modules. They should be configured via 'clan.inventory'
#
# TODO: Configure localbackup via inventory
self.clanModules.localbackup
self.clanModules.borgbackup
];
networking.hostName = "client";
services.sshd.enable = true;
users.users.root.openssh.authorizedKeys.keyFiles = [
../lib/ssh/pubkey
];
# Borgbackup overrides
services.borgbackup.repos.test-backups = {
path = "/var/lib/borgbackup/test-backups";
authorizedKeys = [ (builtins.readFile ../assets/ssh/pubkey) ];
};
clan.borgbackup.destinations.test-backup.repo = lib.mkForce "borg@machine:.";
clan.core.networking.targetHost = "machine";
networking.hostName = "machine";
programs.ssh.knownHosts = {
machine.hostNames = [ "machine" ];
machine.publicKey = builtins.readFile ../assets/ssh/pubkey;
};
services.openssh = {
enable = true;
settings.UsePAM = false;
settings.UseDns = false;
hostKeys = [
{
path = "/root/.ssh/id_ed25519";
type = "ed25519";
}
];
};
users.users.root.openssh.authorizedKeys.keyFiles = [ ../assets/ssh/pubkey ];
# This is needed to unlock the user for sshd
# Because we use sshd without setuid binaries
users.users.borg.initialPassword = "hello";
systemd.tmpfiles.settings."vmsecrets" = {
"/root/.ssh/id_ed25519" = {
C.argument = "${../assets/ssh/privkey}";
z = {
mode = "0400";
user = "root";
};
};
"/etc/secrets/ssh.id_ed25519" = {
C.argument = "${../assets/ssh/privkey}";
z = {
mode = "0400";
user = "root";
};
};
"/etc/secrets/borgbackup/borgbackup.ssh" = {
C.argument = "${../assets/ssh/privkey}";
z = {
mode = "0400";
user = "root";
};
};
"/etc/secrets/borgbackup/borgbackup.repokey" = {
C.argument = builtins.toString (pkgs.writeText "repokey" "repokey12345");
z = {
mode = "0400";
user = "root";
};
};
};
clan.core.facts.secretStore = "vm";
clan.core.vars.settings.secretStore = "vm";
environment.systemPackages = [ self.packages.${pkgs.system}.clan-cli ];
environment.etc.install-closure.source = "${closureInfo}/store-paths";
environment.etc."install-closure".source = "${closureInfo}/store-paths";
nix.settings = {
substituters = lib.mkForce [ ];
hashed-mirrors = null;
@@ -108,103 +54,75 @@
flake-registry = pkgs.writeText "flake-registry" ''{"flakes":[],"version":2}'';
};
system.extraDependencies = dependencies;
clan.core.state.test-backups.folders = [ "/var/test-backups" ];
clan.core.state.test-service = {
preBackupScript = ''
touch /var/test-service/pre-backup-command
'';
preRestoreScript = ''
touch /var/test-service/pre-restore-command
'';
postRestoreScript = ''
touch /var/test-service/post-restore-command
'';
folders = [ "/var/test-service" ];
};
fileSystems."/mnt/external-disk" = {
device = "/dev/vdb"; # created in tests with virtualisation.emptyDisks
autoFormat = true;
fsType = "ext4";
options = [
"defaults"
"noauto"
];
};
clan.localbackup.targets.hdd = {
directory = "/mnt/external-disk";
preMountHook = ''
touch /run/mount-external-disk
'';
postUnmountHook = ''
touch /run/unmount-external-disk
'';
clanCore.state.test-backups.folders = [ "/var/test-backups" ];
clan.borgbackup = {
enable = true;
destinations.test_backup_server = {
repo = "borg@server:.";
rsh = "ssh -i /root/.ssh/id_ed25519 -o StrictHostKeyChecking=no";
};
};
};
};
perSystem =
{ pkgs, ... }:
let
clanCore = self.checks.x86_64-linux.clan-core-for-checks;
in
{
checks = pkgs.lib.mkIf pkgs.stdenv.isLinux {
nixos-test-backups = self.clanLib.test.containerTest {
name = "nixos-test-backups";
nodes.machine = {
imports =
[
perSystem = { nodes, pkgs, ... }: {
checks = pkgs.lib.mkIf (pkgs.stdenv.isLinux) {
test-backups =
(import ../lib/test-base.nix)
{
name = "test-backups";
nodes.server = {
imports = [
self.nixosModules.test_backup_server
self.nixosModules.clanCore
# Some custom overrides for the backup tests
self.nixosModules.test-backup
]
++
# import the inventory generated nixosModules
self.clan.clanInternals.inventoryClass.machines.test-backup.machineImports;
clan.core.settings.directory = ./.;
};
{
clanCore.machineName = "server";
clanCore.clanDir = ../..;
}
];
};
nodes.client = {
imports = [
self.nixosModules.test_backup_client
self.nixosModules.clanCore
{
clanCore.machineName = "client";
clanCore.clanDir = ../..;
}
];
};
testScript = ''
import json
start_all()
testScript = ''
import json
start_all()
# dummy data
machine.succeed("mkdir -p /var/test-backups /var/test-service")
machine.succeed("echo testing > /var/test-backups/somefile")
# setup
client.succeed("mkdir -m 700 /root/.ssh")
client.succeed(
"cat ${../lib/ssh/privkey} > /root/.ssh/id_ed25519"
)
client.succeed("chmod 600 /root/.ssh/id_ed25519")
client.wait_for_unit("sshd", timeout=30)
client.succeed("ssh -o StrictHostKeyChecking=accept-new root@client hostname")
# create
machine.succeed("clan backups create --debug --flake ${clanCore} test-backup")
machine.wait_until_succeeds("! systemctl is-active borgbackup-job-test-backup >&2")
machine.succeed("test -f /run/mount-external-disk")
machine.succeed("test -f /run/unmount-external-disk")
# dummy data
client.succeed("mkdir /var/test-backups")
client.succeed("echo testing > /var/test-backups/somefile")
# list
backup_id = json.loads(machine.succeed("borg-job-test-backup list --json"))["archives"][0]["archive"]
out = machine.succeed("clan backups list --debug --flake ${clanCore} test-backup").strip()
print(out)
assert backup_id in out, f"backup {backup_id} not found in {out}"
localbackup_id = "hdd::/mnt/external-disk/snapshot.0"
assert localbackup_id in out, "localbackup not found in {out}"
# create
client.succeed("clan --flake ${../..} backups create test_backup_client")
client.wait_until_succeeds("! systemctl is-active borgbackup-job-test_backup_server")
## borgbackup restore
machine.succeed("rm -f /var/test-backups/somefile")
machine.succeed(f"clan backups restore --debug --flake ${clanCore} test-backup borgbackup 'test-backup::borg@machine:.::{backup_id}' >&2")
assert machine.succeed("cat /var/test-backups/somefile").strip() == "testing", "restore failed"
machine.succeed("test -f /var/test-service/pre-restore-command")
machine.succeed("test -f /var/test-service/post-restore-command")
machine.succeed("test -f /var/test-service/pre-backup-command")
# list
backup_id = json.loads(client.succeed("borg-job-test_backup_server list --json"))["archives"][0]["archive"]
assert(backup_id in client.succeed("clan --flake ${../..} backups list test_backup_client"))
## localbackup restore
machine.succeed("rm -rf /var/test-backups/somefile /var/test-service/ && mkdir -p /var/test-service")
machine.succeed(f"clan backups restore --debug --flake ${clanCore} test-backup localbackup '{localbackup_id}' >&2")
assert machine.succeed("cat /var/test-backups/somefile").strip() == "testing", "restore failed"
machine.succeed("test -f /var/test-service/pre-restore-command")
machine.succeed("test -f /var/test-service/post-restore-command")
machine.succeed("test -f /var/test-service/pre-backup-command")
'';
} { inherit pkgs self; };
};
# restore
client.succeed("rm -f /var/test-backups/somefile")
client.succeed(f"clan --flake ${../..} backups restore test_backup_client borgbackup {backup_id}")
assert(client.succeed("cat /var/test-backups/somefile").strip() == "testing")
'';
}
{ inherit pkgs self; };
};
};
}

View File

@@ -1,51 +0,0 @@
(
{ ... }:
{
name = "borgbackup";
nodes.machine =
{ self, pkgs, ... }:
{
imports = [
self.clanModules.borgbackup
self.nixosModules.clanCore
{
services.openssh.enable = true;
services.borgbackup.repos.testrepo = {
authorizedKeys = [ (builtins.readFile ../assets/ssh/pubkey) ];
};
}
{
clan.core.settings.directory = ./.;
clan.core.state.testState.folders = [ "/etc/state" ];
environment.etc.state.text = "hello world";
systemd.tmpfiles.settings."vmsecrets" = {
"/etc/secrets/borgbackup/borgbackup.ssh" = {
C.argument = "${../assets/ssh/privkey}";
z = {
mode = "0400";
user = "root";
};
};
"/etc/secrets/borgbackup/borgbackup.repokey" = {
C.argument = builtins.toString (pkgs.writeText "repokey" "repokey12345");
z = {
mode = "0400";
user = "root";
};
};
};
# clan.core.facts.secretStore = "vm";
clan.core.vars.settings.secretStore = "vm";
clan.borgbackup.destinations.test.repo = "borg@localhost:.";
}
];
};
testScript = ''
start_all()
machine.systemctl("start --wait borgbackup-job-test.service")
assert "machine-test" in machine.succeed("BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes /run/current-system/sw/bin/borg-job-test list")
'';
}
)

View File

@@ -1,102 +1,36 @@
{
pkgs,
nixosLib,
clan-core,
...
}:
nixosLib.runTest (
{ ... }:
{
(import ../lib/container-test.nix) ({ ... }: {
name = "borgbackup";
nodes.machine = { self, ... }: {
imports = [
clan-core.modules.nixosTest.clanTest
];
hostPkgs = pkgs;
name = "service-borgbackup";
clan = {
directory = ./.;
test.useContainers = true;
modules."@clan/borgbackup" = ../../clanServices/borgbackup/default.nix;
inventory = {
machines.clientone = { };
machines.serverone = { };
instances = {
borgone = {
module.name = "@clan/borgbackup";
module.input = "self";
roles.client.machines."clientone" = { };
roles.server.machines."serverone".settings.directory = "/tmp/borg-test";
self.clanModules.borgbackup
self.nixosModules.clanCore
{
services.openssh.enable = true;
services.borgbackup.repos.testrepo = {
authorizedKeys = [
(builtins.readFile ../lib/ssh/pubkey)
];
};
}
{
clanCore.machineName = "machine";
clanCore.clanDir = ./.;
clanCore.state.testState.folders = [ "/etc/state" ];
environment.etc.state.text = "hello world";
clan.borgbackup = {
enable = true;
destinations.test = {
repo = "borg@localhost:.";
rsh = "ssh -i ${../lib/ssh/privkey} -o StrictHostKeyChecking=no";
};
};
};
};
nodes = {
serverone = {
services.openssh.enable = true;
# Needed so PAM doesn't see the user as locked
users.users.borg.password = "borg";
};
clientone =
{ config, pkgs, ... }:
{
services.openssh.enable = true;
users.users.root.openssh.authorizedKeys.keyFiles = [ ../assets/ssh/pubkey ];
clan.core.networking.targetHost = config.networking.hostName;
environment.systemPackages = [ clan-core.packages.${pkgs.system}.clan-cli ];
clan.core.state.test-backups.folders = [ "/var/test-backups" ];
};
};
testScript = ''
import json
start_all()
machines = [clientone, serverone]
for m in machines:
m.systemctl("start network-online.target")
for m in machines:
m.wait_for_unit("network-online.target")
# dummy data
clientone.succeed("mkdir -p /var/test-backups /var/test-service")
clientone.succeed("echo testing > /var/test-backups/somefile")
clientone.succeed("${pkgs.coreutils}/bin/install -Dm 600 ${../assets/ssh/privkey} /root/.ssh/id_ed25519")
clientone.succeed("${pkgs.coreutils}/bin/touch /root/.ssh/known_hosts")
clientone.wait_until_succeeds("timeout 2 ssh -o StrictHostKeyChecking=accept-new localhost hostname")
clientone.wait_until_succeeds("timeout 2 ssh -o StrictHostKeyChecking=accept-new $(hostname) hostname")
# create
clientone.succeed("borgbackup-create >&2")
clientone.wait_until_succeeds("! systemctl is-active borgbackup-job-serverone >&2")
# list
backup_id = json.loads(clientone.succeed("borg-job-serverone list --json"))["archives"][0]["archive"]
out = clientone.succeed("borgbackup-list").strip()
print(out)
assert backup_id in out, f"backup {backup_id} not found in {out}"
# borgbackup restore
clientone.succeed("rm -f /var/test-backups/somefile")
clientone.succeed(f"NAME='serverone::borg@serverone:.::{backup_id}' borgbackup-restore >&2")
assert clientone.succeed("cat /var/test-backups/somefile").strip() == "testing", "restore failed"
'';
}
)
}
];
};
testScript = ''
start_all()
machine.systemctl("start --wait borgbackup-job-test.service")
assert "machine-test" in machine.succeed("BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes /run/current-system/sw/bin/borg-job-test list")
'';
})

View File

@@ -1,6 +0,0 @@
[
{
"publickey": "age1tyyx2ratu8s9ugyre36xyksnquth9gxeh7wjdhvsk89rtf8yu5wq0pk04c",
"type": "age"
}
]

View File

@@ -1,15 +0,0 @@
{
"data": "ENC[AES256_GCM,data:wCKoKuJo4uXycfqEUYAXDlRRMGJaWgOFiaQa4Wigs0jx1eCI80lP3cEZ1QKyrU/9m9POoZz0JlaKHcuhziTKUqaevHvGfVq2y00=,iv:pH5a90bJbK9Ro6zndNJ18qd4/rU+Tdm+y+jJZtY7UGg=,tag:9lHZJ9C/zIfy8nFrYt9JBQ==,type:str]",
"sops": {
"age": [
{
"recipient": "age1qm0p4vf9jvcnn43s6l4prk8zn6cx0ep9gzvevxecv729xz540v8qa742eg",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBwUDhpd1ZqbWFqR0I3dVFI\nOHlyZnFUYXJnWElrRWhoUHVNMzdKd0VrcGdRCkphQVhuYzlJV0p1MG9MSW5ncWJ3\nREp1OEJxMzQzS2MxTk9aMkJ1a3B0Q0kKLS0tIENweVJ2Tk1yeXlFc2F5cTNIV3F3\nTkRFOVZ1amRIYmg1K3hGWUFSTTl4Wk0KHJRJ7756Msod7Bsmn9SgtwRo53B8Ilp3\nhsAPv+TtdmOD8He9MvGV+BElKEXCsLUwhp/Py6n6CJCczu0VIr8owg==\n-----END AGE ENCRYPTED FILE-----\n"
}
],
"lastmodified": "2025-05-20T13:33:56Z",
"mac": "ENC[AES256_GCM,data:FyfxXhnI6o4SVGJY2e1eMDnfkbMWiCkP4JL/G4PQvzz+c7OIuz8xaa03P3VW7b7o85NP2Tln4FMNTZ0FYtQwd0kKypLUnIxAHsixAHFCv4X8ul1gtZynzgbFbmc0GkfVWW8Lf+U+vvDwT+UrEVfcmksCjdvAOwP26PvlEhYEkSw=,iv:H+VrWYL+kLOLezCZrI8ZgeCsaUdpb7LxDMiLotezVPs=,tag:B/cbPdiEFumGKQHby5inCA==,type:str]",
"unencrypted_suffix": "_unencrypted",
"version": "3.10.2"
}
}

View File

@@ -1 +0,0 @@
../../../users/admin

View File

@@ -1,4 +0,0 @@
{
"publickey": "age1qm0p4vf9jvcnn43s6l4prk8zn6cx0ep9gzvevxecv729xz540v8qa742eg",
"type": "age"
}

View File

@@ -1 +0,0 @@
../../../../../../sops/machines/clientone

View File

@@ -1,19 +0,0 @@
{
"data": "ENC[AES256_GCM,data:52vY68gqbwiZRMUBKc9SeXR06fuKAhuAPciLpxXgEOxI,iv:Y34AVoHaZzRiFFTDbekXP1X3W8zSXJmzVCYODYkdxnY=,tag:8WQaGEHQKT/n+auHUZCE0w==,type:str]",
"sops": {
"age": [
{
"recipient": "age1qm0p4vf9jvcnn43s6l4prk8zn6cx0ep9gzvevxecv729xz540v8qa742eg",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBOdUFUZUZ2M00zTGlhNjF4\nL0VlMVY4Z2xMbWRWR29zZlFwdm1XRk12NGtBCnkrb3A4M3BkalMyeWdDaUdQdStt\nUWY3SXJROXdpRzN0NlBJNEpjTEZ0aFkKLS0tIGZkMGhsTXB2RnRqVHVrUFQwL2lw\nZnBreWhWa3Jrcm4yOXBiaUlPWFM1aDAKRE+Zzrja7KeANEJUbmFYuVoO3qGyi4iH\n0cfH0W8irRe9vsKMXz7YJxtByYLwRulrT8tXtElHvIEVJG0mwwaf0Q==\n-----END AGE ENCRYPTED FILE-----\n"
},
{
"recipient": "age1tyyx2ratu8s9ugyre36xyksnquth9gxeh7wjdhvsk89rtf8yu5wq0pk04c",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBsNEljUFdnQ0tTQ1IxZ2Zo\nYkc4V2dCaUk0YXh5SzlSazhsRTVKVzFvVXhFCkRyMlMxR3EyWEZIRzFQV3d2dVpz\na3NPbk9XdWR1NmtMQlZsNlBuU0NkQWMKLS0tIDlDYzMzOExVL1g5SVRHYlpUQlBV\na2lpdTUwaEd4OXhWUWxuV04xRVVKNHcK9coohAD1IoarLOXSGg3MIRXQ3BsTIA4y\nKrcS/PxITKJs7ihg93RZin70R79Qsij1RHZLKGfgGJ67i8ZCxc4N0g==\n-----END AGE ENCRYPTED FILE-----\n"
}
],
"lastmodified": "2025-05-20T13:33:59Z",
"mac": "ENC[AES256_GCM,data:eABMaIe07dwAMMlgrIUUpfpj73q1H5Keafql91MBQ5NN9Znr5lI/ennQsQsuLO8ZTCC34US/MJndliW34SqVM9y53p0jjPzqBxSKYq74iNcBz7+TxbjlY1aapgTRPr6Ta8I/5loohnxlHqjvLL70ZzfbChDN0/4jZsDVXYNfbIk=,iv:41Mz2u40JN0iE5zPUK6siaxo0rTtlk7fGWq7TF5NyUI=,tag:1A+h6XPH7DeQ6kxGDV3PgQ==,type:str]",
"unencrypted_suffix": "_unencrypted",
"version": "3.10.2"
}
}

View File

@@ -1 +0,0 @@
../../../../../../sops/users/admin

View File

@@ -1 +0,0 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE3clYF6BDZ0PxfDdprx7YYM4U4PKEZkWUuhpre0wb7w nixbld@kiwi

View File

@@ -1 +0,0 @@
../../../../../../sops/machines/clientone

View File

@@ -1,19 +0,0 @@
{
"data": "ENC[AES256_GCM,data:tAjfBW75XDS8lfJCf/+9rPYH3aMjRX1nmdN5dPMxnrlhuEPM3Smv9AM93Tz36k7BKk31bUWcV/99ax+KaIK1Rzgym/CwKGGxIUziuVOEOwrCOBeOw7amZ9YGsgiLUTLIhoeO6SjfdZ4q2JxGPw7KqNfUM9kiZT01vx5JTLa24JdvBKpizbtHRlL1lappTRVt0dG2WhT9/YhQUGu9ZFqPs8+bPOBclc78qjCm2DAPgsprK+JCBuq+r+qHgAx4Ee1QHI7FC39e5NeGBTBeZfZ5d95+0klKuTx9FCPs6QRBkQ0tN29OpwzkdSuRAXGGHpzPkZ+FupbETtSQWCmnjma6jPzEl8oDUTWooKK0mUEz8icvTQvRfyM3Qt3mQpkX3e0rTEbZzoLdWCwTufP/tRQNDCWvI/NV7OjIHpNPjymqE5uPmiBpA6y6hhCH7zL1eDo11ICSIX3hkyFJH2svvFQn6oLrPAoByvNutfetKhd8z7NFpVeIOWwtuPzO7wU5M7zESHww0JF78vjFwimQYYhQ,iv:fVjeVez4dTGSrANi5ZeP9PJhsSySqeqqJzBDbd0gFW4=,tag:Aa89+bWLljxV1tlSHtpddw==,type:str]",
"sops": {
"age": [
{
"recipient": "age1qm0p4vf9jvcnn43s6l4prk8zn6cx0ep9gzvevxecv729xz540v8qa742eg",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBVaW94M3VwcFJ2elcrRGlv\nUGdzVk9vU2ZweFpIVVlIRUEyRVlSMlEyeHpVCnJuV0xIS3hMLy9IbG92S0pvL2RP\nL0J0WkVuWVhQdldHekdYNTVXdFkrUlEKLS0tIFQzdGErZVBwQUFNMXErbDBQVURZ\naHlsY2hDa1Zud1E2dFh0ZHl4VEJ2S0kKVABqwRcCUTcsBInfo9CpFtoM3kl4KMyU\nGXDjHOSjlX5df7OKZAvYukgX7Q2penvq+Fq4fa4A1Cmkqga7cHdJ+A==\n-----END AGE ENCRYPTED FILE-----\n"
},
{
"recipient": "age1tyyx2ratu8s9ugyre36xyksnquth9gxeh7wjdhvsk89rtf8yu5wq0pk04c",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBnbHRSVEg3Vi9qTnAwWGF6\nbEdIR2gvZ2laZnJMbVF3NjcvN25OdXF3WXowCnVUODdEa1NWU3JISXlrNldOMjVi\ndUlMTVdBaWxvZHlwSTdJY3NCcll4SjAKLS0tIEp6ZVlDTklqVXdNYzJ2dElCR21o\nUWphMDdyVVppVnFHOVlHZTNtajZzOXMKRB61lUrAkUXSYl3ffOOK8k4QgLA4bFln\naQ7GOol8f8W5H68zXBMZrhjP6k4kZDfknc9jgyoWM7jaZNSWC5J19Q==\n-----END AGE ENCRYPTED FILE-----\n"
}
],
"lastmodified": "2025-05-20T13:33:59Z",
"mac": "ENC[AES256_GCM,data:NjVpDweqxTSQGt9VKR/CMfvbvHQJHCi8P7XbOuKLZKQ4GVoeZ5r4PsC6nxKHHikN6YL1oJCmaSxr0mJRk/sFZg/+wdW8L7F5aQeFRiWo9jCjH0MDMnfiu5a0xjRt21uPl/7LUJ9jNon5nyxPTlZMeYSvTP2Q9spnNuN8vqipP68=,iv:DPvbN9IvWiUfxiJk6mey/us8N1GGVJcSJrT8Bty4kB4=,tag:+emK8uSkfIGUXoYpaWeu3A==,type:str]",
"unencrypted_suffix": "_unencrypted",
"version": "3.10.2"
}
}

View File

@@ -1 +0,0 @@
../../../../../../sops/users/admin

View File

@@ -1,6 +0,0 @@
{ fetchgit }:
fetchgit {
url = "https://git.clan.lol/clan/clan-core.git";
rev = "eea93ea22c9818da67e148ba586277bab9e73cea";
sha256 = "sha256-PV0Z+97QuxQbkYSVuNIJwUNXMbHZG/vhsA9M4cDTCOE=";
}

View File

@@ -1,44 +1,14 @@
(
{ ... }:
{
name = "container";
(import ../lib/container-test.nix) ({ ... }: {
name = "secrets";
nodes.machine1 =
{ ... }:
{
networking.hostName = "machine1";
services.openssh.enable = true;
services.openssh.startWhenNeeded = false;
};
nodes.machine2 =
{ ... }:
{
networking.hostName = "machine2";
services.openssh.enable = true;
services.openssh.startWhenNeeded = false;
};
testScript = ''
import subprocess
start_all()
machine1.succeed("systemctl status sshd")
machine2.succeed("systemctl status sshd")
machine1.wait_for_unit("sshd")
machine2.wait_for_unit("sshd")
p1 = subprocess.run(["ip", "a"], check=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
assert p1.returncode == 0
bridge_output = p1.stdout.decode("utf-8")
assert "br0" in bridge_output, f"bridge not found in ip a output: {bridge_output}"
for m in [machine1, machine2]:
out = machine1.succeed("ip addr show eth1")
assert "UP" in out, f"UP not found in ip addr show output: {out}"
assert "inet" in out, f"inet not found in ip addr show output: {out}"
assert "inet6" in out, f"inet6 not found in ip addr show output: {out}"
machine1.succeed("ping -c 1 machine2")
'';
}
)
nodes.machine = { ... }: {
networking.hostName = "machine";
services.openssh.enable = true;
services.openssh.startWhenNeeded = false;
};
testScript = ''
start_all()
machine.succeed("systemctl status sshd")
machine.wait_for_unit("sshd")
'';
})

View File

@@ -0,0 +1,24 @@
(import ../lib/container-test.nix) ({ pkgs, ... }: {
name = "secrets";
nodes.machine = { self, ... }: {
imports = [
self.clanModules.deltachat
self.nixosModules.clanCore
{
clanCore.machineName = "machine";
clanCore.clanDir = ./.;
}
];
};
testScript = ''
start_all()
machine.wait_for_unit("maddy")
# imap
machine.succeed("${pkgs.netcat}/bin/nc -z -v ::1 143")
# smtp submission
machine.succeed("${pkgs.netcat}/bin/nc -z -v ::1 587")
# smtp
machine.succeed("${pkgs.netcat}/bin/nc -z -v ::1 25")
'';
})

View File

@@ -1,22 +0,0 @@
{ ... }:
{
perSystem =
{ self', pkgs, ... }:
{
checks.devshell =
pkgs.runCommand "check-devshell-not-depends-on-clan-cli"
{
exportReferencesGraph = [
"graph"
self'.devShells.default
];
}
''
if grep -q "${self'.packages.clan-cli}" ./graph; then
echo "devshell depends on clan-cli, which is not allowed";
exit 1;
fi
mkdir $out
'';
};
}

View File

@@ -1,122 +0,0 @@
{
...
}:
{
perSystem =
{
system,
pkgs,
self',
lib,
...
}:
let
clanCore = self'.packages.clan-core-flake;
clanCoreHash = lib.substring 0 12 (builtins.hashString "sha256" "${clanCore}");
/*
construct a flake for the test which contains a single check which depends
on all checks of clan-core.
*/
testFlakeFile = pkgs.writeText "flake.nix" ''
{
inputs.clan-core.url = path:///to/nowhere;
outputs = {clan-core, ...}:
let
checks =
builtins.removeAttrs
clan-core.checks.${system}
[
"dont-depend-on-repo-root"
"package-dont-depend-on-repo-root"
"package-clan-core-flake"
];
checksOutPaths = map (x: "''${x}") (builtins.attrValues checks);
in
{
checks.${system}.check = builtins.derivation {
name = "all-clan-core-checks";
system = "${system}";
builder = "/bin/sh";
args = ["-c" '''
of outPath in ''${toString checksOutPaths}; do
echo "$outPath" >> $out
done
'''];
};
};
}
'';
in
lib.optionalAttrs (system == "x86_64-linux") {
packages.dont-depend-on-repo-root =
pkgs.runCommand
# append repo hash to this tests name to ensure it gets invalidated on each chain
# This is needed because this test is an FOD (due to networking) and would get cached indefinitely.
"check-dont-depend-on-repo-root-${clanCoreHash}"
{
buildInputs = [
pkgs.nix
pkgs.cacert
pkgs.nix-diff
];
outputHashAlgo = "sha256";
outputHash = "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=";
}
''
mkdir clanCore testFlake store
clanCore=$(realpath clanCore)
testFlake=$(realpath testFlake)
# copy clan core flake and make writable
cp -r ${clanCore}/* clanCore/
chmod +w -R clanCore\
# copy test flake and make writable
cp ${testFlakeFile} testFlake/flake.nix
chmod +w -R testFlake
# enable flakes
export NIX_CONFIG="experimental-features = nix-command flakes"
# give nix a $HOME
export HOME=$(realpath ./store)
# override clan-core flake input to point to $clanCore\
echo "locking clan-core to $clanCore"
nix flake lock --override-input clan-core "path://$clanCore" "$testFlake" --store "$HOME"
# evaluate all tests
echo "evaluating all tests for clan core"
nix eval "$testFlake"#checks.${system}.check.drvPath --store "$HOME" --raw > drvPath1 &
# slightly modify clan core
cp -r $clanCore clanCore2
cp -r $testFlake testFlake2
export clanCore2=$(realpath clanCore2)
export testFlake2=$(realpath testFlake2)
touch clanCore2/fly-fpv
# re-evaluate all tests
echo "locking clan-core to $clanCore2"
nix flake lock --override-input clan-core "path://$clanCore2" "$testFlake2" --store "$HOME"
echo "evaluating all tests for clan core with added file"
nix eval "$testFlake2"#checks.${system}.check.drvPath --store "$HOME" --raw > drvPath2
# wait for first nix eval to return as well
while ! grep -q drv drvPath1; do sleep 1; done
# raise error if outputs are different
if [ "$(cat drvPath1)" != "$(cat drvPath2)" ]; then
echo -e "\n\nERROR: Something in clan-core depends on the whole repo" > /dev/stderr
echo -e "See details in the nix-diff below which shows the difference between two evaluations:"
echo -e " 1. Evaluation of clan-core checks without any changes"
echo -e " 1. Evaluation of clan-core checks after adding a file to the top-level of the repo"
echo "nix-diff:"
export NIX_REMOTE="$HOME"
nix-diff $(cat drvPath1) $(cat drvPath2)
exit 1
fi
touch $out
'';
};
}

View File

@@ -1,176 +1,54 @@
{
self,
lib,
inputs,
...
}:
let
inherit (lib)
attrNames
attrValues
elem
filter
filterAttrs
flip
genAttrs
hasPrefix
pathExists
;
nixosLib = import (self.inputs.nixpkgs + "/nixos/lib") { };
in
{
imports = filter pathExists [
./backups/flake-module.nix
../nixosModules/clanCore/machine-id/tests/flake-module.nix
../nixosModules/clanCore/state-version/tests/flake-module.nix
./devshell/flake-module.nix
./flash/flake-module.nix
{ self, ... }: {
imports = [
./impure/flake-module.nix
./backups/flake-module.nix
./installation/flake-module.nix
./morph/flake-module.nix
./nixos-documentation/flake-module.nix
./dont-depend-on-repo-root.nix
];
flake.check = genAttrs [ "x86_64-linux" "aarch64-darwin" ] (
system:
let
checks = flip filterAttrs self.checks.${system} (
name: _check:
!(hasPrefix "nixos-test-" name)
&& !(hasPrefix "nixos-" name)
&& !(hasPrefix "darwin-test-" name)
&& !(hasPrefix "service-" name)
&& !(hasPrefix "vars-check-" name)
&& !(hasPrefix "devShell-" name)
&& !(elem name [
"clan-core-for-checks"
"clan-deps"
])
);
in
inputs.nixpkgs.legacyPackages.${system}.runCommand "fast-flake-checks-${system}"
{ passthru.checks = checks; }
''
echo "Executed the following checks for ${system}..."
echo " - ${lib.concatStringsSep "\n" (map (n: " - " + n) (attrNames checks))}"
echo ${toString (attrValues checks)} >/dev/null
echo "All checks succeeded"
touch $out
''
);
perSystem =
{
pkgs,
lib,
self',
system,
...
}:
{
checks =
perSystem = { pkgs, lib, self', ... }: {
checks =
let
nixosTestArgs = {
# reference to nixpkgs for the current system
inherit pkgs;
# this gives us a reference to our flake but also all flake inputs
inherit self;
};
nixosTests = lib.optionalAttrs (pkgs.stdenv.isLinux) {
# import our test
secrets = import ./secrets nixosTestArgs;
container = import ./container nixosTestArgs;
deltachat = import ./deltachat nixosTestArgs;
meshnamed = import ./meshnamed nixosTestArgs;
zt-tcp-relay = import ./zt-tcp-relay nixosTestArgs;
borgbackup = import ./borgbackup nixosTestArgs;
syncthing = import ./syncthing nixosTestArgs;
wayland-proxy-virtwl = import ./wayland-proxy-virtwl nixosTestArgs;
};
schemaTests = pkgs.callPackages ./schemas.nix {
inherit self;
};
flakeOutputs = lib.mapAttrs' (name: config: lib.nameValuePair "nixos-${name}" config.config.system.build.toplevel) self.nixosConfigurations
// lib.mapAttrs' (n: lib.nameValuePair "package-${n}") self'.packages
// lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self'.devShells
// lib.mapAttrs' (name: config: lib.nameValuePair "home-manager-${name}" config.activation-script) (self'.legacyPackages.homeConfigurations or { });
in
nixosTests // schemaTests // flakeOutputs;
legacyPackages = {
nixosTests =
let
nixosTestArgs = {
# reference to nixpkgs for the current system
inherit pkgs lib nixosLib;
inherit pkgs;
# this gives us a reference to our flake but also all flake inputs
inherit self;
inherit (self) clanLib;
clan-core = self;
};
nixosTests = lib.optionalAttrs (pkgs.stdenv.isLinux) {
# Base Tests
nixos-test-secrets = self.clanLib.test.baseTest ./secrets nixosTestArgs;
nixos-test-borgbackup-legacy = self.clanLib.test.baseTest ./borgbackup-legacy nixosTestArgs;
nixos-test-wayland-proxy-virtwl = self.clanLib.test.baseTest ./wayland-proxy-virtwl nixosTestArgs;
# Container Tests
nixos-test-container = self.clanLib.test.containerTest ./container nixosTestArgs;
nixos-test-zt-tcp-relay = self.clanLib.test.containerTest ./zt-tcp-relay nixosTestArgs;
nixos-test-matrix-synapse = self.clanLib.test.containerTest ./matrix-synapse nixosTestArgs;
nixos-test-postgresql = self.clanLib.test.containerTest ./postgresql nixosTestArgs;
nixos-test-user-firewall-iptables = self.clanLib.test.containerTest ./user-firewall/iptables.nix nixosTestArgs;
nixos-test-user-firewall-nftables = self.clanLib.test.containerTest ./user-firewall/nftables.nix nixosTestArgs;
service-dummy-test = import ./service-dummy-test nixosTestArgs;
service-dummy-test-from-flake = import ./service-dummy-test-from-flake nixosTestArgs;
};
packagesToBuild = lib.removeAttrs self'.packages [
# exclude the check that checks that nothing depends on the repo root
# We might want to include this later once everything is fixed
"dont-depend-on-repo-root"
];
flakeOutputs =
lib.mapAttrs' (
name: config: lib.nameValuePair "nixos-${name}" config.config.system.build.toplevel
) (lib.filterAttrs (n: _: !lib.hasPrefix "test-" n) self.nixosConfigurations)
// lib.mapAttrs' (
name: config: lib.nameValuePair "darwin-${name}" config.config.system.build.toplevel
) (self.darwinConfigurations or { })
// lib.mapAttrs' (n: lib.nameValuePair "package-${n}") packagesToBuild
// lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self'.devShells
// lib.mapAttrs' (name: config: lib.nameValuePair "home-manager-${name}" config.activation-script) (
self'.legacyPackages.homeConfigurations or { }
);
in
nixosTests
// flakeOutputs
// {
# TODO: Automatically provide this check to downstream users to check their modules
clan-modules-json-compatible =
let
allSchemas = lib.mapAttrs (
_n: m:
let
schema =
(self.clanLib.evalService {
modules = [ m ];
prefix = [
"checks"
system
];
}).config.result.api.schema;
in
schema
) self.clan.modules;
in
pkgs.runCommand "combined-result"
{
schemaFile = builtins.toFile "schemas.json" (builtins.toJSON allSchemas);
}
''
mkdir -p $out
cat $schemaFile > $out/allSchemas.json
'';
clan-core-for-checks = pkgs.runCommand "clan-core-for-checks" { } ''
cp -r ${pkgs.callPackage ./clan-core-for-checks.nix { }} $out
chmod +w $out/flake.lock
cp ${../flake.lock} $out/flake.lock
'';
lib.optionalAttrs (pkgs.stdenv.isLinux) {
# import our test
secrets = import ./secrets nixosTestArgs;
container = import ./container nixosTestArgs;
};
packages = lib.optionalAttrs (pkgs.stdenv.isLinux) {
run-vm-test-offline = pkgs.callPackage ../pkgs/run-vm-test-offline { };
};
legacyPackages = {
nixosTests =
let
nixosTestArgs = {
# reference to nixpkgs for the current system
inherit pkgs;
# this gives us a reference to our flake but also all flake inputs
inherit self;
};
in
lib.optionalAttrs (pkgs.stdenv.isLinux) {
# import our test
nixos-test-secrets = import ./secrets nixosTestArgs;
nixos-test-container = import ./container nixosTestArgs;
# Clan app tests
nixos-test-app-ocr = self.clanLib.test.baseTest ./app-ocr nixosTestArgs;
};
};
};
};
}

View File

@@ -1,87 +0,0 @@
{
config,
self,
lib,
...
}:
{
clan.machines = lib.listToAttrs (
lib.map (
system:
lib.nameValuePair "test-flash-machine-${system}" {
clan.core.networking.targetHost = "test-flash-machine";
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 ];
}
) (lib.filter (lib.hasSuffix "linux") config.systems)
);
flake.nixosModules = {
test-flash-machine =
{ lib, ... }:
{
imports = [ self.nixosModules.test-install-machine-without-system ];
clan.core.vars.generators.test = lib.mkForce { };
disko.devices.disk.main.preCreateHook = lib.mkForce "";
};
};
perSystem =
{
pkgs,
lib,
...
}:
let
dependencies = [
pkgs.disko
pkgs.buildPackages.xorg.lndir
self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".pkgs.perlPackages.ConfigIniFiles
self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".pkgs.perlPackages.FileSlurp
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
] ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs);
closureInfo = pkgs.closureInfo { rootPaths = dependencies; };
in
{
checks = pkgs.lib.mkIf pkgs.stdenv.isLinux {
nixos-test-flash = self.clanLib.test.baseTest {
name = "flash";
nodes.target = {
virtualisation.emptyDiskImages = [ 4096 ];
virtualisation.memorySize = 4096;
environment.systemPackages = [ self.packages.${pkgs.system}.clan-cli ];
environment.etc."install-closure".source = "${closureInfo}/store-paths";
nix.settings = {
substituters = lib.mkForce [ ];
hashed-mirrors = null;
connect-timeout = lib.mkForce 3;
flake-registry = pkgs.writeText "flake-registry" ''{"flakes":[],"version":2}'';
experimental-features = [
"nix-command"
"flakes"
];
};
};
testScript = ''
start_all()
# Some distros like to automount disks with spaces
machine.succeed('mkdir -p "/mnt/with spaces" && mkfs.ext4 /dev/vdb && mount /dev/vdb "/mnt/with spaces"')
machine.succeed("clan flash write --debug --flake ${self.checks.x86_64-linux.clan-core-for-checks} --yes --disk main /dev/vdb test-flash-machine-${pkgs.hostPlatform.system}")
'';
} { inherit pkgs self; };
};
};
}

View File

@@ -1,51 +1,18 @@
{
perSystem =
{
pkgs,
lib,
self',
...
}:
{
# a script that executes all other checks
packages.impure-checks = pkgs.writeShellScriptBin "impure-checks" ''
#!${pkgs.bash}/bin/bash
set -euo pipefail
perSystem = { pkgs, lib, ... }: {
# a script that executes all other checks
packages.impure-checks = pkgs.writeShellScriptBin "impure-checks" ''
#!${pkgs.bash}/bin/bash
set -euo pipefail
unset CLAN_DIR
export PATH="${
lib.makeBinPath (
[
pkgs.gitMinimal
pkgs.nix
pkgs.coreutils
pkgs.rsync # needed to have rsync installed on the dummy ssh server
]
++ self'.packages.clan-cli-full.runtimeDependencies
)
}"
ROOT=$(git rev-parse --show-toplevel)
cd "$ROOT/pkgs/clan-cli"
# Set up custom git configuration for tests
export GIT_CONFIG_GLOBAL=$(mktemp)
git config --file "$GIT_CONFIG_GLOBAL" user.name "Test User"
git config --file "$GIT_CONFIG_GLOBAL" user.email "test@example.com"
export GIT_CONFIG_SYSTEM=/dev/null
# this disables dynamic dependency loading in clan-cli
export CLAN_NO_DYNAMIC_DEPS=1
jobs=$(nproc)
# Spawning worker in pytest is relatively slow, so we limit the number of jobs to 13
# (current number of impure tests)
jobs="$((jobs > 13 ? 13 : jobs))"
nix develop "$ROOT#clan-cli" -c bash -c "TMPDIR=/tmp python -m pytest -n $jobs -m impure ./clan_cli $@"
# Clean up temporary git config
rm -f "$GIT_CONFIG_GLOBAL"
'';
};
export PATH="${lib.makeBinPath [
pkgs.gitMinimal
pkgs.nix
pkgs.rsync # needed to have rsync installed on the dummy ssh server
]}"
ROOT=$(git rev-parse --show-toplevel)
cd "$ROOT/pkgs/clan-cli"
nix develop "$ROOT#clan-cli" -c bash -c "TMPDIR=/tmp python -m pytest -s -m impure ./tests $@"
'';
};
}

View File

@@ -1,345 +1,123 @@
{
self,
lib,
...
}:
{
# The purpose of this test is to ensure `clan machines install` works
# for machines that don't have a hardware config yet.
# If this test starts failing it could be due to the `facter.json` being out of date
# 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 = builtins.fetchurl {
url = "https://git.clan.lol/clan/test-fixtures/raw/commit/4a2bc56d886578124b05060d3fb7eddc38c019f8/nixos-vm-facter-json/${pkgs.hostPlatform.system}.json";
sha256 =
{
aarch64-linux = "sha256:1rlfymk03rmfkm2qgrc8l5kj5i20srx79n1y1h4nzlpwaz0j7hh2";
x86_64-linux = "sha256:16myh0ll2gdwsiwkjw5ba4dl23ppwbsanxx214863j7nvzx42pws";
}
.${pkgs.hostPlatform.system};
{ self, ... }:
let
clan = self.lib.buildClan {
clanName = "testclan";
directory = ../..;
machines = {
test_install_machine = {
imports = [ self.nixosModules.test_install_machine ];
};
fileSystems."/".device = lib.mkDefault "/dev/vda";
boot.loader.grub.device = lib.mkDefault "/dev/vda";
imports = [ self.nixosModules.test-install-machine-without-system ];
};
};
in
{
flake.nixosConfigurations = { inherit (clan.nixosConfigurations) test_install_machine; };
flake.clanInternals.machines = clan.clanInternals.machines;
flake.nixosModules = {
test-install-machine-without-system =
{ lib, modulesPath, ... }:
{
imports = [
(modulesPath + "/testing/test-instrumentation.nix") # we need these 2 modules always to be able to run the tests
(modulesPath + "/profiles/qemu-guest.nix")
self.clanLib.test.minifyModule
];
test_install_machine = { lib, modulesPath, ... }: {
imports = [
self.clanModules.diskLayouts
(modulesPath + "/testing/test-instrumentation.nix") # we need these 2 modules always to be able to run the tests
(modulesPath + "/profiles/qemu-guest.nix")
];
fileSystems."/nix/store" = lib.mkForce {
device = "nix-store";
fsType = "9p";
neededForBoot = true;
options = [ "trans=virtio" "version=9p2000.L" "cache=loose" ];
};
clan.diskLayouts.singleDiskExt4.device = "/dev/vdb";
networking.hostName = "test-install-machine";
environment.etc."install-successful".text = "ok";
environment.etc."install-successful".text = "ok";
# Enable SSH and add authorized key for testing
services.openssh.enable = true;
services.openssh.settings.PasswordAuthentication = false;
users.users.nonrootuser = {
isNormalUser = true;
openssh.authorizedKeys.keys = [ (builtins.readFile ../assets/ssh/pubkey) ];
extraGroups = [ "wheel" ];
home = "/home/nonrootuser";
createHome = true;
};
users.users.root.openssh.authorizedKeys.keys = [ (builtins.readFile ../assets/ssh/pubkey) ];
# Allow users to manage their own SSH keys
services.openssh.authorizedKeysFiles = [
"/root/.ssh/authorized_keys"
"/home/%u/.ssh/authorized_keys"
"/etc/ssh/authorized_keys.d/%u"
];
security.sudo.wheelNeedsPassword = false;
boot.consoleLogLevel = lib.mkForce 100;
boot.kernelParams = [ "boot.shell_on_fail" ];
# disko config
boot.loader.grub.efiSupport = lib.mkDefault true;
boot.loader.grub.efiInstallAsRemovable = lib.mkDefault true;
clan.core.vars.settings.secretStore = "vm";
clan.core.vars.generators.test = {
files.test.neededFor = "partitioning";
script = ''
echo "notok" > "$out"/test
'';
};
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/vda";
preCreateHook = ''
test -e /run/partitioning-secrets/test/test
'';
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02"; # for grub MBR
priority = 1;
};
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
boot.consoleLogLevel = lib.mkForce 100;
boot.kernelParams = [
"boot.shell_on_fail"
];
};
};
perSystem = { nodes, pkgs, lib, ... }:
let
dependencies = [
self
pkgs.stdenv.drvPath
clan.clanInternals.machines.x86_64-linux.test_install_machine.config.system.build.toplevel
clan.clanInternals.machines.x86_64-linux.test_install_machine.config.system.build.diskoScript
clan.clanInternals.machines.x86_64-linux.test_install_machine.config.system.clan.deployment.file
pkgs.nixos-anywhere
] ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs);
closureInfo = pkgs.closureInfo { rootPaths = dependencies; };
in
{
checks = pkgs.lib.mkIf (pkgs.stdenv.isLinux) {
test-installation =
(import ../lib/test-base.nix)
{
name = "test-installation";
nodes.target = {
services.openssh.enable = true;
users.users.root.openssh.authorizedKeys.keyFiles = [
../lib/ssh/pubkey
];
system.nixos.variant_id = "installer";
virtualisation.emptyDiskImages = [ 4096 ];
nix.settings = {
substituters = lib.mkForce [ ];
hashed-mirrors = null;
connect-timeout = lib.mkForce 3;
flake-registry = pkgs.writeText "flake-registry" ''{"flakes":[],"version":2}'';
experimental-features = [
"nix-command"
"flakes"
];
};
};
};
};
};
};
};
nodes.client = {
environment.systemPackages = [ self.packages.${pkgs.system}.clan-cli ];
environment.etc."install-closure".source = "${closureInfo}/store-paths";
virtualisation.memorySize = 2048;
nix.settings = {
substituters = lib.mkForce [ ];
hashed-mirrors = null;
connect-timeout = lib.mkForce 3;
flake-registry = pkgs.writeText "flake-registry" ''{"flakes":[],"version":2}'';
experimental-features = [
"nix-command"
"flakes"
];
};
system.extraDependencies = dependencies;
};
perSystem =
{
pkgs,
...
}:
{
# On aarch64-linux, hangs on reboot with after installation:
# vm-test-run-test-installation-> installer # [ 288.002871] reboot: Restarting system
# vm-test-run-test-installation-> server # [test-install-machine] ### Done! ###
# vm-test-run-test-installation-> server # [test-install-machine] + step 'Done!'
# vm-test-run-test-installation-> server # [test-install-machine] + echo '### Done! ###'
# vm-test-run-test-installation-> server # [test-install-machine] + rm -rf /tmp/tmp.qb16EAq7hJ
# vm-test-run-test-installation-> (finished: must succeed: clan machines install --debug --flake test-flake --yes test-install-machine --target-host root@installer --update-hardware-config nixos-facter >&2, in 154.62 seconds)
# vm-test-run-test-installation-> target: starting vm
# vm-test-run-test-installation-> target: QEMU running (pid 144)
# vm-test-run-test-installation-> target: waiting for unit multi-user.target
# vm-test-run-test-installation-> target: waiting for the VM to finish booting
# vm-test-run-test-installation-> target: Guest root shell did not produce any data yet...
# vm-test-run-test-installation-> target: To debug, enter the VM and run 'systemctl status backdoor.service'.
checks =
let
# Custom Python package for port management utilities
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
pkgs.stdenv.drvPath
pkgs.bash.drvPath
pkgs.buildPackages.xorg.lndir
] ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs);
};
in
pkgs.lib.mkIf (pkgs.stdenv.isLinux && !pkgs.stdenv.isAarch64) {
nixos-test-installation = self.clanLib.test.baseTest {
name = "installation";
nodes.target = (import ./test-helpers.nix { inherit lib pkgs self; }).target;
extraPythonPackages = _p: [
self.legacyPackages.${pkgs.system}.nixosTestLib
];
testScript = ''
def create_test_machine(oldmachine=None, args={}): # taken from <nixpkgs/nixos/tests/installer.nix>
machine = create_machine({
"qemuFlags":
'-cpu max -m 1024 -virtfs local,path=/nix/store,security_model=none,mount_tag=nix-store,'
f' -drive file={oldmachine.state_dir}/empty0.qcow2,id=drive1,if=none,index=1,werror=report'
f' -device virtio-blk-pci,drive=drive1',
} | args)
driver.machines.append(machine)
return machine
testScript = ''
import tempfile
import os
import subprocess
from nixos_test_lib.ssh import setup_ssh_connection # type: ignore[import-untyped]
from nixos_test_lib.nix_setup import prepare_test_flake # type: ignore[import-untyped]
def create_test_machine(oldmachine, qemu_test_bin: str, **kwargs):
"""Create a new test machine from an installed disk image"""
start_command = [
f"{qemu_test_bin}/bin/qemu-kvm",
"-cpu",
"max",
"-m",
"3048",
"-virtfs",
"local,path=/nix/store,security_model=none,mount_tag=nix-store",
"-drive",
f"file={oldmachine.state_dir}/target.qcow2,id=drive1,if=none,index=1,werror=report",
"-device",
"virtio-blk-pci,drive=drive1",
"-netdev",
"user,id=net0",
"-device",
"virtio-net-pci,netdev=net0",
]
machine = create_machine(start_command=" ".join(start_command), **kwargs)
driver.machines.append(machine)
return machine
start_all()
target.start()
client.succeed("${pkgs.coreutils}/bin/install -Dm 600 ${../lib/ssh/privkey} /root/.ssh/id_ed25519")
client.wait_until_succeeds("ssh -o StrictHostKeyChecking=accept-new -v root@target hostname")
# Set up test environment
with tempfile.TemporaryDirectory() as temp_dir:
# Prepare test flake and Nix store
flake_dir = prepare_test_flake(
temp_dir,
"${self.checks.x86_64-linux.clan-core-for-checks}",
"${closureInfo}"
)
# Set up SSH connection
ssh_conn = setup_ssh_connection(
target,
temp_dir,
"${../assets/ssh/privkey}"
)
# Run clan install from host using port forwarding
clan_cmd = [
"${self.packages.${pkgs.system}.clan-cli-full}/bin/clan",
"machines",
"install",
"--phases", "disko,install",
"--debug",
"--flake", flake_dir,
"--yes", "test-install-machine-without-system",
"--target-host", f"nonrootuser@localhost:{ssh_conn.host_port}",
"-i", ssh_conn.ssh_key,
"--option", "store", os.environ['CLAN_TEST_STORE'],
"--update-hardware-config", "nixos-facter",
]
subprocess.run(clan_cmd, check=True)
# Shutdown the installer machine gracefully
try:
client.succeed("clan --flake ${../..} machines install test_install_machine root@target >&2")
try:
target.shutdown()
except BrokenPipeError:
except BrokenPipeError:
# qemu has already exited
pass
# Create a new machine instance that boots from the installed system
installed_machine = create_test_machine(target, "${pkgs.qemu_test}", name="after_install")
installed_machine.start()
installed_machine.wait_for_unit("multi-user.target")
installed_machine.succeed("test -f /etc/install-successful")
'';
} { inherit pkgs self; };
nixos-test-update-hardware-configuration = self.clanLib.test.baseTest {
name = "update-hardware-configuration";
nodes.target = (import ./test-helpers.nix { inherit lib pkgs self; }).target;
extraPythonPackages = _p: [
self.legacyPackages.${pkgs.system}.nixosTestLib
];
testScript = ''
import tempfile
import os
import subprocess
from nixos_test_lib.ssh import setup_ssh_connection # type: ignore[import-untyped]
from nixos_test_lib.nix_setup import prepare_test_flake # type: ignore[import-untyped]
target.start()
# Set up test environment
with tempfile.TemporaryDirectory() as temp_dir:
# Prepare test flake and Nix store
flake_dir = prepare_test_flake(
temp_dir,
"${self.checks.x86_64-linux.clan-core-for-checks}",
"${closureInfo}"
)
# Set up SSH connection
ssh_conn = setup_ssh_connection(
target,
temp_dir,
"${../assets/ssh/privkey}"
)
# Verify files don't exist initially
hw_config_file = os.path.join(flake_dir, "machines/test-install-machine/hardware-configuration.nix")
facter_file = os.path.join(flake_dir, "machines/test-install-machine/facter.json")
assert not os.path.exists(hw_config_file), "hardware-configuration.nix should not exist initially"
assert not os.path.exists(facter_file), "facter.json should not exist initially"
# Set CLAN_FLAKE for the commands
os.environ["CLAN_FLAKE"] = flake_dir
# Test facter backend
clan_cmd = [
"${self.packages.${pkgs.system}.clan-cli-full}/bin/clan",
"machines",
"update-hardware-config",
"--debug",
"--flake", ".",
"--host-key-check", "none",
"test-install-machine-without-system",
"-i", ssh_conn.ssh_key,
"--option", "store", os.environ['CLAN_TEST_STORE'],
f"nonrootuser@localhost:{ssh_conn.host_port}"
]
result = subprocess.run(clan_cmd, capture_output=True, cwd=flake_dir)
if result.returncode != 0:
print(f"Clan update-hardware-config failed: {result.stderr.decode()}")
raise Exception(f"Clan update-hardware-config failed with return code {result.returncode}")
facter_without_system_file = os.path.join(flake_dir, "machines/test-install-machine-without-system/facter.json")
assert os.path.exists(facter_without_system_file), "facter.json should exist after update"
os.remove(facter_without_system_file)
# Test nixos-generate-config backend
clan_cmd = [
"${self.packages.${pkgs.system}.clan-cli-full}/bin/clan",
"machines",
"update-hardware-config",
"--debug",
"--backend", "nixos-generate-config",
"--host-key-check", "none",
"--flake", ".",
"test-install-machine-without-system",
"-i", ssh_conn.ssh_key,
"--option", "store", os.environ['CLAN_TEST_STORE'],
f"nonrootuser@localhost:{ssh_conn.host_port}"
]
result = subprocess.run(clan_cmd, capture_output=True, cwd=flake_dir)
if result.returncode != 0:
print(f"Clan update-hardware-config (nixos-generate-config) failed: {result.stderr.decode()}")
raise Exception(f"Clan update-hardware-config failed with return code {result.returncode}")
hw_config_without_system_file = os.path.join(flake_dir, "machines/test-install-machine-without-system/hardware-configuration.nix")
assert os.path.exists(hw_config_without_system_file), "hardware-configuration.nix should exist after update"
'';
} { inherit pkgs self; };
};
new_machine = create_test_machine(oldmachine=target, args={ "name": "new_machine" })
assert(new_machine.succeed("cat /etc/install-successful").strip() == "ok")
'';
}
{ inherit pkgs self; };
};
};
}

View File

@@ -1,44 +0,0 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "nixos-test-lib"
version = "1.0.0"
description = "NixOS test utilities for clan VM testing"
authors = [
{name = "Clan Core Team"}
]
dependencies = []
[project.optional-dependencies]
dev = [
"mypy",
"ruff"
]
[tool.setuptools.packages.find]
where = ["."]
include = ["nixos_test_lib*"]
[tool.setuptools.package-data]
"nixos_test_lib" = ["py.typed"]
[tool.mypy]
python_version = "3.12"
strict = true
warn_return_any = true
warn_unused_configs = true
[tool.ruff]
target-version = "py312"
line-length = 88
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"D", # docstrings
"ANN", # type annotations
"COM812", # trailing comma
"ISC001", # string concatenation
]

View File

@@ -1,173 +0,0 @@
{
lib,
pkgs,
self,
...
}:
let
# Common target VM configuration used by both installation and update tests
target =
{ modulesPath, pkgs, ... }:
{
imports = [
(modulesPath + "/../tests/common/auto-format-root-device.nix")
];
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
];
# Disable cache.nixos.org to speed up tests
nix.settings.substituters = [ ];
nix.settings.trusted-public-keys = [ ];
virtualisation.emptyDiskImages = [ 512 ];
virtualisation.diskSize = 8 * 1024;
virtualisation.rootDevice = "/dev/vdb";
# both installer and target need to use the same diskImage
virtualisation.diskImage = "./target.qcow2";
virtualisation.memorySize = 3048;
users.users.nonrootuser = {
isNormalUser = true;
openssh.authorizedKeys.keys = [ (builtins.readFile ../assets/ssh/pubkey) ];
extraGroups = [ "wheel" ];
};
users.users.root.openssh.authorizedKeys.keys = [ (builtins.readFile ../assets/ssh/pubkey) ];
# Allow users to manage their own SSH keys
services.openssh.authorizedKeysFiles = [
"/root/.ssh/authorized_keys"
"/home/%u/.ssh/authorized_keys"
"/etc/ssh/authorized_keys.d/%u"
];
security.sudo.wheelNeedsPassword = false;
};
# Common base test machine configuration
baseTestMachine =
{ lib, modulesPath, ... }:
{
imports = [
(modulesPath + "/testing/test-instrumentation.nix")
(modulesPath + "/profiles/qemu-guest.nix")
self.clanLib.test.minifyModule
];
# Enable SSH and add authorized key for testing
services.openssh.enable = true;
services.openssh.settings.PasswordAuthentication = false;
users.users.nonrootuser = {
isNormalUser = true;
openssh.authorizedKeys.keys = [ (builtins.readFile ../assets/ssh/pubkey) ];
extraGroups = [ "wheel" ];
home = "/home/nonrootuser";
createHome = true;
};
users.users.root.openssh.authorizedKeys.keys = [ (builtins.readFile ../assets/ssh/pubkey) ];
# Allow users to manage their own SSH keys
services.openssh.authorizedKeysFiles = [
"/root/.ssh/authorized_keys"
"/home/%u/.ssh/authorized_keys"
"/etc/ssh/authorized_keys.d/%u"
];
security.sudo.wheelNeedsPassword = false;
boot.consoleLogLevel = lib.mkForce 100;
boot.kernelParams = [ "boot.shell_on_fail" ];
# disko config
boot.loader.grub.efiSupport = lib.mkDefault true;
boot.loader.grub.efiInstallAsRemovable = lib.mkDefault true;
clan.core.vars.settings.secretStore = "vm";
clan.core.vars.generators.test = {
files.test.neededFor = "partitioning";
script = ''
echo "notok" > "$out"/test
'';
};
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/vda";
preCreateHook = ''
test -e /run/partitioning-secrets/test/test
'';
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02"; # for grub MBR
priority = 1;
};
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
};
};
};
# NixOS test library combining port utils and clan VM test utilities
nixosTestLib = pkgs.python3Packages.buildPythonPackage {
pname = "nixos-test-lib";
version = "1.0.0";
format = "pyproject";
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.unions [
./pyproject.toml
./nixos_test_lib
];
};
nativeBuildInputs = with pkgs.python3Packages; [
setuptools
wheel
];
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

@@ -0,0 +1,88 @@
{ hostPkgs, lib, config, ... }:
let
testDriver = hostPkgs.python3.pkgs.callPackage ./package.nix {
inherit (config) extraPythonPackages;
inherit (hostPkgs.pkgs) util-linux systemd;
};
containers = map (m: m.system.build.toplevel) (lib.attrValues config.nodes);
pythonizeName = name:
let
head = lib.substring 0 1 name;
tail = lib.substring 1 (-1) name;
in
(if builtins.match "[A-z_]" head == null then "_" else head) +
lib.stringAsChars (c: if builtins.match "[A-z0-9_]" c == null then "_" else c) tail;
nodeHostNames =
let
nodesList = map (c: c.system.name) (lib.attrValues config.nodes);
in
nodesList ++ lib.optional (lib.length nodesList == 1 && !lib.elem "machine" nodesList) "machine";
machineNames = map (name: "${name}: Machine;") pythonizedNames;
pythonizedNames = map pythonizeName nodeHostNames;
in
{
driver = lib.mkForce (hostPkgs.runCommand "nixos-test-driver-${config.name}"
{
nativeBuildInputs = [
hostPkgs.makeWrapper
] ++ lib.optionals (!config.skipTypeCheck) [ hostPkgs.mypy ];
buildInputs = [ testDriver ];
testScript = config.testScriptString;
preferLocalBuild = true;
passthru = config.passthru;
meta = config.meta // {
mainProgram = "nixos-test-driver";
};
}
''
mkdir -p $out/bin
containers=(${toString containers})
${lib.optionalString (!config.skipTypeCheck) ''
# prepend type hints so the test script can be type checked with mypy
cat "${./test-script-prepend.py}" >> testScriptWithTypes
echo "${builtins.toString machineNames}" >> testScriptWithTypes
echo -n "$testScript" >> testScriptWithTypes
echo "Running type check (enable/disable: config.skipTypeCheck)"
echo "See https://nixos.org/manual/nixos/stable/#test-opt-skipTypeCheck"
mypy --no-implicit-optional \
--pretty \
--no-color-output \
testScriptWithTypes
''}
echo -n "$testScript" >> $out/test-script
ln -s ${testDriver}/bin/nixos-test-driver $out/bin/nixos-test-driver
wrapProgram $out/bin/nixos-test-driver \
${lib.concatStringsSep " " (map (name: "--add-flags '--container ${name}'") containers)} \
--add-flags "--test-script '$out/test-script'"
'');
test = lib.mkForce (lib.lazyDerivation {
# lazyDerivation improves performance when only passthru items and/or meta are used.
derivation = hostPkgs.stdenv.mkDerivation {
name = "vm-test-run-${config.name}";
requiredSystemFeatures = [ "uid-range" ];
buildCommand = ''
mkdir -p $out
# effectively mute the XMLLogger
export LOGFILE=/dev/null
${config.driver}/bin/nixos-test-driver -o $out
'';
passthru = config.passthru;
meta = config.meta;
};
inherit (config) passthru meta;
});
}

View File

@@ -0,0 +1,9 @@
{ extraPythonPackages, python3Packages, buildPythonApplication, setuptools, util-linux, systemd }:
buildPythonApplication {
pname = "test-driver";
version = "0.0.1";
propagatedBuildInputs = [ util-linux systemd ] ++ extraPythonPackages python3Packages;
nativeBuildInputs = [ setuptools ];
format = "pyproject";
src = ./.;
}

View File

@@ -14,8 +14,16 @@ find = {}
[tool.setuptools.package-data]
test_driver = ["py.typed"]
[tool.ruff]
target-version = "py311"
line-length = 88
select = [ "E", "F", "I", "U", "N", "RUF", "ANN", "A" ]
ignore = ["E501", "ANN101", "ANN401", "A003"]
[tool.mypy]
python_version = "3.13"
python_version = "3.11"
warn_redundant_casts = true
disallow_untyped_calls = true
disallow_untyped_defs = true

View File

@@ -0,0 +1,354 @@
import argparse
import os
import re
import subprocess
import time
from collections.abc import Callable
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Any
def prepare_machine_root(machinename: str, root: Path) -> None:
root.mkdir(parents=True, exist_ok=True)
root.joinpath("etc").mkdir(parents=True, exist_ok=True)
root.joinpath(".env").write_text(
"\n".join(f"{k}={v}" for k, v in os.environ.items())
)
def pythonize_name(name: str) -> str:
return re.sub(r"^[^A-z_]|[^A-z0-9_]", "_", name)
def retry(fn: Callable, timeout: int = 900) -> None:
"""Call the given function repeatedly, with 1 second intervals,
until it returns True or a timeout is reached.
"""
for _ in range(timeout):
if fn(False):
return
time.sleep(1)
if not fn(True):
raise Exception(f"action timed out after {timeout} seconds")
class Machine:
def __init__(self, name: str, toplevel: Path, rootdir: Path, out_dir: str) -> None:
self.name = name
self.toplevel = toplevel
self.out_dir = out_dir
self.process: subprocess.Popen | None = None
self.rootdir: Path = rootdir
def start(self) -> None:
prepare_machine_root(self.name, self.rootdir)
cmd = [
"systemd-nspawn",
"--keep-unit",
"-M",
self.name,
"-D",
self.rootdir,
"--register=no",
"--resolv-conf=off",
"--bind-ro=/nix/store",
"--bind",
self.out_dir,
"--bind=/proc:/run/host/proc",
"--bind=/sys:/run/host/sys",
"--private-network",
self.toplevel.joinpath("init"),
]
env = os.environ.copy()
env["SYSTEMD_NSPAWN_UNIFIED_HIERARCHY"] = "1"
self.process = subprocess.Popen(cmd, stdout=subprocess.PIPE, text=True, env=env)
self.container_pid = self.get_systemd_process()
def get_systemd_process(self) -> int:
assert self.process is not None, "Machine not started"
assert self.process.stdout is not None, "Machine has no stdout"
for line in self.process.stdout:
print(line, end="")
if line.startswith("systemd[1]: Startup finished in"):
break
else:
raise RuntimeError(f"Failed to start container {self.name}")
childs = (
Path(f"/proc/{self.process.pid}/task/{self.process.pid}/children")
.read_text()
.split()
)
assert (
len(childs) == 1
), f"Expected exactly one child process for systemd-nspawn, got {childs}"
try:
return int(childs[0])
except ValueError:
raise RuntimeError(f"Failed to parse child process id {childs[0]}")
def get_unit_info(self, unit: str) -> dict[str, str]:
proc = self.systemctl(f'--no-pager show "{unit}"')
if proc.returncode != 0:
raise Exception(
f'retrieving systemctl info for unit "{unit}"'
+ f" failed with exit code {proc.returncode}"
)
line_pattern = re.compile(r"^([^=]+)=(.*)$")
def tuple_from_line(line: str) -> tuple[str, str]:
match = line_pattern.match(line)
assert match is not None
return match[1], match[2]
return dict(
tuple_from_line(line)
for line in proc.stdout.split("\n")
if line_pattern.match(line)
)
def execute(
self,
command: str,
check_return: bool = True,
check_output: bool = True,
timeout: int | None = 900,
) -> subprocess.CompletedProcess:
"""
Execute a shell command, returning a list `(status, stdout)`.
Commands are run with `set -euo pipefail` set:
- If several commands are separated by `;` and one fails, the
command as a whole will fail.
- For pipelines, the last non-zero exit status will be returned
(if there is one; otherwise zero will be returned).
- Dereferencing unset variables fails the command.
- It will wait for stdout to be closed.
If the command detaches, it must close stdout, as `execute` will wait
for this to consume all output reliably. This can be achieved by
redirecting stdout to stderr `>&2`, to `/dev/console`, `/dev/null` or
a file. Examples of detaching commands are `sleep 365d &`, where the
shell forks a new process that can write to stdout and `xclip -i`, where
the `xclip` command itself forks without closing stdout.
Takes an optional parameter `check_return` that defaults to `True`.
Setting this parameter to `False` will not check for the return code
and return -1 instead. This can be used for commands that shut down
the VM and would therefore break the pipe that would be used for
retrieving the return code.
A timeout for the command can be specified (in seconds) using the optional
`timeout` parameter, e.g., `execute(cmd, timeout=10)` or
`execute(cmd, timeout=None)`. The default is 900 seconds.
"""
# Always run command with shell opts
command = f"set -euo pipefail; {command}"
proc = subprocess.run(
[
"nsenter",
"--target",
str(self.container_pid),
"--mount",
"--uts",
"--ipc",
"--net",
"--pid",
"--cgroup",
"/bin/sh",
"-c",
command,
],
timeout=timeout,
check=False,
stdout=subprocess.PIPE,
text=True,
)
return proc
def systemctl(self, q: str) -> subprocess.CompletedProcess:
"""
Runs `systemctl` commands with optional support for
`systemctl --user`
```py
# run `systemctl list-jobs --no-pager`
machine.systemctl("list-jobs --no-pager")
# spawn a shell for `any-user` and run
# `systemctl --user list-jobs --no-pager`
machine.systemctl("list-jobs --no-pager", "any-user")
```
"""
return self.execute(f"systemctl {q}")
def wait_for_unit(self, unit: str, timeout: int = 900) -> None:
"""
Wait for a systemd unit to get into "active" state.
Throws exceptions on "failed" and "inactive" states as well as after
timing out.
"""
def check_active(_: bool) -> bool:
info = self.get_unit_info(unit)
state = info["ActiveState"]
if state == "failed":
raise Exception(f'unit "{unit}" reached state "{state}"')
if state == "inactive":
proc = self.systemctl("list-jobs --full 2>&1")
if "No jobs" in proc.stdout:
info = self.get_unit_info(unit)
if info["ActiveState"] == state:
raise Exception(
f'unit "{unit}" is inactive and there are no pending jobs'
)
return state == "active"
retry(check_active, timeout)
def succeed(self, command: str, timeout: int | None = None) -> str:
res = self.execute(command, timeout=timeout)
if res.returncode != 0:
raise RuntimeError(f"Failed to run command {command}")
return res.stdout
def shutdown(self) -> None:
"""
Shut down the machine, waiting for the VM to exit.
"""
if self.process:
self.process.terminate()
self.process.wait()
self.process = None
def release(self) -> None:
self.shutdown()
def setup_filesystems() -> None:
# We don't care about cleaning up the mount points, since we're running in a nix sandbox.
Path("/run").mkdir(parents=True, exist_ok=True)
subprocess.run(["mount", "-t", "tmpfs", "none", "/run"], check=True)
subprocess.run(["mount", "-t", "cgroup2", "none", "/sys/fs/cgroup"], check=True)
Path("/etc").chmod(0o755)
Path("/etc/os-release").touch()
Path("/etc/machine-id").write_text("a5ea3f98dedc0278b6f3cc8c37eeaeac")
class Driver:
def __init__(self, containers: list[Path], testscript: str, out_dir: str) -> None:
self.containers = containers
self.testscript = testscript
self.out_dir = out_dir
setup_filesystems()
self.tempdir = TemporaryDirectory()
tempdir_path = Path(self.tempdir.name)
self.machines = []
for container in containers:
name_match = re.match(r".*-nixos-system-(.+)-\d.+", container.name)
if not name_match:
raise ValueError(f"Unable to extract hostname from {container.name}")
name = name_match.group(1)
self.machines.append(
Machine(
name=name,
toplevel=container,
rootdir=tempdir_path / name,
out_dir=self.out_dir,
)
)
def start_all(self) -> None:
for machine in self.machines:
machine.start()
def test_symbols(self) -> dict[str, Any]:
general_symbols = dict(
start_all=self.start_all,
machines=self.machines,
driver=self,
Machine=Machine, # for typing
)
machine_symbols = {pythonize_name(m.name): m for m in self.machines}
# If there's exactly one machine, make it available under the name
# "machine", even if it's not called that.
if len(self.machines) == 1:
(machine_symbols["machine"],) = self.machines
print(
"additionally exposed symbols:\n "
+ ", ".join(map(lambda m: m.name, self.machines))
+ ",\n "
+ ", ".join(list(general_symbols.keys()))
)
return {**general_symbols, **machine_symbols}
def test_script(self) -> None:
"""Run the test script"""
exec(self.testscript, self.test_symbols(), None)
def run_tests(self) -> None:
"""Run the test script (for non-interactive test runs)"""
self.test_script()
def __enter__(self) -> "Driver":
return self
def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None:
for machine in self.machines:
machine.release()
def writeable_dir(arg: str) -> Path:
"""Raises an ArgumentTypeError if the given argument isn't a writeable directory
Note: We want to fail as early as possible if a directory isn't writeable,
since an executed nixos-test could fail (very late) because of the test-driver
writing in a directory without proper permissions.
"""
path = Path(arg)
if not path.is_dir():
raise argparse.ArgumentTypeError(f"{path} is not a directory")
if not os.access(path, os.W_OK):
raise argparse.ArgumentTypeError(f"{path} is not a writeable directory")
return path
def main() -> None:
arg_parser = argparse.ArgumentParser(prog="nixos-test-driver")
arg_parser.add_argument(
"--containers",
nargs="+",
type=Path,
help="container system toplevel paths",
)
arg_parser.add_argument(
"--test-script",
help="the test script to run",
type=Path,
)
arg_parser.add_argument(
"-o",
"--output-directory",
default=Path.cwd(),
help="the directory to bind to /run/test-results",
type=writeable_dir,
)
args = arg_parser.parse_args()
with Driver(
args.containers,
args.test_script.read_text(),
args.output_directory.resolve(),
) as driver:
driver.run_tests()

View File

@@ -0,0 +1,33 @@
test:
{ pkgs
, self
, ...
}:
let
inherit (pkgs) lib;
nixos-lib = import (pkgs.path + "/nixos/lib") { };
in
(nixos-lib.runTest ({ hostPkgs, ... }: {
hostPkgs = pkgs;
# speed-up evaluation
defaults = {
documentation.enable = lib.mkDefault false;
boot.isContainer = true;
# undo qemu stuff
system.build.initialRamdisk = "";
virtualisation.sharedDirectories = lib.mkForce { };
networking.useDHCP = false;
# we have not private networking so far
networking.interfaces = lib.mkForce { };
#networking.primaryIPAddress = lib.mkForce null;
systemd.services.backdoor.enable = false;
};
# to accept external dependencies such as disko
node.specialArgs.self = self;
imports = [
test
./container-driver/module.nix
];
})).config.result

21
checks/lib/test-base.nix Normal file
View File

@@ -0,0 +1,21 @@
test:
{ pkgs
, self
, ...
}:
let
inherit (pkgs) lib;
nixos-lib = import (pkgs.path + "/nixos/lib") { };
in
(nixos-lib.runTest {
hostPkgs = pkgs;
# speed-up evaluation
defaults = {
documentation.enable = lib.mkDefault false;
nix.settings.min-free = 0;
};
# to accept external dependencies such as disko
node.specialArgs.self = self;
imports = [ test ];
}).config.result

View File

@@ -1,83 +0,0 @@
(
{ pkgs, ... }:
{
name = "matrix-synapse";
nodes.machine =
{
config,
self,
lib,
...
}:
{
imports = [
self.clanModules.matrix-synapse
self.nixosModules.clanCore
{
clan.core.settings.directory = ./.;
services.nginx.virtualHosts."matrix.clan.test" = {
enableACME = lib.mkForce false;
forceSSL = lib.mkForce false;
};
clan.nginx.acme.email = "admins@clan.lol";
clan.matrix-synapse = {
server_tld = "clan.test";
app_domain = "matrix.clan.test";
};
clan.matrix-synapse.users.admin.admin = true;
clan.matrix-synapse.users.someuser = { };
clan.core.facts.secretStore = "vm";
clan.core.vars.settings.secretStore = "vm";
clan.core.vars.settings.publicStore = "in_repo";
# because we use systemd-tmpfiles to copy the secrets, we need to a separate systemd-tmpfiles call to provision them.
boot.postBootCommands = "${config.systemd.package}/bin/systemd-tmpfiles --create /etc/tmpfiles.d/00-vmsecrets.conf";
systemd.tmpfiles.settings."00-vmsecrets" = {
# run before 00-nixos.conf
"/etc/secrets" = {
d.mode = "0700";
z.mode = "0700";
};
"/etc/secrets/matrix-synapse/synapse-registration_shared_secret" = {
f.argument = "supersecret";
z = {
mode = "0400";
user = "root";
};
};
"/etc/secrets/matrix-password-admin/matrix-password-admin" = {
f.argument = "matrix-password1";
z = {
mode = "0400";
user = "root";
};
};
"/etc/secrets/matrix-password-someuser/matrix-password-someuser" = {
f.argument = "matrix-password2";
z = {
mode = "0400";
user = "root";
};
};
};
}
];
};
testScript = ''
start_all()
machine.wait_for_unit("matrix-synapse")
machine.succeed("${pkgs.netcat}/bin/nc -z -v ::1 8008")
machine.wait_until_succeeds("${pkgs.curl}/bin/curl -Ssf -L http://localhost/_matrix/static/ -H 'Host: matrix.clan.test'")
machine.systemctl("restart matrix-synapse >&2") # check if user creation is idempotent
machine.execute("journalctl -u matrix-synapse --no-pager >&2")
machine.wait_for_unit("matrix-synapse")
machine.succeed("${pkgs.netcat}/bin/nc -z -v ::1 8008")
machine.succeed("${pkgs.curl}/bin/curl -Ssf -L http://localhost/_matrix/static/ -H 'Host: matrix.clan.test'")
'';
}
)

View File

@@ -1 +0,0 @@
registration_shared_secret: supersecret

View File

@@ -0,0 +1,21 @@
(import ../lib/container-test.nix) ({ pkgs, ... }: {
name = "meshnamed";
nodes.machine = { self, ... }: {
imports = [
self.nixosModules.clanCore
{
clanCore.machineName = "machine";
clan.networking.meshnamed.networks.vpn.subnet = "fd43:7def:4b50:28d0:4e99:9347:3035:17ef/88";
clanCore.clanDir = ./.;
}
];
};
testScript = ''
start_all()
machine.wait_for_unit("meshnamed")
out = machine.succeed("${pkgs.dnsutils}/bin/dig AAAA foo.7vbx332lkaunatuzsndtanix54.vpn @meshnamed +short")
print(out)
assert out.strip() == "fd43:7def:4b50:28d0:4e99:9347:3035:17ef"
'';
})

View File

@@ -1,63 +0,0 @@
{
self,
...
}:
{
clan.machines.test-morph-machine = {
imports = [
./template/configuration.nix
self.nixosModules.clanCore
];
nixpkgs.hostPlatform = "x86_64-linux";
environment.etc."testfile".text = "morphed";
};
clan.templates.machine.test-morph-template = {
description = "Morph a machine";
path = ./template;
};
perSystem =
{
pkgs,
...
}:
{
checks = pkgs.lib.mkIf (pkgs.stdenv.isLinux && !pkgs.stdenv.isAarch64) {
nixos-test-morph = self.clanLib.test.baseTest {
name = "morph";
nodes = {
actual =
{ pkgs, ... }:
let
dependencies = [
pkgs.stdenv.drvPath
pkgs.stdenvNoCC
self.nixosConfigurations.test-morph-machine.config.system.build.toplevel
] ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs);
closureInfo = pkgs.closureInfo { rootPaths = dependencies; };
in
{
environment.etc."install-closure".source = "${closureInfo}/store-paths";
system.extraDependencies = dependencies;
virtualisation.memorySize = 2048;
virtualisation.useNixStoreImage = true;
virtualisation.writableStore = true;
environment.systemPackages = [ self.packages.${pkgs.system}.clan-cli-full ];
};
};
testScript = ''
start_all()
actual.fail("cat /etc/testfile")
actual.succeed("env CLAN_DIR=${self.checks.x86_64-linux.clan-core-for-checks} clan machines morph test-morph-template --i-will-be-fired-for-using-this --debug --name test-morph-machine")
assert actual.succeed("cat /etc/testfile") == "morphed"
'';
} { inherit pkgs self; };
};
};
}

View File

@@ -1,15 +0,0 @@
{ modulesPath, ... }:
{
imports = [
# we need these 2 modules always to be able to run the tests
(modulesPath + "/testing/test-instrumentation.nix")
(modulesPath + "/virtualisation/qemu-vm.nix")
(modulesPath + "/profiles/minimal.nix")
];
virtualisation.useNixStoreImage = true;
virtualisation.writableStore = true;
clan.core.enableRecommendedDefaults = false;
}

View File

@@ -1,53 +0,0 @@
{
pkgs,
nixosLib,
clan-core,
...
}:
nixosLib.runTest (
{ ... }:
{
imports = [
clan-core.modules.nixosTest.clanTest
];
hostPkgs = pkgs;
name = "service-mycelium";
clan = {
test.useContainers = false;
directory = ./.;
modules."@clan/mycelium" = ../../clanServices/mycelium/default.nix;
inventory = {
machines.server = { };
instances = {
mycelium-test = {
module.name = "@clan/mycelium";
module.input = "self";
roles.peer.machines."server".settings = {
openFirewall = true;
addHostedPublicNodes = true;
};
};
};
};
};
nodes = {
server = { };
};
testScript = ''
start_all()
# Check that mycelium service is running
server.wait_for_unit("mycelium")
server.succeed("systemctl status mycelium")
# Check that mycelium is listening on its default port
server.wait_until_succeeds("${pkgs.iproute2}/bin/ss -tulpn | grep -q 'mycelium'", 10)
'';
}
)

View File

@@ -1,6 +0,0 @@
[
{
"publickey": "age122lc4fvw2p22gcvwqeme5k49qxtjanqkl2xvr6qvf3r0zyh7scuqz28cam",
"type": "age"
}
]

View File

@@ -1,15 +0,0 @@
{
"data": "ENC[AES256_GCM,data:hLJS+CJllYM50KxKuiYamxBLGd9lwoeIFapP9mZAlVGH5DSenylcKUfsphxafASoB516qns2DznBoS9mWqg9uTsRZjk4WlR3x6A=,iv:uRiIpUKIiV3riNcBAWUqhZbE+Vb7lLMfU0C/TClVZ6M=,tag:4+nsMssiSyq9Iv7sDuWmoQ==,type:str]",
"sops": {
"age": [
{
"recipient": "age1qm0p4vf9jvcnn43s6l4prk8zn6cx0ep9gzvevxecv729xz540v8qa742eg",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBPUWFOMzluRmdOQXBmRjRN\ncXNSUlB5Z0t6dWYxNVkvMmhrN1FDdmxHcTNJCkhPL3BYMFFXMmU5ZGRqOC9KWEgv\nSHB5OUJqTk5Dd0tDTks1R1ZhYktrLzgKLS0tIHJIMlFRVWphZXlISmR3VUJKUjNk\ndWF4eCt6UHBrSndBay95RVJ3dldiaFkKCgYqrt0aCGRTaHycBoeqv/zeByu2ZZ3Z\nVfgxnD9liIQkS2wERbpk0/Yq9wkKgVxj+DZoWwHYhP0eKCw2UOorCA==\n-----END AGE ENCRYPTED FILE-----\n"
}
],
"lastmodified": "2025-06-04T11:54:59Z",
"mac": "ENC[AES256_GCM,data:xoeOz7FRCPJ18UTsfbY1x/N65pxbTsehT9Kv3MgEd6NQJn6FTvquaj3HEZ0KvIzStBz1FNOhSql9CZUFc4StYps05EbX61MMMnz6Nlj3xcTwuVQFabGoinxcXbCDSA+tAW7VqzVxumj6FMDg+r77gdcIApZjGJg4Z9ws2RZd3u4=,iv:U8IUDwmfg8Umob9mtKgGaKoIY4SKNL895BABJxzx5n8=,tag:tnMCx6D/17ZYgI6SgNS29A==,type:str]",
"unencrypted_suffix": "_unencrypted",
"version": "3.10.2"
}
}

View File

@@ -1 +0,0 @@
../../../users/admin

View File

@@ -1,4 +0,0 @@
{
"publickey": "age1qm0p4vf9jvcnn43s6l4prk8zn6cx0ep9gzvevxecv729xz540v8qa742eg",
"type": "age"
}

View File

@@ -1 +0,0 @@
52d:87c1:4222:b550:ee01:a7ae:254:5a66

View File

@@ -1 +0,0 @@
../../../../../../sops/machines/server

View File

@@ -1,19 +0,0 @@
{
"data": "ENC[AES256_GCM,data:DGzl2G4H+NkwXq0fCUQS0+8FG1x9xoIsYvAgUxP4Qp8=,iv:CXOJVgYNthVOZ4vbdI3n4KLXSFVemzaoEnRGMC+m0i8=,tag:/u+pV3xWpUq0ZtAm6LKuGQ==,type:str]",
"sops": {
"age": [
{
"recipient": "age122lc4fvw2p22gcvwqeme5k49qxtjanqkl2xvr6qvf3r0zyh7scuqz28cam",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBZZHZjdXMwclBTeGthcGpM\nV1ArVy83akNHNEpXVFhoR1FWNlJUeHNKTW00CjJFTFZneFNrL0hDMXJpaTQ2M1ln\nTmdPMGhzeUp0NU55QnhCZEU2QVk1OG8KLS0tIDFhQmJhOHJsTjhYNEhITEw0WFgy\nWC9pTi9od0wyMWtZRVZJYWo0Nmo5SHMKDohnAAfrnGOiw55huMme2EEWE53N/feS\nutvbiTZh1ECHCi/uoK757fjnJ/WrQMSxUpctT9I8bpJRtbTqkx3XRw==\n-----END AGE ENCRYPTED FILE-----\n"
},
{
"recipient": "age1qm0p4vf9jvcnn43s6l4prk8zn6cx0ep9gzvevxecv729xz540v8qa742eg",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBZeTZENGFpWndDbmdsWDRw\nMTBCVXg5Zkg2a2s5Yk1HSERIVlVQRXdUSUNnCnREbno0dEN0ZEgvOFNMRG1ReGx4\na0h1YUFuMkxBZXJUTE9xOUVUMitEalkKLS0tIFZMZ21qclRqUFR0dlAyMFkzdUNX\nNjRLTWVRVWtHSDlDakEzMmpRVWkyc0EKabm8mTKJVxQNTaIgU+8rb/xk9Dpg+Zjz\nb+wgD0+TlARlenMtIub8Y6N06ENOc20oovylfu+g7xV+EkvRPCd6tA==\n-----END AGE ENCRYPTED FILE-----\n"
}
],
"lastmodified": "2025-06-04T11:55:02Z",
"mac": "ENC[AES256_GCM,data:UIBaD/3mACgFzkajkFXz3oKai8IxpYQriR2t0mc5fL92P5ECloxCobY386TDZYOEVrDJ45Bw+IzqZbsCx/G9f1xCCTR2JvqygxYIsK3TpQPsboJzb9Cz3dBNBCXGboVykcg/NobEMaJBw1xtdAQBhuo8S7ymIuOPtGz0vPFJkf8=,iv:g0YAOBsRpgAOikKDMJDyOtcVx+0QwetfA8R6wQFH7lY=,tag:sfdFLjtiqFHdP/Qe1suBBQ==,type:str]",
"unencrypted_suffix": "_unencrypted",
"version": "3.10.2"
}
}

View File

@@ -1 +0,0 @@
../../../../../../sops/users/admin

View File

@@ -1 +0,0 @@
2125c6b039374467eaa3eaf552bd3e97f434d16006433cfbba3e6823c958b728

View File

@@ -1,27 +0,0 @@
{ self, ... }:
let
documentationModule = {
# This is how some downstream users currently generate documentation
# If this breaks notify them via matrix since we spent ~5 hrs for bughunting last time.
documentation.nixos.enable = true;
documentation.nixos.extraModules = [
self.nixosModules.clanCore
# This is the only option that is not part of the
# module because it is usually set by flake-parts
{ clan.core.settings.directory = ./.; }
];
};
in
{
clan = {
machines.test-documentation = {
# Dummy file system
fileSystems."/".device = "/dev/null";
boot.loader.grub.device = "/dev/null";
nixpkgs.hostPlatform = "x86_64-linux";
imports = [
documentationModule
];
};
};
}

View File

@@ -1,73 +0,0 @@
({
name = "postgresql";
nodes.machine =
{ self, config, ... }:
{
imports = [
self.nixosModules.clanCore
self.clanModules.postgresql
self.clanModules.localbackup
];
clan.postgresql.users.test = { };
clan.postgresql.databases.test.create.options.OWNER = "test";
clan.postgresql.databases.test.restore.stopOnRestore = [ "sample-service" ];
clan.localbackup.targets.hdd.directory = "/mnt/external-disk";
clan.core.settings.directory = ./.;
systemd.services.sample-service = {
wantedBy = [ "multi-user.target" ];
script = ''
while true; do
echo "Hello, world!"
sleep 5
done
'';
};
environment.systemPackages = [ config.services.postgresql.package ];
};
testScript =
{ nodes, ... }:
''
start_all()
machine.wait_for_unit("postgresql")
machine.wait_for_unit("sample-service")
# Create a test table
machine.succeed("runuser -u postgres -- /run/current-system/sw/bin/psql -c 'CREATE TABLE test (id serial PRIMARY KEY);' test")
machine.succeed("/run/current-system/sw/bin/localbackup-create >&2")
timestamp_before = int(machine.succeed("systemctl show --property=ExecMainStartTimestampMonotonic sample-service | cut -d= -f2").strip())
machine.succeed("test -e /mnt/external-disk/snapshot.0/machine/var/backup/postgres/test/pg-dump || { echo 'pg-dump not found'; exit 1; }")
machine.succeed("runuser -u postgres -- /run/current-system/sw/bin/psql -d test -c 'INSERT INTO test DEFAULT VALUES;'")
machine.succeed("runuser -u postgres -- /run/current-system/sw/bin/psql -d test -c 'DROP TABLE test;'")
machine.succeed("test -e /var/backup/postgres/test/pg-dump || { echo 'pg-dump not found'; exit 1; }")
machine.succeed("rm -rf /var/backup/postgres")
machine.succeed("NAME=/mnt/external-disk/snapshot.0 FOLDERS=/var/backup/postgres/test /run/current-system/sw/bin/localbackup-restore >&2")
machine.succeed("test -e /var/backup/postgres/test/pg-dump || { echo 'pg-dump not found'; exit 1; }")
machine.succeed("""
set -x
${nodes.machine.clan.core.state.test.postRestoreCommand}
""")
machine.succeed("runuser -u postgres -- /run/current-system/sw/bin/psql -l >&2")
machine.succeed("runuser -u postgres -- /run/current-system/sw/bin/psql -d test -c '\dt' >&2")
timestamp_after = int(machine.succeed("systemctl show --property=ExecMainStartTimestampMonotonic sample-service | cut -d= -f2").strip())
assert timestamp_before < timestamp_after, f"{timestamp_before} >= {timestamp_after}: expected sample-service to be restarted after restore"
# Check that the table is still there
machine.succeed("runuser -u postgres -- /run/current-system/sw/bin/psql -d test -c 'SELECT * FROM test;'")
output = machine.succeed("runuser -u postgres -- /run/current-system/sw/bin/psql --csv -c \"SELECT datdba::regrole FROM pg_database WHERE datname = 'test'\"")
owner = output.split("\n")[1]
assert owner == "test", f"Expected database owner to be 'test', got '{owner}'"
# check if restore works if the database does not exist
machine.succeed("runuser -u postgres -- dropdb test")
machine.succeed("${nodes.machine.clan.core.state.test.postRestoreCommand}")
machine.succeed("runuser -u postgres -- /run/current-system/sw/bin/psql -d test -c '\dt' >&2")
'';
})

35
checks/schemas.nix Normal file
View File

@@ -0,0 +1,35 @@
{ self, runCommand, check-jsonschema, pkgs, lib, ... }:
let
clanModules.clanCore = self.nixosModules.clanCore;
baseModule = {
imports =
(import (pkgs.path + "/nixos/modules/module-list.nix"))
++ [{
nixpkgs.hostPlatform = "x86_64-linux";
clanCore.clanName = "dummy";
}];
};
optionsFromModule = module:
let
evaled = lib.evalModules {
modules = [ module baseModule ];
};
in
evaled.options.clan;
clanModuleSchemas = lib.mapAttrs (_: module: self.lib.jsonschema.parseOptions (optionsFromModule module)) clanModules;
mkTest = name: schema: runCommand "schema-${name}" { } ''
${check-jsonschema}/bin/check-jsonschema \
--check-metaschema ${builtins.toFile "schema-${name}" (builtins.toJSON schema)}
touch $out
'';
in
lib.mapAttrs'
(name: schema: {
name = "schema-${name}";
value = mkTest name schema;
})
clanModuleSchemas

View File

@@ -1,19 +1,19 @@
{
(import ../lib/test-base.nix) {
name = "secrets";
nodes.machine =
{ self, config, ... }:
{
environment.etc."privkey.age".source = ./key.age;
imports = [ (self.nixosModules.clanCore) ];
environment.etc."secret".source = config.sops.secrets.secret.path;
environment.etc."group-secret".source = config.sops.secrets.group-secret.path;
sops.age.keyFile = "/etc/privkey.age";
nodes.machine = { self, config, ... }: {
imports = [
(self.nixosModules.clanCore)
];
environment.etc."secret".source = config.sops.secrets.secret.path;
environment.etc."group-secret".source = config.sops.secrets.group-secret.path;
sops.age.keyFile = ./key.age;
clan.core.settings.directory = "${./.}";
clanCore.clanDir = "${./.}";
clanCore.machineName = "machine";
networking.hostName = "machine";
};
networking.hostName = "machine";
};
testScript = ''
machine.succeed("cat /etc/secret >&2")
machine.succeed("cat /etc/group-secret >&2")

View File

@@ -1,4 +1,4 @@
{
"publickey": "age15x8u838dwqflr3t6csf4tlghxm4tx77y379ncqxav7y2n8qp7yzqgrwt00",
"type": "age"
}
}

View File

@@ -1,4 +1,4 @@
{
"publickey": "age15x8u838dwqflr3t6csf4tlghxm4tx77y379ncqxav7y2n8qp7yzqgrwt00",
"type": "age"
}
}

View File

@@ -1,66 +0,0 @@
{
pkgs,
nixosLib,
clan-core,
...
}:
nixosLib.runTest (
{ hostPkgs, config, ... }:
{
imports = [
clan-core.modules.nixosTest.clanTest
];
hostPkgs = pkgs;
# This tests the compatibility of the inventory
# With the test framework
# - legacy-modules
# - clan.service modules
name = "service-dummy-test-from-flake";
clan.test.fromFlake = ./.;
extraPythonPackages = _p: [
clan-core.legacyPackages.${hostPkgs.system}.nixosTestLib
];
testScript =
{ nodes, ... }:
''
from nixos_test_lib.nix_setup import setup_nix_in_nix # type: ignore[import-untyped]
setup_nix_in_nix(None) # No closure info for this test
def run_clan(cmd: list[str], **kwargs) -> str:
import subprocess
clan = "${clan-core.packages.${hostPkgs.system}.clan-cli}/bin/clan"
clan_args = ["--flake", "${config.clan.test.flakeForSandbox}"]
return subprocess.run(
["${hostPkgs.util-linux}/bin/unshare", "--user", "--map-user", "1000", "--map-group", "1000", clan, *cmd, *clan_args],
**kwargs,
check=True,
).stdout
start_all()
admin1.wait_for_unit("multi-user.target")
peer1.wait_for_unit("multi-user.target")
# Provided by the legacy module
print(admin1.succeed("systemctl status dummy-service"))
print(peer1.succeed("systemctl status dummy-service"))
# 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}"
run_clan(["machines", "list"])
'';
}
)

View File

@@ -1,71 +0,0 @@
{
inputs.clan-core.url = "https://git.clan.lol/clan/clan-core/archive/main.tar.gz";
inputs.nixpkgs.follows = "clan-core/nixpkgs";
outputs =
{ self, clan-core, ... }:
let
# Usage see: https://docs.clan.lol
clan = clan-core.lib.clan {
inherit self;
inventory =
{ ... }:
{
meta.name = "foo";
machines.peer1 = { };
machines.admin1 = { };
services = {
legacy-module.default = {
roles.peer.machines = [ "peer1" ];
roles.admin.machines = [ "admin1" ];
};
};
instances."test" = {
module.name = "new-service";
module.input = "self";
roles.peer.machines.peer1 = { };
};
modules = {
legacy-module = ./legacy-module;
};
};
modules.new-service = {
_class = "clan.service";
manifest.name = "new-service";
roles.peer = { };
perMachine = {
nixosModule = {
# This should be generated by:
# nix run .#generate-test-vars -- checks/service-dummy-test service-dummy-test
clan.core.vars.generators.new-service = {
files.not-a-secret = {
secret = false;
deploy = true;
};
files.a-secret = {
secret = true;
deploy = true;
owner = "nobody";
group = "users";
mode = "0644";
};
script = ''
# This is a dummy script that does nothing
echo -n "not-a-secret" > $out/not-a-secret
echo -n "a-secret" > $out/a-secret
'';
};
};
};
};
};
in
{
# all machines managed by Clan
inherit (clan.config) nixosConfigurations nixosModules clanInternals;
};
}

View File

@@ -1,10 +0,0 @@
---
description = "Set up dummy-module"
categories = ["System"]
features = [ "inventory" ]
[constraints]
roles.admin.min = 1
roles.admin.max = 1
---

View File

@@ -1,5 +0,0 @@
{
imports = [
../shared.nix
];
}

View File

@@ -1,5 +0,0 @@
{
imports = [
../shared.nix
];
}

View File

@@ -1,34 +0,0 @@
{ config, ... }:
{
systemd.services.dummy-service = {
enable = true;
description = "Dummy service";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
script = ''
generated_password_path="${config.clan.core.vars.generators.dummy-generator.files.generated-password.path}"
if [ ! -f "$generated_password_path" ]; then
echo "Generated password file not found: $generated_password_path"
exit 1
fi
host_id_path="${config.clan.core.vars.generators.dummy-generator.files.host-id.path}"
if [ ! -e "$host_id_path" ]; then
echo "Host ID file not found: $host_id_path"
exit 1
fi
'';
};
# TODO: add and prompt and make it work in the test framework
clan.core.vars.generators.dummy-generator = {
files.host-id.secret = false;
files.generated-password.secret = true;
script = ''
echo $RANDOM > "$out"/host-id
echo $RANDOM > "$out"/generated-password
'';
};
}

View File

@@ -1,6 +0,0 @@
[
{
"publickey": "age12yt078p9ewxy2sh0a36nxdpgglv8wqqftmj4dkj9rgy5fuyn4p0q5nje9m",
"type": "age"
}
]

View File

@@ -1,6 +0,0 @@
[
{
"publickey": "age12w2ld4vxfyf3hdq2d8la4cu0tye4pq97egvv3me4wary7xkdnq2snh0zx2",
"type": "age"
}
]

View File

@@ -1,15 +0,0 @@
{
"data": "ENC[AES256_GCM,data:GPpsUhSzWPtTP8EUNKsobFXjYqDldhkkIH6hBk11RsDLAGWdhVrwcISGbhsWpYhvAdPKA84DB6Zqyh9lL2bLM9//ybC1kzY20BQ=,iv:NrxMLdedT2FCkUAD00SwsAHchIsxWvqe7BQekWuJcxw=,tag:pMDXcMyHnLF2t3Qhb1KolA==,type:str]",
"sops": {
"age": [
{
"recipient": "age1qm0p4vf9jvcnn43s6l4prk8zn6cx0ep9gzvevxecv729xz540v8qa742eg",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBzb2tWb1ExKzdmUTRzaGVj\nK3cyYTBHZTJwVjM1SzUvbHFiMnVhY05iKzFZCnJTSE1VSVdpcUFLSEJuaE1CZzJD\nWjZxYzN2cUltdThNMVRKU3FIb20vUXMKLS0tIFlHQXRIdnMybDZFUVEzWlQrc1dw\nbUxhZURXblhHd0pka0JIK1FTZEVqdUEKI/rfxQRBc+xGRelhswkJQ9GcZs6lzfgy\nuCxS5JI9npdPLQ/131F3b21+sP5YWqks41uZG+vslM1zQ+BlENNhDw==\n-----END AGE ENCRYPTED FILE-----\n"
}
],
"lastmodified": "2025-05-04T12:44:13Z",
"mac": "ENC[AES256_GCM,data:fWxLHXBWolHVxv6Q7utcy6OVLV13ziswrIYyNKiwy1vsU8i7xvvuGO1HlnE+q43D2WuHR53liKq1UHuf1JMrWzTwZ0PYe+CVugtoEtbR2qu3rK/jAkOyMyhmmHzmf6Rp4ZMCzKgZeC/X2bDKY/z0firHAvjWydEyogutHpvtznM=,iv:OQI3FfkLneqbdztAXVQB3UkHwDPK+0hWu5hZ9m8Oczg=,tag:em6GfS2QHsXs391QKPxfmA==,type:str]",
"unencrypted_suffix": "_unencrypted",
"version": "3.10.2"
}
}

View File

@@ -1,15 +0,0 @@
{
"data": "ENC[AES256_GCM,data:W3cOkUYL5/YulW2pEISyTlMaA/t7/WBE7BoCdFlqrqgaCL7tG4IV2HgjiPWzIVMs0zvDSaghdEvAIoB4wOf470d1nSWs0/E8SDk=,iv:wXXaZIw3sPY8L/wxsu7+C5v+d3RQRuwxZRP4YLkS8K4=,tag:HeK4okj7O7XDA9JDz2KULw==,type:str]",
"sops": {
"age": [
{
"recipient": "age1qm0p4vf9jvcnn43s6l4prk8zn6cx0ep9gzvevxecv729xz540v8qa742eg",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAxRC83b3dtSVpXcGovNnVs\nTzFka2J2MEFhYkF1ajVrdjMrNUtPWGRObjM4Cm5zSUR5OGw0T0FaL3BaWmR6L29W\nU2syMFIyMUhFRUZpWFpCT28vWko2ZU0KLS0tIFpHK3BjU1V1L0FrMGtwTGFuU3Mz\nRkV5VjI2Vndod202bUR3RWQwNXpmVzQKNk8/y7M62wTIIKqY4r3ZRk5aUCRUfine\n1LUSHMKa2bRe+hR7nS7AF4BGXp03h2UPY0FP5+U5q8XuIj1jfMX8kg==\n-----END AGE ENCRYPTED FILE-----\n"
}
],
"lastmodified": "2025-05-04T12:44:16Z",
"mac": "ENC[AES256_GCM,data:yTkQeFvKrN1+5FP+yInsaRWSAG+ZGG0uWF3+gVRvzJTFxab8kT2XkAMc+4D7SKgcjsmwBBb77GNoAKaKByhZ92UaCfZ2X66i7ZmYUwLM1NVVmm+xiwwjsh7PJXlZO/70anTzd1evtlZse0jEmRnV5Y0F0M6YqXmuwU+qGUJU2F8=,iv:sy6ozhXonWVruaQfa7pdEoV5GkNZR/UbbINKAPbgWeg=,tag:VMruQ1KExmlMR7TsGNgMlg==,type:str]",
"unencrypted_suffix": "_unencrypted",
"version": "3.10.2"
}
}

View File

@@ -1 +0,0 @@
../../../users/admin

View File

@@ -1,4 +0,0 @@
{
"publickey": "age1qm0p4vf9jvcnn43s6l4prk8zn6cx0ep9gzvevxecv729xz540v8qa742eg",
"type": "age"
}

View File

@@ -1,19 +0,0 @@
{
"data": "ENC[AES256_GCM,data:T8edCvw=,iv:7/G5xt5fv38I9uFzk7WMIr9xQdz/6lFxqOC+18HBg8Q=,tag:F39Cxbgmzml+lZLsZ59Kmg==,type:str]",
"sops": {
"age": [
{
"recipient": "age12yt078p9ewxy2sh0a36nxdpgglv8wqqftmj4dkj9rgy5fuyn4p0q5nje9m",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBPNUhiYkZWK3dPMHNiRTVM\nRHNvaHFsOFp1c0UxQitwVG0zY01MNDZRV1E4CjEybENoTVIzN29vQ3FtUTRSYmFU\nNXIzQllVSllXRGN2M1B6WXJLdHZSajgKLS0tIDllZ0ZmZUcxMHhDQUpUOEdWbmkv\neUQweHArYTdFSmNteVpuQ3BKdnh0Y0UKs8Hm3D+rXRRfpUVSZM3zYjs6b9z8g10D\nGTkvreUMim4CS22pjdQ3eNA9TGeDXfWXE7XzwXLCb+wVcf7KwbDmvg==\n-----END AGE ENCRYPTED FILE-----\n"
},
{
"recipient": "age1qm0p4vf9jvcnn43s6l4prk8zn6cx0ep9gzvevxecv729xz540v8qa742eg",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBKSDhpT3cvck9PenZYVEZH\ndFQreVRBdG93L1dBUGlvYjFWcDlHWUJsZUVBCm9DMTJ4UytiYzlEVHNWdUcwS1ds\nT0dhbzAzNDdmbDBCU0dvL2xNeHpXcGsKLS0tIFArbmpsbzU3WnpJdUt1MGN0L1d0\nV1JkTDJYWUxsbmhTQVNOeVRaSUhTODQKk9Vph2eldS5nwuvVX0SCsxEm4B+sO76Z\ndIjJ3OQxzoZmXMaOOuKHC5U0Y75Qn7eXC43w5KHsl2CMIUYsBGJOZw==\n-----END AGE ENCRYPTED FILE-----\n"
}
],
"lastmodified": "2025-05-04T12:44:14Z",
"mac": "ENC[AES256_GCM,data:6fKrS1eLLUWlHkQpxLFXBRk6f2wa5ADLMViVvYXXGU24ayl9UuNSKrCRHp9cbzhqhti3HdwyNt6TM+2X6qhiiAQanKEB2PF7JRYX74NfNKil9BEDjt5AqqtpSgVv5l7Ku/uSHaPkd2sDmzHsy5Q4bSGxJQokStk1kidrwle+mbc=,iv:I/Aad82L/TCxStM8d8IZICUrwdjRbGx2fuGWqexr21o=,tag:BfgRbGUxhPZzK2fLik1kxA==,type:str]",
"unencrypted_suffix": "_unencrypted",
"version": "3.10.2"
}
}

View File

@@ -1,19 +0,0 @@
{
"data": "ENC[AES256_GCM,data:vp0yW0Gt,iv:FO2cy+UpEl5aRay/LUGu//c82QiVxuKuGSaVh0rGJvc=,tag:vf2RAOPpcRW0HwxHoGy17A==,type:str]",
"sops": {
"age": [
{
"recipient": "age12w2ld4vxfyf3hdq2d8la4cu0tye4pq97egvv3me4wary7xkdnq2snh0zx2",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBjaFVNMEd2YUxpSm5XVVRi\nY2ZUc3NTOStJUFNMWWVPQTgxZ2tCK1QrMW1ZCjYwMlA4dkIzSlc0TGtvZjcyK3Bi\nM3pob2JOOFUyeVJ6M2JpaTRCZlc1R0kKLS0tIDJMb1dFcVRWckhwYWNCQng0RlFO\nTkw3OGt4dkFIZVY5aVEzZE5mMzJSM0EKUv8bUqg48L2FfYVUVlpXvyZvPye699of\nG6PcjLh1ZMbNCfnsCzr+P8Vdk/F4J/ifxL66lRGfu2xOLxwciwQ+5Q==\n-----END AGE ENCRYPTED FILE-----\n"
},
{
"recipient": "age1qm0p4vf9jvcnn43s6l4prk8zn6cx0ep9gzvevxecv729xz540v8qa742eg",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBnZ2dDbVhoQngxM3lTSmZF\nUTAwS1lCTGhEMU1GVXpFUzlIUFdqZy9LajF3Ck9mdVpBRjlyVUNhZXZIUFZjUzF1\nNlhFN28vNmwzcUVkNmlzUnpkWjJuZE0KLS0tIHpXVHVlNk9vU1ZPTGRrYStWbmRO\nbDM4U2o1SlEwYWtqOXBqd3BFUTAvMHcKkI8UVd0v+x+ELZ5CoGq9DzlA6DnVNU2r\nrV9wLfbFd7RHxS0/TYZh5tmU42nO3iMYA9FqERQXCtZgXS9KvfqHwQ==\n-----END AGE ENCRYPTED FILE-----\n"
}
],
"lastmodified": "2025-05-04T12:44:18Z",
"mac": "ENC[AES256_GCM,data:1ZZ+ZI1JsHmxTov1bRijfol3kTkyheg2o3ivLsMHRhCmScsUry97hQJchF78+y2Izt7avaQEHYn6pVbYt/0rLrSYD7Ru7ITVxXoYHOiN5Qb98masUzpibZjrdyg5nO+LW5/Hmmwsc3yn/+o3IH1AUYpsxlJRdnHHCmoSOFaiFFM=,iv:OQlgmpOTw4ljujNzqwQ5/0Mz8pQpCSUtqRvj3FJAxDs=,tag:foZvdeW7gK9ZVKkWqnlxGA==,type:str]",
"unencrypted_suffix": "_unencrypted",
"version": "3.10.2"
}
}

View File

@@ -1 +0,0 @@
../../../../../../sops/machines/peer1

View File

@@ -1,19 +0,0 @@
{
"data": "ENC[AES256_GCM,data:prFl0EJy8bM=,iv:zITWxf+6Ebk0iB5vhhd7SBQa1HFrIJXm8xpSM+D9I0M=,tag:NZCRMCs1SzNKLBu/KUDKMQ==,type:str]",
"sops": {
"age": [
{
"recipient": "age12w2ld4vxfyf3hdq2d8la4cu0tye4pq97egvv3me4wary7xkdnq2snh0zx2",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB0S0RZRWxaZVZvTUhjdWVL\naU9WZmtEcm1qa2JsRmdvdmZmNENMaWFEVUFRCmdoVnRXSGlpRlFjNmVVbDJ5VnFT\nMnVJUlVnM3lxNmZCRTdoRVJ4NW1oYWcKLS0tIFFNbXBFUk1RWnlUTW1SeG1vYzlM\nVVpEclFVOE9PWWQxVkZ0eEgwWndoRWcKDAOHe+FIxqGsc6LhxMy164qjwG6t2Ei2\nP0FSs+bcKMDpudxeuxCjnDm/VoLxOWeuqkB+9K2vSm2W/c/fHTSbrA==\n-----END AGE ENCRYPTED FILE-----\n"
},
{
"recipient": "age1qm0p4vf9jvcnn43s6l4prk8zn6cx0ep9gzvevxecv729xz540v8qa742eg",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB2VU5jOEpwYUtDVEVFcVpU\nQkExTVZ3ejZHcGo5TG8zdUQwNktoV09WdUZvCmQ0dE1TOWRFbTlxdVd4WWRxd3VF\nQUNTTkNNT3NKYjQ5dEJDY0xVZ3pZVUUKLS0tIDFjajRZNFJZUTdNeS8yN05FMFZU\ncEtjRjhRbGE0MnRLdk10NkFLMkxqencKGzJ66dHluIghH04RV/FccfEQP07yqnfb\n25Hi0XIVJfXBwje4UEyszrWTxPPwVXdQDQmoNKf76Qy2jYqJ56uksw==\n-----END AGE ENCRYPTED FILE-----\n"
}
],
"lastmodified": "2025-05-04T12:44:20Z",
"mac": "ENC[AES256_GCM,data:FIkilsni5kOdNlVwDuLsQ/zExypHRWdqIBQDNWMLTwe8OrsNPkX+KYutUvt9GaSoGv4iDULaMRoizO/OZUNfc2d8XYSdj0cxOG1Joov4GPUcC/UGyNuQneAejZBKolvlnidKZArofnuK9g+lOTANEUtEXUTnx8L+VahqPZayQas=,iv:NAo6sT3L8OOB3wv1pjr3RY2FwXgVmZ4N0F4BEX4YPUY=,tag:zHwmXygyvkdpASZCodQT9Q==,type:str]",
"unencrypted_suffix": "_unencrypted",
"version": "3.10.2"
}
}

View File

@@ -1 +0,0 @@
../../../../../../sops/users/admin

View File

@@ -1,97 +0,0 @@
{
pkgs,
nixosLib,
clan-core,
...
}:
nixosLib.runTest (
{ ... }:
{
imports = [
clan-core.modules.nixosTest.clanTest
];
hostPkgs = pkgs;
# This tests the compatibility of the inventory
# With the test framework
# - legacy-modules
# - clan.service modules
name = "service-dummy-test";
clan = {
directory = ./.;
inventory = {
machines.peer1 = { };
machines.admin1 = { };
services = {
legacy-module.default = {
roles.peer.machines = [ "peer1" ];
roles.admin.machines = [ "admin1" ];
};
};
instances."test" = {
module.name = "new-service";
module.input = "self";
roles.peer.machines.peer1 = { };
};
modules = {
legacy-module = ./legacy-module;
};
};
modules.new-service = {
_class = "clan.service";
manifest.name = "new-service";
roles.peer = { };
perMachine = {
nixosModule = {
# This should be generated by:
# nix run .#generate-test-vars -- checks/service-dummy-test service-dummy-test
clan.core.vars.generators.new-service = {
files.not-a-secret = {
secret = false;
deploy = true;
};
files.a-secret = {
secret = true;
deploy = true;
owner = "nobody";
group = "users";
mode = "0644";
};
script = ''
# This is a dummy script that does nothing
echo -n "not-a-secret" > $out/not-a-secret
echo -n "a-secret" > $out/a-secret
'';
};
};
};
};
};
testScript =
{ nodes, ... }:
''
start_all()
admin1.wait_for_unit("multi-user.target")
peer1.wait_for_unit("multi-user.target")
# Provided by the legacy module
print(admin1.succeed("systemctl status dummy-service"))
print(peer1.succeed("systemctl status dummy-service"))
# 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}"
'';
}
)

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