I’m sure this is just me not understanding Library installation with NixOS yet, so it’s most likely my inability to figure things out.
I would like to patch dwm to my liking, before I install it as a custom package from GitHub and use that as my windowmanager. I would also like to know if my patched version even compiles. However, when I run make, I get an error saying, that X11/Xlib.h was not found. Here is the full compiler-output:
Ok, so in NixOS I write a derivation for every piece of software, that I want to compile. I don’t install libraries to make sure I can just run make. Did I get that right?
Great news: I learned (at a VERY basic level) how to use nix-shell! The idea of encapsulated development environments is so great! That’s what I’ve been using with python-virtual environments for a few years now. Having that for EVERY development environment is just crazy clean, from a system-state point of view. Here’s my current shell.nix:
Ah yes, that’s great too! Under arch, I wrote a script, that would download and patch dwm the way I wanted it to work (with custom patches and stuff). This way I have kind of an immutable dwm-patcher (add new patch and patch from the beginning, instead of patching an already patched dwm. You‘ll have a hard time finding out where it actually went wrong this way).
What I do now is, that I push the build of the patch to another repo, which then gets included in an overlay to dwm in my configuration.nix. A better way would be to push the patched files to a „src“-branch of the same repository and include that branch in my configuration.nix. Will change that up later today.
Today I learned: You can implicitly override parameters for some packages through nixpkgs.config. This is not documented anywhere as far as I can tell, had to find out with rg config\. /pkgs/top-level/all-packages.nix!`