starc-flake/flake.nix

63 lines
1.6 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";
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;
extraInstallCommands = let
contents = pkgs.appimageTools.extract {
inherit name src;
};
in ''
# Install .desktop file
install -m 444 ${contents}/${name}.desktop -Dt $out/share/applications
# Install icons
for file in $(find ${contents}/share/icons -type f); do
directory=$(dirname ''${file#${contents}})
install -m 444 $file -D $out/$directory/${name}.png
done
'';
};
};
apps.${system} = {
dev = {
program = "${pkgs.writeShellScript "download-appimage" ''
${pkgs.curl}/bin/curl ${src.url} -Lo ${name}.AppImage
''}";
type = "app";
};
};
devShells.${system} = {
default = pkgs.mkShellNoCC {
packages = with pkgs; [
appimage-run
file
];
};
};
};
}