diff --git a/templates/flake-module.nix b/templates/flake-module.nix index f25df79cd..639d800c1 100644 --- a/templates/flake-module.nix +++ b/templates/flake-module.nix @@ -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; }; }; }