Commit Graph

56 Commits

Author SHA1 Message Date
Johannes Kirschbauer
20e17b0e56 Lib/flakes: remove self references 2025-07-01 13:57:49 +02:00
Johannes Kirschbauer
4f496a84f9 clanLib: remove select 2025-06-30 16:14:01 +02:00
DavHau
f966f5b745 clan services: use service modules from clan-core by default
Users will use clan-core services first before making their own. Therefore this is a better default. Also it allow us to simplify rendering of our docs
2025-06-30 10:13:46 +00:00
Johannes Kirschbauer
e9600a19c1 modules.clan.default: move specialArgs into common place 2025-06-26 17:37:42 +02:00
Johannes Kirschbauer
a35e2d84d1 buildClan: deprecate in favor of 'clan'
clan.lib.clan { <your definition> } returns an eval result
In contrast to buildClan which returns the .config
This allows for better introspection
2025-06-26 17:08:47 +02:00
Johannes Kirschbauer
f6de6632e4 modules: move clan module to flake.modules.clan.default 2025-06-26 17:08:47 +02:00
Johannes Kirschbauer
761e8b0ec5 refactor: clanLib buildClan 2025-06-26 15:20:05 +02:00
Johannes Kirschbauer
9ef518fa20 refactor: unify evalClanService with evalService 2025-06-26 14:50:35 +02:00
Johannes Kirschbauer
345aa12e99 build-inventory: move inventory and inventoryClass into explizitly different folders 2025-06-25 17:55:45 +02:00
Johannes Kirschbauer
ac5cc85d57 Refactor(build-clan): rename to lib/modules
This is a preparation for moving everything into clan, to make it all one module evaluation
2025-06-23 16:06:49 +02:00
DavHau
828e97775a lib: mkOfflineFlakeLock init
copied from the clan-core-flake module

I plan to re-use this function to improve the clan test framework to allow cli execution
2025-06-09 15:23:09 +07:00
Johannes Kirschbauer
7dc03f8eee Feat(clanLib): init types {uniqueDeferredSerializableModule} 2025-05-21 18:41:14 +02:00
Johannes Kirschbauer
dfa5a228e8 feat(clanLib): init evalServiceSchema 2025-05-05 21:55:29 +02:00
Michael Hoang
c3842902ac cli: don't use select from clanLib 2025-04-28 12:52:00 +10:00
Johannes Kirschbauer
06e2fcf9fa refactor: rename clanLib.values to introspection 2025-04-27 13:10:42 +02:00
Michael Hoang
4c2584e246 lib: move select.select -> select for backwards compat with old CLIs 2025-04-25 17:30:06 +10:00
lassulus
d93e58218d Refactor select with new maybe selector
This is a great refactor of the select functionality in the flake class.
This now uses the same parser as the nix code, but runs it in python for
nice stacktraces.

Also we now have a maybe selector which can be used by prepending the
selector with a ?

Tests have been expanded to make sure the code is more stable and easier
to understand
2025-04-25 16:26:45 +10:00
Johannes Kirschbauer
0bc2a068fe chore(test/makeTestClan): document all options, remove magic specialArgs 2025-04-16 10:33:32 +02:00
Johannes Kirschbauer
75c8541a8d tests(clan): move test-inventory.nix to clanLib. And name it 'makeTestClan'
Exposing the function via clanLib makes it more accessible to clan modules
This allows each module to define its own test without needing to depend on any fileSystem path assumptions in the clan-core repo
2025-04-15 18:17:40 +02:00
Johannes Kirschbauer
059cc1e2ea chore(lib/buildClan): remove dependencies {nixpkgs,nix-darwin} from the clanLib file 2025-04-08 22:13:46 +02:00
Johannes Kirschbauer
29fbf361a7 chore(lib/modulesDocs): move dependency on clan-core and pkgs into function args
This is a good idea, to make lib agnostic from clan-core
The next step could be to rename the clan-core argument name
Or to explizitly pass the actual dependencies, instead of everything in
clan-core
2025-04-08 15:30:49 +02:00
Michael Hoang
b5a57a72a0 build-clan: support constructing darwinConfigurations 2025-04-08 08:53:29 +02:00
Johannes Kirschbauer
1aaa328e1b chore(lib/select): move into subfolder with a test file 2025-04-02 12:37:49 +02:00
Johannes Kirschbauer
f6f0c1b356 fix(inventory/interface): use explizit file dependency, until dependency injection works properly 2025-04-02 11:12:16 +02:00
Johannes Kirschbauer
6e16d1345e chore(lib/treewide): cleanup directory struture of lib. See lib/readme.md for details 2025-04-02 11:11:21 +02:00
Johannes Kirschbauer
05b6180675 chore(buildClan): remove dependency on clan-core in the lib function 2025-04-02 09:49:54 +02:00
Johannes Kirschbauer
3c2708b263 feat(lib/buildClan): turn lib/build-clan into a 'buildClanModule' with sub-features such as 'buildClan' and 'flakePartsModule' 2025-04-01 15:39:12 +02:00
Johannes Kirschbauer
d9741be51a feat(lib/inventory): use clanLib instead of clan-core as internal specialArg. This has the benefit of beeing more narrow scoped. 2025-03-30 17:07:09 +02:00
Johannes Kirschbauer
8a67602469 feat(lib/modules): remove dependency on self 2025-03-30 16:12:01 +02:00
Johannes Kirschbauer
0083ea86df feat(lib): init callLib; helper to bootstrap clanLib 2025-03-30 16:11:04 +02:00
Johannes Kirschbauer
77b6afd034 chore(lib): prepare for refactoring into clanLib 2025-03-30 15:56:54 +02:00
lassulus
02d450b905 clan-cli: add a Flake class with caching 2025-02-02 11:52:36 +00:00
Johannes Kirschbauer
de78a85324 lib.values: init getPrio
This function can be used to get the priority of all values within a module
2024-12-04 17:37:23 +01:00
Johannes Kirschbauer
3ebda7c304 Ext/modules: expose module schemas 2024-11-21 17:02:34 +01:00
Johannes Kirschbauer
b3bcecd61c Inventory: init external modules support 2024-11-21 15:38:17 +00:00
Johannes Kirschbauer
9028027220 modules/frontmatter: init module interface as source of frontmatter 2024-11-15 20:04:06 +01:00
Jörg Thalheim
da56927968 eval-clan-modules: don't re-import nixpkgs 2024-10-09 13:48:32 +02:00
Johannes Kirschbauer
a414981089 Init: eval clanmodule interface with roles 2024-10-07 21:08:28 +00:00
Johannes Kirschbauer
8b0212b828 Add build-clan module 2024-08-03 12:05:09 +02:00
a-kenji
2271404a51 lib: add fact loaders to clan lib 2024-07-02 11:34:26 +00:00
Johannes Kirschbauer
ee543a39d0 Add toml frontmatter description to jsonschema 2024-06-26 15:10:36 +02:00
Johannes Kirschbauer
cbb78ca1ae ClanModules: Add docs and api to retrieve metadata 2024-06-25 21:17:01 +02:00
Johannes Kirschbauer
b90ec6e842 Inventory: move to lib.inventory 2024-06-25 12:23:29 +00:00
Johannes Kirschbauer
aed486f020 lib: eval clan module as lib function 2024-06-24 15:47:25 +02:00
Qubasa
82773f260a Throw error on missing clanModule description or if description too long. Add xfce description. 2024-05-02 17:53:27 +02:00
Qubasa
edcc92c75b Add package function-schema and module-schema. Add check for module jsonschema. 2024-05-01 23:16:17 +02:00
Jörg Thalheim
ede4d3f6e5 re-format with nixfmt 2024-03-17 19:48:49 +01:00
DavHau
cf0953146d 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
Jörg Thalheim
08cfa7d7b2 drop unused findNixFiles function 2023-09-28 14:21:03 +02:00
DavHau
03808d9fbc buildClan: fix missing argument clan 2023-09-02 18:24:34 +02:00