starc-flake/flake.nix

66 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";
appImage = 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;
extraInstallCommands = let
contents = pkgs.appimageTools.extract {
src = appImage;
pname = name;
inherit version;
};
in ''
# Install .desktop file
mkdir -p $out/share/applications
cp ${contents}/${name}.desktop $out/share/applications
# Install icons
mkdir -p $out/share
cp -r ${contents}/share/icons $out/share
'';
};
};
apps.${system} = {
dev = {
program = "${pkgs.writeShellScript "download-appimage" ''
${pkgs.curl}/bin/curl ${appImage.url} -Lo ${name}.AppImage
''}";
type = "app";
};
};
devShells.${system} = {
default = pkgs.mkShellNoCC {
packages = with pkgs; [
appimage-run
file
];
};
};
};
}