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
Qubasa
00ef406713
Updated to main branch. Removed cluttering asyncio and httpx log messages
2023-10-27 23:36:45 +02:00
Qubasa
f9b1a8fa89
Removing find_git_repo
2023-10-27 19:26:03 +02:00
Qubasa
efd201c7c5
nix fmt
2023-10-27 19:26:03 +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
d02acbe04b
nix fmt
2023-10-27 19:19: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
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
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
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
DavHau
a539fb6dc6
machines: add endpoint machines/{name}/ verify
2023-10-24 16:31:37 +01:00
DavHau
cd940abc4e
clan config: refactor - reorder functions
2023-10-24 15:27:19 +01:00
Jörg Thalheim
2f73e6b472
drop requirement for importing qemu-vm.nix
2023-09-27 14:54:01 +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
Jörg Thalheim
f85fdf678d
clan config: print command in more instances
2023-09-26 14:10:52 +02: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
Jörg Thalheim
29a48725ef
clan config: print command on error
2023-09-26 14:00:20 +02:00
DavHau
3783359f08
clan config: support new types nullOr and passwdEntry
2023-09-24 14:24:48 +01:00
DavHau
ec70b34470
clan config: match dynamic options containing <name>
2023-09-24 13:04:37 +01:00
Jörg Thalheim
ea829a76cd
config: git commit synched file
2023-09-22 16:55:51 +02:00
Jörg Thalheim
fa9e8d757d
add show-trace option that is disabled by default
2023-09-22 16:07:39 +02:00
Jörg Thalheim
e3b2424d9d
make git optional again
2023-09-22 16:07:39 +02:00
Jörg Thalheim
d8bde6ec8e
fix reading options
2023-09-22 14:54:44 +02:00
Jörg Thalheim
660dafd412
config: read nixos option correctly
2023-09-22 14:38:23 +02:00
Jörg Thalheim
51e8da2a74
config: get rid of impure eval
2023-09-22 14:32:38 +02:00
DavHau
6a359c0a2f
clan-cli: add git.commit_file() to auto commit files if inside a git
...
- commit only if inside a git repo
- commit only the specified file and nothing else
- auto-generate commit message if not specified
2023-09-21 14:07:54 +02:00
DavHau
c11f73c4d0
clan config: fix settings file location
2023-09-19 15:12:29 +02:00
DavHau
9b6fafcb2d
clan config: re-enable clan config
2023-09-19 15:12:29 +02:00
Jörg Thalheim
a65413c98e
use experimental flags everywhere
2023-09-19 13:12:10 +02:00
Jörg Thalheim
9b7b6996d6
nix_eval: add --json by default
2023-09-15 13:50:31 +02:00
Jörg Thalheim
3bdd3af248
cli: fix nixpkgs unfree import
2023-09-06 17:37:41 +02:00
DavHau
a1d825d0a0
clan-config: fix: read options from nixosConfigurations instead of nixosModules
2023-09-02 16:35:59 +02:00
DavHau
8ca0a2aee4
clan-config: introduce --machine + add tests
2023-08-30 20:59:26 +02:00
Jörg Thalheim
b7212b9988
ruff: also enforce variable naming rules
2023-08-27 10:51:47 +02:00
DavHau
b55ceec40c
clan-config: use pinned nixpkgs + fix test flake
2023-08-26 23:33:32 +02:00
DavHau
8c7ee25dc9
webui: fixes for machines endpoint
...
- fix machines settings file location
- raise 404 if machine doesn't exist
- improve machine api test
2023-08-26 14:17:25 +02:00
DavHau
518bf4197f
webui: tests for machine config endpoints
2023-08-26 08:46:53 +02:00
DavHau
868c49acea
webui: implement /api/machines/{name}/config
2023-08-25 23:18:34 +02:00
DavHau
fb76ad45e8
webui: implement /api/machines/{name}/schema
2023-08-25 21:26:30 +02:00
DavHau
b16f314c80
clan-config: add option --quiet
2023-08-23 12:25:02 +02:00
DavHau
999fbe0d89
clan-config: add readme
...
Also add capability of reading an option value
2023-08-23 01:01:07 +02:00
DavHau
780fd881c3
clan-config: fix tests
2023-08-22 21:17:47 +00:00
DavHau
48686591d8
clan-config: improve and add flake-parts module for clan-config
2023-08-22 21:17:47 +00:00
DavHau
52d6798315
clan-config: stop using jsonschema at all for CLI
...
- instead use options.json coming from nixosOptionsDoc
2023-08-15 15:48:17 +02:00
DavHau
348e503789
clan-config: get rid of jsonschema dependency
2023-08-15 13:29:48 +02:00
DavHau
0a9b914ad5
clan-config: improve jsonschema arg parsing
...
- output json to stdout after success
- expect args in the style: `foo.bar = baz`
- handle different input types
- cast input types on best effort basis
- throw meaningful errors
2023-08-11 00:05:52 +02:00