got two questions.
first I run dwm on two systems, and I have created two different config.h files, due to different font sizes and different sizes on some scratchpads I use. This is due too different screen sizes. However I was thinking it must be a better way of doing things. Noobz talked to me about using overrides, and I was thinking maybe creating a patch that changes the content in the original config.h file and then using that patch as a override, which I call from my flake for my laptop.
Will this work? and I guess I need too keep the patch somewhere inn my system flake?
My second question:
I am constantly fixing my dwm and as of now my dwm flake does not let me use nix develop and I don’t know what more I need to add so I can be able to access a dev env and test build before updating not tested changes in my main flake.
IIRC dwm already provides a config override where you can pass in the config file directly. Alternatively it has patches in the override, rather than in the overrideAttrs.
If you already have the base config in the src or just alter the “defaults” slightly, you can of course use patches, still I’d suggest to use the override function, rather than overrideAttrs.
A path that refers to a file in the same folder as the current nix-file would be prefixed with a ./, eg. ./.laptop.conf.h. Though I’m curious why you “dotted” that file…
Also override is a function, not some attribute you want to assign a value to, so the = is another syntactic problem.
I have no clue what you have right now, and the link is from ~2.5yrs ago, back when I was rookie by myself and did not carefully fix all the errors in the snippet, but only one.
I would expect that a simple dwm.override { conf = ./config.h; } would totally do. If it doesn’t it would be nice to tell us what errors you get, instead of letting us guess.
$ sudo nixos-rebuild switch --flake .#mXlaptop
warning: Git tree '/home/merrinx/Sources/nixos' is dirty
building the system configuration...
warning: Git tree '/home/merrinx/Sources/nixos' is dirty
error: A definition for option `environment.systemPackages."[definition 2-entry 1]"' is not of type `package'. Definition values:
- In `/nix/store/qk7fmc3w33iwy6lz6z5xvv94lngrz6yb-source/modules/nixos/overrides/laptop.nix': <function, args: {conf?, fetchurl, lib, libX11, libXft, libXinerama, patches?, stdenv, writeText}>
(use '--show-trace' to show detailed location information)
This is the error I get when trying to build on my laptop with my current config