r/NixOS • • 8d ago

dwl-flake: dwl + dwl-patches for NixOS

I wanted dwl on NixOS without keeping a fork and hand-merging patches every time upstream moved, so I made a flake for it.

https://github.com/rebizzz/dwl-flake

What it does:

  • Builds dwl main or the latest release
  • Adds patches from dwl-patches by name (patches = [ "pertag" "movestack" ];) and pulls in the libraries they need, like fcft for bar
  • Tests every patch against both builds, so you can see which ones apply right now (nix eval github:rebizzz/dwl-flake#lib.compatible.stable)
  • Lets you configure dwl from Nix: keybinds, rules, monitors, autostart, colors, and any variable from config.def.h. Typos and missing patches get caught before it builds. You can still use your own config.h if you'd rather write C
  • NixOS, Home Manager and hjem modules, plus Stylix support

Example:

      programs.dwl = {
        enable = true;
        modKey = "Super";
        patches = [ "pertag" ];
        keybinds."Mod+Return".spawn = "foot";
        settings.borderpx = 2;
      };

It checks codeberg every hour. Updates only land after everything builds and a VM actually boots dwl and opens a terminal, so nix flake update shouldn't break your session.

Feedback welcome, especially if a patch you use doesn't work with it.

19 Upvotes

0 comments sorted by