Commit Graph

46 Commits

Author SHA1 Message Date
a-kenji
f383c6f82d clan-cli: add CLAN_DIR environment variable
Add the `CLAN_DIR` environment variable.
With this the user can specify the location of the clan.
2024-04-30 12:00:47 +02:00
DavHau
02dd132e08 vms: init graceful shutdown for GUI
- add python modules for qemu protocols: QMP (hardware interactions) and QGA (guest service interaction)
- refactor state directory: remove name from path (already contains url)
- add impure vm test for basic qmp interaction
- simplify existing vm persistance test (factor out shared code)
- integrate graceful shutdown into GUI

the GUI integration still needs to be improved later:
- add fallback in case system doesn't react to powerdown button
- shutdown GUI switch fails if VM hasn't been started yet, and then remains in a wrong position
2024-02-09 19:55:18 +07:00
DavHau
59fa63eba9 Reapply "vm-state: fix and improve testing"
This reverts commit 99092f6e76.

vm-state: revert sysusers, improve testing

zerotier: enable persistence

vm-state: cleanup tests
2024-01-31 11:02:16 +07:00
Jörg Thalheim
80a335eb4c drop unused unfree_nixpkgs function 2024-01-30 10:30:25 +07:00
DavHau
99092f6e76 Revert "vm-state: fix and improve testing"
This reverts commit 6adc68a354.
2024-01-29 15:16:10 +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
lassulus
6b004fca6f machines.Machine: refactor flake_dir -> flake; use Machine class in vm 2024-01-24 15:49:12 +01:00
DavHau
520ff0b334 VMs: ensure state dirs don't collide between clans 2024-01-09 17:22:48 +07: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
Qubasa
ef827af89c Fixed unsafe dirs.py urlquoting, improved cmd.py run func 2024-01-02 17:21:06 +01:00
DavHau
e7bd86a9d5 dirs.py: remove outdated comment 2024-01-02 14:25:37 +07:00
Qubasa
fcadaca010 cli: Switched b64 encoding of gcroot names to urlparse 2023-12-31 13:51:13 +01:00
Qubasa
c4799f1e9a Added gcroot for clan Icon and VM 2023-12-31 00:49:57 +01:00
lassulus
e98f037dd8 clan_cli: remove incorrect clan_flake check 2023-12-16 21:46:19 +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
Jörg Thalheim
f1b223d0a1 modernisation for python 3.11 2023-11-29 13:29:45 +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
lassulus
1ea13646ea clan_cli: flake_name -> flake_dir 2023-11-15 16:23:28 +01: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
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
lassulus
7b3d3e20b4 clan-cli secrets: flake_name -> flake_dir 2023-11-05 16:58:48 +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
cb87ccbfc4 improve error message if flake_dir does not exists 2023-10-31 13:53:54 +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
Qubasa
f9b1a8fa89 Removing find_git_repo 2023-10-27 19:26:03 +02:00
Qubasa
d02acbe04b nix fmt 2023-10-27 19:19:45 +02:00
Qubasa
8482bc79f6 Secrets tests passing. nix fmt doesn't complain 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
fa5f39f226 API: Added Path validators. api/flake/create inits git repo. Fixed vscode interpreter problem 2023-10-27 19:11:27 +02:00
Jörg Thalheim
e3b2424d9d make git optional again 2023-09-22 16:07:39 +02:00
DavHau
0196fd72c3 git.commit_file: fix file path & repo path finding 2023-09-22 13:42:04 +02:00
Jörg Thalheim
3bdd3af248 cli: fix nixpkgs unfree import 2023-09-06 17:37:41 +02:00
Jörg Thalheim
35c5f248d1 cli/deps_flake: resolve symlink prior to execution 2023-09-06 17:05:21 +02:00
DavHau
fcbc3ec899 clan-cli: use dependency flake instead of registry 2023-09-06 14:47:28 +02:00
Jörg Thalheim
fb7c77690a replace environment variable with nixpkgs directory
In this directory we generate all the files that we need to load nixpkgs.
This seems more robust than all those environment variables that may or not may be set.
2023-08-26 11:45:09 +02:00
Jörg Thalheim
7c388f977e dirs: fix user_config_dir on macos 2023-07-29 14:21:36 +02:00
Jörg Thalheim
88a2c2656a get_clan_flake_toplevel: fix check 2023-07-28 12:36:01 +02:00
Jörg Thalheim
5e5fbfcf06 write test for get_clan_flake_toplevel 2023-07-28 10:22:25 +00:00
Jörg Thalheim
a61d0c5a42 add dirs module to get toplevel flake and configuration dir 2023-07-26 14:34:39 +02:00