add test/debug VM capability
This commit is contained in:
parent
d9b7c48953
commit
0cb8bd8363
2 changed files with 59 additions and 4 deletions
17
flake.nix
17
flake.nix
|
@ -11,6 +11,8 @@
|
|||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
||||
nixos-lib = import (nixpkgs + "/nixos/lib") {};
|
||||
|
||||
haskellPackages = pkgs.haskellPackages;
|
||||
|
||||
jailbreakUnbreak = pkg:
|
||||
|
@ -18,14 +20,21 @@
|
|||
|
||||
packageName = "vulkan-tutorial";
|
||||
in rec {
|
||||
packages.${packageName} = # (ref:haskell-package-def)
|
||||
haskellPackages.callCabal2nix packageName self rec {
|
||||
# Dependency overrides go here
|
||||
wavefront = jailbreakUnbreak haskellPackages.wavefront;
|
||||
packages = rec {
|
||||
vulkan-tutorial = # (ref:haskell-package-def)
|
||||
haskellPackages.callCabal2nix packageName self rec {
|
||||
# Dependency overrides go here
|
||||
wavefront = jailbreakUnbreak haskellPackages.wavefront;
|
||||
};
|
||||
test = import ./test.nix {inherit pkgs vulkan-tutorial;};
|
||||
|
||||
defaultPackage = self.packages.${system}.${packageName};
|
||||
|
||||
checks = {
|
||||
test = import ./test.nix {inherit pkgs; vulkan-tutorial = packages.vulkan-tutorial;};
|
||||
#test = flake-utils.lib.mkApp ({ drv = self.packages.${system}.test; });
|
||||
};
|
||||
|
||||
devShell = haskellPackages.shellFor {
|
||||
packages = p: [ defaultPackage ];
|
||||
withHoogle = true;
|
||||
|
|
46
test.nix
Normal file
46
test.nix
Normal file
|
@ -0,0 +1,46 @@
|
|||
{pkgs, vulkan-tutorial, ...}:
|
||||
pkgs.nixosTest ({
|
||||
name = "test";
|
||||
nodes = {
|
||||
machine = { config, pkgs, ...}: {
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
vulkan-tutorial
|
||||
git
|
||||
shaderc
|
||||
vulkan-loader
|
||||
vulkan-validation-layers
|
||||
];
|
||||
sessionVariables = {
|
||||
VK_LAYER_PATH="${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d";
|
||||
SDL_VULKAN_LIBRARY="${pkgs.vulkan-loader}/lib/libvulkan.so";
|
||||
};
|
||||
};
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
};
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
displayManager.sddm.enable = true;
|
||||
desktopManager.cinnamon.enable = true;
|
||||
};
|
||||
users.users.test = {
|
||||
password = "test";
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
];
|
||||
isNormalUser = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
skipLint = true;
|
||||
|
||||
testScript = ''
|
||||
start_all()
|
||||
|
||||
machine.shell_interact()
|
||||
'';
|
||||
})
|
Loading…
Reference in a new issue