diff --git a/modules/hosts/14900k/_private/vm-self.nix b/modules/hosts/14900k/_private/vm-self.nix new file mode 100644 index 0000000..6cb5c32 --- /dev/null +++ b/modules/hosts/14900k/_private/vm-self.nix @@ -0,0 +1,44 @@ +# VM self-test overrides — used with nixos-rebuild build-vm to try the system +# in a VM without rebuilding/rebooting the host. +{ config, lib, pkgs, ... }: +{ + virtualisation.vmVariant = { + config = { + + + hardware.nvidia-container-toolkit.enable = lib.mkForce false; + hardware.nvidia.package = lib.mkForce null; + services.xserver.videoDrivers = lib.mkForce [ "modesetting" ]; + + virtualisation = { + memorySize = 4096; + cores = 3; + graphics = true; + qemu.options = [ + "-device virtio-vga-gl" + "-display gtk,gl=on" + ]; + }; + + users.users.olivier = { + initialPassword = lib.mkForce ""; + hashedPasswordFile = lib.mkForce null; # Disable the secret file dependency + }; + + # Force greetd's `initial_session` directly. We can't rely on + # `services.displayManager.autoLogin` because DankGreeter's flake module + # (inputs.dms.nixosModules.greeter) aggressively overwrites + # `services.greetd.settings`, clobbering whatever the displayManager + # module injects for auto-login. mkForce on `initial_session` alone wins + # against DMS without touching `default_session` (DankGreeter), so a + # manual logout in the VM still shows DankGreeter. VM-only — host build + # is unaffected because this whole block lives under vmVariant. + services.greetd.settings.initial_session = lib.mkForce { + command = "${pkgs.niri}/bin/niri-session"; + user = "olivier"; + }; + + environment.systemPackages = [ pkgs.grc ]; + }; + }; +} diff --git a/modules/hosts/14900k/configuration.nix b/modules/hosts/14900k/configuration.nix index e7a2217..fdac7cd 100644 --- a/modules/hosts/14900k/configuration.nix +++ b/modules/hosts/14900k/configuration.nix @@ -15,6 +15,7 @@ self.nixosModules."client-services" ./_private/platform.nix ./_private/nvidia.nix + ./_private/vm-self.nix ./_private/gpu-passthru.nix ./_private/peripherals.nix # ./_private/printing-epson.nix