build minimal template without settings.json
This commit is contained in:
@@ -7,10 +7,19 @@
|
|||||||
initialized = inputs.nixpkgs.legacyPackages.x86_64-linux.runCommand "minimal-clan-flake" { } ''
|
initialized = inputs.nixpkgs.legacyPackages.x86_64-linux.runCommand "minimal-clan-flake" { } ''
|
||||||
mkdir $out
|
mkdir $out
|
||||||
cp -r ${path}/* $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
|
# 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 {
|
evaled = (import "${initialized}/flake.nix").outputs {
|
||||||
self = evaled // {
|
self = evaled // {
|
||||||
@@ -22,7 +31,7 @@
|
|||||||
{
|
{
|
||||||
type = "derivation";
|
type = "derivation";
|
||||||
name = "minimal-clan-flake-check";
|
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;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user