starc-flake/flake.nix

64 lines
1.8 KiB
Nix

{
description = "An advanced text editor for script writers working professionally in film, novel, theatre, radio or writing for comic books.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = {
self,
nixpkgs,
}: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
name = "starc";
version = "0.6.4";
icon = pkgs.fetchurl {
url = "https://github.com/story-apps/starc/blob/v${version}/img/starc.png";
sha256 = "sha256-wixqb1cV+WEhgxsl2CeOjrid4P0daHqh0O40h2iPst4=";
};
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 {
packages.${system} = {
default = pkgs.appimageTools.wrapType1 {
inherit name;
src = pkgs.fetchurl {
url = "https://github.com/story-apps/starc/releases/download/v${version}/starc-setup.AppImage";
sha256 = "sha256-KLawvuLyqd7aPidH3ghr7mLl9NFQ7nduhnxAq0RpToQ=";
};
extraInstallCommands = ''
mkdir -p $out/share/
ln -s "${desktopItem}/share/applications" $out/share/applications
# Install icons
mkdir -p $out/share/icons/
for dimension in 128 256 512; do
dimensions=''${dimension}x''${dimension}
mkdir -p $out/share/icons/hicolor/$dimensions/apps
"${pkgs.imagemagick}/bin/convert" ${icon} -resize $dimensions $out/share/icons/hicolor/$dimensions/apps/${name}.png
done
'';
};
};
};
}