different way of installing icons
This commit is contained in:
parent
8170151c84
commit
63b45642b8
48
flake.nix
48
flake.nix
@ -15,49 +15,31 @@
|
|||||||
name = "starc";
|
name = "starc";
|
||||||
version = "0.6.4";
|
version = "0.6.4";
|
||||||
|
|
||||||
icon = pkgs.fetchurl {
|
appImage = pkgs.fetchurl {
|
||||||
url = "https://github.com/story-apps/starc/blob/v${version}/img/starc.png";
|
|
||||||
sha256 = "sha256-wixqb1cV+WEhgxsl2CeOjrid4P0daHqh0O40h2iPst4=";
|
|
||||||
};
|
|
||||||
|
|
||||||
appimage = pkgs.fetchurl {
|
|
||||||
url = "https://github.com/story-apps/starc/releases/download/v${version}/starc-setup.AppImage";
|
url = "https://github.com/story-apps/starc/releases/download/v${version}/starc-setup.AppImage";
|
||||||
sha256 = "sha256-KLawvuLyqd7aPidH3ghr7mLl9NFQ7nduhnxAq0RpToQ=";
|
sha256 = "sha256-KLawvuLyqd7aPidH3ghr7mLl9NFQ7nduhnxAq0RpToQ=";
|
||||||
};
|
};
|
||||||
|
|
||||||
desktopItem = pkgs.makeDesktopItem {
|
|
||||||
exec = name;
|
|
||||||
|
|
||||||
inherit name;
|
|
||||||
desktopName = "Story Architect";
|
|
||||||
genericName = "Storywriting Software";
|
|
||||||
|
|
||||||
icon = name;
|
|
||||||
|
|
||||||
comment = "Advanced text editor for script writers.";
|
|
||||||
categories = ["Office" "TextEditor" "Utility"];
|
|
||||||
|
|
||||||
mimeTypes = ["application/x-${name}"];
|
|
||||||
};
|
|
||||||
in {
|
in {
|
||||||
packages.${system} = {
|
packages.${system} = {
|
||||||
default = pkgs.appimageTools.wrapType1 {
|
default = pkgs.appimageTools.wrapType2 {
|
||||||
inherit name;
|
inherit name;
|
||||||
|
|
||||||
src = appimage;
|
src = appImage;
|
||||||
|
|
||||||
extraInstallCommands = ''
|
extraInstallCommands = let
|
||||||
|
contents = pkgs.appimageTools.extract {
|
||||||
|
src = appImage;
|
||||||
|
pname = name;
|
||||||
|
inherit version;
|
||||||
|
};
|
||||||
|
in ''
|
||||||
# Install .desktop file
|
# Install .desktop file
|
||||||
mkdir -p $out/share/
|
mkdir -p $out/share/applications
|
||||||
ln -s "${desktopItem}/share/applications" $out/share/applications
|
cp ${contents}/${name}.desktop $out/share/applications
|
||||||
|
|
||||||
# Install icons
|
# Install icons
|
||||||
for dimension in 128 256 512; do
|
mkdir -p $out/share
|
||||||
dimensions=''${dimension}x''${dimension}
|
cp -r ${contents}/share/icons $out/share
|
||||||
|
|
||||||
mkdir -p $out/share/icons/hicolor/$dimensions/apps
|
|
||||||
"${pkgs.imagemagick}/bin/convert" ${icon} -resize $dimensions $out/share/icons/hicolor/$dimensions/apps/${name}.png
|
|
||||||
done
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -65,7 +47,7 @@
|
|||||||
apps.${system} = {
|
apps.${system} = {
|
||||||
dev = {
|
dev = {
|
||||||
program = "${pkgs.writeShellScript "download-appimage" ''
|
program = "${pkgs.writeShellScript "download-appimage" ''
|
||||||
${pkgs.curl}/bin/curl ${appimage.url} -Lo ${name}.AppImage
|
${pkgs.curl}/bin/curl ${appImage.url} -Lo ${name}.AppImage
|
||||||
''}";
|
''}";
|
||||||
type = "app";
|
type = "app";
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user