discocss: add discordAlias option

This commit is contained in:
Ilan Joselevich 2022-08-31 22:37:20 +03:00
parent a53adf6e7d
commit 2e0daa61b5

View File

@ -1,4 +1,10 @@
{ stdenvNoCC, lib, fetchFromGitHub }: { stdenvNoCC
, lib
, fetchFromGitHub
, discordAlias ? false
, discord
, makeWrapper
}:
stdenvNoCC.mkDerivation rec { stdenvNoCC.mkDerivation rec {
pname = "discocss"; pname = "discocss";
@ -13,8 +19,16 @@ stdenvNoCC.mkDerivation rec {
dontBuild = true; dontBuild = true;
nativeBuildInputs = [ makeWrapper ];
installPhase = '' 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; { meta = with lib; {