depot/third_party/nixpkgs/pkgs/tools/misc/discocss/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

43 lines
1.1 KiB
Nix

{ stdenvNoCC
, lib
, fetchFromGitHub
, discordAlias ? false
, discord
, makeWrapper
}:
stdenvNoCC.mkDerivation rec {
pname = "discocss";
version = "0.2.3";
src = fetchFromGitHub {
owner = "mlvzk";
repo = pname;
rev = "v${version}";
sha256 = "sha256-of7OMgbuwebnFmbefGD1/dOhyTX1Hy7TccnWSRCweW0=";
};
dontBuild = true;
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
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; {
description = "Tiny Discord css-injector";
changelog = "https://github.com/mlvzk/discocss/releases/tag/v${version}";
homepage = "https://github.com/mlvzk/discocss";
license = licenses.mpl20;
platforms = platforms.unix;
maintainers = with maintainers; [ mlvzk ];
mainProgram = "discocss";
};
}