diff --git a/pkgs/by-name/dw/dwlb/package.nix b/pkgs/by-name/dw/dwlb/package.nix index c01e1f5dad410..db5744c846bd9 100644 --- a/pkgs/by-name/dw/dwlb/package.nix +++ b/pkgs/by-name/dw/dwlb/package.nix @@ -3,17 +3,22 @@ lib, fetchFromGitHub, pkg-config, + wayland, wayland-scanner, wayland-protocols, unstableGitUpdater, pixman, fcft, - wayland, + writeText, + # Boolean flags + withCustomConfigH ? (configH != null), + # Configurable options + configH ? null, }: stdenv.mkDerivation { pname = "dwlb"; - version = "0-unstable-2024-05-16"; + version = "1-unstable-2024-05-16"; src = fetchFromGitHub { owner = "kolunmi"; @@ -26,10 +31,6 @@ stdenv.mkDerivation { pkg-config ]; - env = { - PREFIX = placeholder "out"; - }; - buildInputs = [ wayland-scanner wayland-protocols @@ -38,14 +39,37 @@ stdenv.mkDerivation { wayland ]; + # Allow alternative config.def.h usage. Taken from dwl.nix. + postPatch = + let + configFile = + if lib.isDerivation configH || builtins.isPath configH then + configH + else + writeText "config.h" configH; + in + lib.optionalString withCustomConfigH "cp ${configFile} config.h"; + + env = { + PREFIX = placeholder "out"; + }; + + outputs = [ + "out" + "man" + ]; + passthru.updateScript = unstableGitUpdater { }; meta = { - description = "Fast, feature-complete bar for dwl"; + description = "A fast, feature-complete bar for dwl"; homepage = "https://github.com/kolunmi/dwlb"; license = lib.licenses.gpl3Plus; mainProgram = "dwlb"; - maintainers = with lib.maintainers; [ bot-wxt1221 ]; + maintainers = with lib.maintainers; [ + bot-wxt1221 + lonyelon + ]; platforms = wayland.meta.platforms; }; }