NixOS and Development Environments

Hello,

I have been interested in contributing to KDE, as I have been consistently using the desktop environment for the past few months and I have been enjoying it. Thanks for all of the hard work to everyone.

Now, I have been going through setting up my development environment for my system and have seen that kde-builder is the recommended way to setup your development environment. The issue with this, is that it won’t work on NixOS.

I am aware that I can use distrobox, podman, or another linux distro:

Building KDE software with distrobox and podman | Developer

Get Involved/development - KDE Community Wiki

I was just wondering if there was a way to do so using NixOS, in a declarative way?

At the moment I am using NixOS unstable, so KDE Plasma and its applications are up to date.

Thanks.

The builder script will likely work on almost any Linux system, the support is mostly about whether it knows which system dependencies to install.

I.e. on a supported distro you can run a setup command that will issue a distro specific package install command to get the essential build tools and system libraries headers.

In other words I would expect kde-builder to work as usual once you have figured out which Nix packages you need and have installed those.

Might be worthwhile to check who is responsible for the NoxOS packages of Plasma and check how their setup is done

1 Like

You want to use nix-env / nix-shell / nix develop. You will likely also have to install dependencies manually, since kde-builder won’t be able to install them for you. It’s not something we test for either.

You could also in theory just ignore kde-builder and develop using flakes and nix-build, but I know from experience that that is underdocumented and will be annoying to get to work on other distros.

1 Like

Yeah, it seems like there is some work settings up the environment when using Nix.

At the moment I got distrobox and kde-builder setup within NixOS, as its doesn’t steer off too far the threaded path.