From 64cb3a021bc454c638458349c286aa3a8cbd0456 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sat, 19 Feb 2022 13:37:33 -0800 Subject: [PATCH] tiny: make dbus, openssl, and notifications each optional This commit exposes support for compilation without dbus, controlled by the global dbusSupport argument. This argument is understood by many other nixpkgs expressions and can be set globally in ~/.config/nixpkgs/config.nix. This commit also adds two package-specific arguments: * notificationsSupport allows to disable the desktop-notifications feature when invoking cargo. * useOpenSSL can be set to false in order to compile tiny with rustls instead of openssl. --- pkgs/applications/networking/irc/tiny/default.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/networking/irc/tiny/default.nix b/pkgs/applications/networking/irc/tiny/default.nix index e102b1077a38..4d7f5b0ca36c 100644 --- a/pkgs/applications/networking/irc/tiny/default.nix +++ b/pkgs/applications/networking/irc/tiny/default.nix @@ -3,9 +3,11 @@ , rustPlatform , fetchFromGitHub , pkg-config -, dbus -, openssl , Foundation +, dbusSupport ? stdenv.isLinux, dbus +# rustls will be used for TLS if useOpenSSL=false +, useOpenSSL ? stdenv.isLinux, openssl +, notificationSupport ? stdenv.isLinux }: rustPlatform.buildRustPackage rec { @@ -22,9 +24,11 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "05q3f1wp48mwkz8n0102rwb6jzrgpx3dlbxzf3zcw8r1mblgzim1"; nativeBuildInputs = lib.optional stdenv.isLinux pkg-config; - buildInputs = lib.optionals stdenv.isLinux [ dbus openssl ] ++ lib.optional stdenv.isDarwin Foundation; + buildInputs = lib.optionals dbusSupport [ dbus ] + ++ lib.optionals useOpenSSL [ openssl ] + ++ lib.optional stdenv.isDarwin Foundation; - buildFeatures = lib.optional stdenv.isLinux "desktop-notifications"; + buildFeatures = lib.optional notificationSupport "desktop-notifications"; meta = with lib; { description = "A console IRC client";