about summary refs log tree commit diff
path: root/pkgs/applications/networking/irc
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2022-02-19 13:37:33 -0800
committerAdam Joseph <adam@westernsemico.com>2022-03-06 01:50:19 -0800
commit64cb3a021bc454c638458349c286aa3a8cbd0456 (patch)
tree2dfcb3da0b67b13d1653a7dda90f27ae80bdf916 /pkgs/applications/networking/irc
parent65c8149cb14200c172782ede4219f53ee1d751dd (diff)
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.
Diffstat (limited to 'pkgs/applications/networking/irc')
-rw-r--r--pkgs/applications/networking/irc/tiny/default.nix12
1 files changed, 8 insertions, 4 deletions
diff --git a/pkgs/applications/networking/irc/tiny/default.nix b/pkgs/applications/networking/irc/tiny/default.nix
index e102b1077a388..4d7f5b0ca36ce 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";