nix-config/pkgs/feishin/default.nix
2024-03-22 13:47:41 +01:00

26 lines
810 B
Nix

{
lib,
appimageTools,
fetchurl,
}: let
pname = "feishin";
version = "0.6.1";
src = fetchurl {
url = "https://github.com/jeffvli/feishin/releases/download/v${version}/Feishin-${version}-linux-x86_64.AppImage";
hash = "sha256-1MNSO9CSxoAHJ3F+oPWpz8/JW2nDcyPsLe/RFaQfwwE=";
};
appimageContents = appimageTools.extractType2 {inherit pname version src;};
in
appimageTools.wrapType2 {
inherit pname version src;
extraInstallCommands = ''
mv $out/bin/${pname}-${version} $out/bin/${pname}
install -Dm444 ${appimageContents}/feishin.desktop -t $out/share/applications
substituteInPlace $out/share/applications/feishin.desktop \
--replace 'Exec=AppRun --no-sandbox %U' 'Exec=${pname}'
cp -r ${appimageContents}/usr/share/icons $out/share
'';
}