bakkeby/dmenu-flexipatch wrapped in a nix flake.
flexipatch ships 55 dmenu patches as preprocessor toggles in patches.h. this flake generates
that header from a nix attrset, so every patch is a plain package parameter - no fork to maintain,
no manual header editing, fully declarative and reproducible.
dmenu-flexipatch.override {
patches = {
CENTER = true;
FUZZYMATCH = true;
LINE_HEIGHT = true;
ALPHA = true; # libXrender gets pulled in automatically
};
}# default build behaves like vanilla dmenu 5.4 (all patches off)
nix run github:sophronesis/nix-dmenu-flexipatch -- -v
# try dmenu_run from it
nix shell github:sophronesis/nix-dmenu-flexipatch -c dmenu_run{
inputs.nix-dmenu-flexipatch.url = "github:sophronesis/nix-dmenu-flexipatch";
# ... in your nixos/home-manager config:
environment.systemPackages = [
(inputs.nix-dmenu-flexipatch.packages.${pkgs.system}.default.override {
patches = {
CENTER = true;
BORDER = true;
FUZZYMATCH = true;
};
})
];
}or via the overlay, which adds pkgs.dmenu-flexipatch and builds against your nixpkgs
(this flake's nixpkgs pin is only used for its own standalone builds and checks):
nixpkgs.overlays = [
inputs.nix-dmenu-flexipatch.overlays.default
# optional: make it the system-wide dmenu so dmenu_run pickers use it
(final: prev: {
dmenu = final.dmenu-flexipatch.override { patches = { CENTER = true; }; };
})
];| param | default | what it does |
|---|---|---|
patches |
{ } |
attrset of flexipatch toggles merged over the defaults in patches.nix. keys are the upstream define names minus the _PATCH suffix, values are booleans. unknown names fail at eval time with the offending key. |
conf |
null |
replacement config.def.h - a string, path or derivation |
extraPatches |
[ ] |
regular source diffs applied on top via stdenv patching |
xinerama |
true |
vanilla dmenu config.mk toggle (not a flexipatch) |
extraMakeFlags |
[ ] |
escape hatch for anything else in config.mk |
patch-specific libraries are wired automatically: ALPHA adds libXrender, PANGO adds
pango/pangoxft, BIDI adds fribidi. every other patch is pure preprocessor and needs nothing.
the full patch list with descriptions and upstream links lives in patches.nix. you can also introspect a build:
nix eval github:sophronesis/nix-dmenu-flexipatch#default.patchSet # all toggles
nix eval github:sophronesis/nix-dmenu-flexipatch#default.enabledPatchesflexipatch does not make every combination valid. upstream notes a few incompatibilities in the
patch comments (carried over into patches.nix), e.g. PANGO vs SCROLL, and MULTI_SELECTION
takes precedence over PIPEOUT / PRINTINPUTTEXT / NON_BLOCKING_STDIN. invalid combos fail
at compile time, exactly as they would building by hand.
nix flake check builds a set of representative combos: default, a 19-patch featured set,
pango, bidi, vi-mode and no-xinerama.
./update.sh # bump the flexipatch input + regenerate patches.nix
./update.sh --no-flake-update # regenerate only, from the current lockthe script re-derives patches.nix from upstream patches.def.h (descriptions and links
included) and syncs the upstream dmenu version into package.nix. needs nix and jq.
checked before publishing (2026-07-11): nothing else exposes flexipatch toggles as nix parameters for dmenu.
- bandithedoge/nur-packages - packages dmenu-flexipatch (and dwm/st/slock variants) in NUR, but builds stock defaults with no way to enable patches
- paulhersch/nix-config - closest prior art for the trick itself: generates a patches file for st-flexipatch from a nix list, inside a personal config rather than a reusable flake
- polarmutex/dmenu - dmenu-flexipatch fork with a flake that builds a pre-edited in-tree patches.h, not parameterized, unmaintained
- dmenu-flexipatch is not in nixpkgs (only vanilla dmenu), and upstream has no nix support
MIT for this wrapper. dmenu and the patches keep their own licensing, see the upstream LICENSE.