From 2e0daa61b50ac4b7ce639d711a35bc4cf1c8d739 Mon Sep 17 00:00:00 2001 From: Ilan Joselevich Date: Wed, 31 Aug 2022 22:37:20 +0300 Subject: [PATCH] discocss: add discordAlias option --- pkgs/tools/misc/discocss/default.nix | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/discocss/default.nix b/pkgs/tools/misc/discocss/default.nix index f847f615756a..c44d37505155 100644 --- a/pkgs/tools/misc/discocss/default.nix +++ b/pkgs/tools/misc/discocss/default.nix @@ -1,4 +1,10 @@ -{ stdenvNoCC, lib, fetchFromGitHub }: +{ stdenvNoCC +, lib +, fetchFromGitHub +, discordAlias ? false +, discord +, makeWrapper +}: stdenvNoCC.mkDerivation rec { pname = "discocss"; @@ -13,8 +19,16 @@ stdenvNoCC.mkDerivation rec { dontBuild = true; + nativeBuildInputs = [ makeWrapper ]; + installPhase = '' - install -Dm755 ./discocss $out/bin/discocss + install -Dm755 discocss $out/bin/discocss + '' + lib.optionalString discordAlias '' + wrapProgram $out/bin/discocss --set DISCOCSS_DISCORD_BIN ${discord}/bin/Discord + ln -s $out/bin/discocss $out/bin/Discord + ln -s $out/bin/discocss $out/bin/discord + mkdir -p $out/share + ln -s ${discord}/share/* $out/share ''; meta = with lib; {