starc-flake/flake.nix

65 lines
1.8 KiB
Nix
Raw Normal View History

2024-01-24 20:50:46 +00:00
{
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";
2024-01-25 11:55:25 +00:00
2024-01-25 13:50:10 +00:00
icon = pkgs.fetchurl {
url = "https://github.com/story-apps/starc/blob/v${version}/img/starc.png";
sha256 = "sha256-wixqb1cV+WEhgxsl2CeOjrid4P0daHqh0O40h2iPst4=";
};
2024-01-25 11:55:25 +00:00
desktopItem = pkgs.makeDesktopItem {
exec = name;
2024-01-25 12:54:09 +00:00
inherit name;
desktopName = "Story Architect";
genericName = "Storywriting Software";
2024-01-25 13:50:10 +00:00
icon = name;
2024-01-25 12:54:09 +00:00
2024-01-25 13:50:10 +00:00
comment = "Advanced text editor for script writers.";
categories = ["Office" "TextEditor" "Utility"];
2024-01-25 14:17:30 +00:00
mimeTypes = ["application/x-${name}"];
2024-01-25 11:55:25 +00:00
};
2024-01-24 20:50:46 +00:00
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=";
};
2024-01-25 11:55:25 +00:00
extraInstallCommands = ''
2024-01-25 14:24:05 +00:00
mkdir -p $out/share/pixmaps/
2024-01-25 13:55:37 +00:00
ln -s "${desktopItem}/share/applications" $out/share/applications
2024-01-25 14:17:30 +00:00
2024-01-25 14:24:05 +00:00
ln -s "${icon}" $out/share/pixmaps/${name}.png
2024-01-25 14:17:30 +00:00
2024-01-25 14:24:05 +00:00
# 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
2024-01-25 11:55:25 +00:00
'';
2024-01-24 20:50:46 +00:00
};
};
};
}