build minimal template without settings.json

This commit is contained in:
Jörg Thalheim
2024-10-09 12:26:17 +02:00
parent f18f7ce1d4
commit 88b166d62b

View File

@@ -7,10 +7,19 @@
initialized = inputs.nixpkgs.legacyPackages.x86_64-linux.runCommand "minimal-clan-flake" { } ''
mkdir $out
cp -r ${path}/* $out
mkdir -p $out/machines/foo
mkdir -p $out/machines/testmachine
# TODO: Instead create a machine by calling the API, this wont break in future tests and is much closer to what the user performs
echo '{ "nixpkgs": { "hostPlatform": "x86_64-linux" } }' > $out/machines/foo/settings.json
cat > $out/machines/testmachine/hardware-configuration.nix << EOF
{ lib, ... }: {
nixpkgs.hostPlatform = "x86_64-linux";
system.stateVersion = lib.version;
documentation.enable = false;
users.users.root.initialPassword = "fnord23";
boot.loader.grub.devices = lib.mkForce [ "/dev/sda" ];
fileSystems."/".device = lib.mkDefault "/dev/sda";
}
EOF
'';
evaled = (import "${initialized}/flake.nix").outputs {
self = evaled // {
@@ -22,7 +31,7 @@
{
type = "derivation";
name = "minimal-clan-flake-check";
inherit (evaled.nixosConfigurations.foo.config.system.build.vm) drvPath outPath;
inherit (evaled.nixosConfigurations.testmachine.config.system.build.toplevel) drvPath outPath;
};
};
}