From ef633b9fbe7e2be3dcade6c0846e49c1666005a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Migu=C3=A9ns=20Iglesias?= Date: Thu, 17 Oct 2024 22:25:02 +0200 Subject: [PATCH 1/2] dwlb: add option to set custom config.h --- pkgs/by-name/dw/dwlb/package.nix | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/dw/dwlb/package.nix b/pkgs/by-name/dw/dwlb/package.nix index c01e1f5dad41..7c74f8197925 100644 --- a/pkgs/by-name/dw/dwlb/package.nix +++ b/pkgs/by-name/dw/dwlb/package.nix @@ -3,12 +3,17 @@ 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 { @@ -26,10 +31,6 @@ stdenv.mkDerivation { pkg-config ]; - env = { - PREFIX = placeholder "out"; - }; - buildInputs = [ wayland-scanner wayland-protocols @@ -38,6 +39,26 @@ 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 = { From e42bafccd5a315fec399c3953c15209f51152756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Migu=C3=A9ns=20Iglesias?= Date: Sat, 19 Oct 2024 23:22:58 +0200 Subject: [PATCH 2/2] dwlb: add lonyelon as maintainer --- pkgs/by-name/dw/dwlb/package.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/dw/dwlb/package.nix b/pkgs/by-name/dw/dwlb/package.nix index 7c74f8197925..1c3354d54f02 100644 --- a/pkgs/by-name/dw/dwlb/package.nix +++ b/pkgs/by-name/dw/dwlb/package.nix @@ -66,7 +66,10 @@ stdenv.mkDerivation { 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; }; }