used embeded .desktop file and icons

This commit is contained in:
Kristian Krsnik 2024-01-25 18:30:18 +01:00
parent 63b45642b8
commit 044bcc975b
Signed by: Kristian
GPG Key ID: FD1330AC9F909E85

View File

@ -15,31 +15,28 @@
name = "starc";
version = "0.6.4";
appImage = pkgs.fetchurl {
src = pkgs.fetchurl {
url = "https://github.com/story-apps/starc/releases/download/v${version}/starc-setup.AppImage";
sha256 = "sha256-KLawvuLyqd7aPidH3ghr7mLl9NFQ7nduhnxAq0RpToQ=";
};
in {
packages.${system} = {
default = pkgs.appimageTools.wrapType2 {
inherit name;
src = appImage;
inherit name src;
extraInstallCommands = let
contents = pkgs.appimageTools.extract {
src = appImage;
pname = name;
inherit version;
inherit name src;
};
in ''
# Install .desktop file
mkdir -p $out/share/applications
cp ${contents}/${name}.desktop $out/share/applications
install -m 444 ${contents}/${name}.desktop -Dt $out/share/applications
# Install icons
mkdir -p $out/share
cp -r ${contents}/share/icons $out/share
for file in $(find ${contents}/share/icons -type f); do
directory=$(dirname ''${file#${contents}})
install -m 444 $file -D $out/$directory/${name}.png
done
'';
};
};
@ -47,7 +44,7 @@
apps.${system} = {
dev = {
program = "${pkgs.writeShellScript "download-appimage" ''
${pkgs.curl}/bin/curl ${appImage.url} -Lo ${name}.AppImage
${pkgs.curl}/bin/curl ${src.url} -Lo ${name}.AppImage
''}";
type = "app";
};