Hello,
I am a beginner NixOS enthusiast trying to develop my own configuration in a fast feedback loop.
At the moment, my daily driver is Ubuntu.
I would like to develop a NixOS configuration using my current Ubuntu setup first. In theory, such a configuration should more or less be usable in the final installation.
The plan is to eventually build my custom iso using GitHub - nix-community/nixos-generators: Collection of image builders [maintainer=@Lassulus].
So far, I have used this tutorial: NixOS virtual machines — nix.dev documentation.
I build my NixOS prototype with
nix-build '<nixpkgs/nixos>' -A vm \
-I nixpkgs=channel:nixos-23.11 \
-I nixos-config=./configuration.nix
and I run it with
QEMU_KERNEL_PARAMS=console=ttyS0 ./result/bin/run-nixos-vm -nographic; reset
The feedback loop is very short.
Now, my goal is to somehow set up graphical environment.
My GPU is 1080Ti. It would be perfect to use it in qemu.
I don’t need full performance.
My goal is to prototype configuration of gui applications, so it can later be used in the regular NixOS installation.
I have read most of the posts related to qemu on this forum.
I have tried adding gnome to my configuration, but nothing seems to work.
When I boot up qemu with flag -display gtk
I get errors like
Failed to load module "canberra-gtk-module"
Below are links to the configuration I use:
Attempts of using gpu inside of qemu:
The nvidia-gl.nix, when in the modules list, does not install nvidia-settings for some reason.
I have found a promising configuration: GitHub - donovanglover/nix-config: My NixOS configuration with Nix Flakes, Home Manager, Stylix, and Hyprland., but the building instruction will work only within NixOS.
I have tried nix build and stuff, but to no avail.
The questions are:
- Is the idea of prototyping NixOS configuration like that feasible? Maybe it’s better to just install NixOS and play with it directly?
- Is there a nix (on Ubuntu) counterpart to
nixos-rebuild build-vm --flake .#nixos
? - Could you guide me just a little bit towards booting qemu with graphics?
- Perhaps there is a better tool than qemu that can help achieve fast feedback loop, while still providing graphic capabilities?
I am not expecting solving all the problems, any kind of guidance will be greatly appreciated.
I could spend another week googling, but I thought I could ask here.
Maybe someone has already tried implementing a similar NixOS configuration prototyping setup.
Thanks in advance and sorry if I missed something obvious.