Inventory: init first implementation #1638

Merged
hsjobeki merged 18 commits from hsjobeki/clan-core:wip/inventory into main 2024-06-25 12:23:30 +00:00
3 changed files with 4 additions and 23 deletions
Showing only changes of commit c1d7644f6d - Show all commits

View File

@ -91,6 +91,8 @@ in
type = lib.types.submodule {
options = {
inventory = lib.mkOption { type = lib.types.attrsOf lib.types.unspecified; };
inventoryFile = lib.mkOption { type = lib.types.unspecified; };
meta = lib.mkOption { type = lib.types.attrsOf lib.types.unspecified; };
all-machines-json = lib.mkOption { type = lib.types.attrsOf lib.types.unspecified; };
machines = lib.mkOption { type = lib.types.attrsOf (lib.types.attrsOf lib.types.unspecified); };

View File

@ -188,7 +188,7 @@ builtins.deepSeq deprecationWarnings {
meta = mergedInventory.meta;
inventory = mergedInventory;
invFile = "${directory}/inventory.json";
inventoryFile = "${directory}/inventory.json";
# machine specifics
machines = configsPerSystem;

View File

@ -1,4 +1,4 @@
{ self, inputs, ... }:
{ self, ... }:
{
flake.templates = {
new-clan = {
@ -15,25 +15,4 @@
path = ./minimal;
};
};
flake.checks.x86_64-linux.template-minimal =
let
path = self.templates.minimal.path;
initialized = inputs.nixpkgs.legacyPackages.x86_64-linux.runCommand "minimal-clan-flake" { } ''
mkdir $out
cp -r ${path}/* $out
mkdir -p $out/machines/foo
echo '{ "nixpkgs": { "hostPlatform": "x86_64-linux" } }' > $out/machines/foo/settings.json
'';
evaled = (import "${initialized}/flake.nix").outputs {
self = evaled // {
outPath = initialized;
};
clan-core = self;
};
in
{
type = "derivation";
name = "minimal-clan-flake-check";
inherit (evaled.nixosConfigurations.foo.config.system.build.vm) drvPath outPath;
};
}