From da9e3f3e2d48c551e59eca777aa4e30d3e5069e5 Mon Sep 17 00:00:00 2001 From: pancaek <20342389+pancaek@users.noreply.github.com> Date: Sun, 10 Nov 2024 02:04:35 -0800 Subject: [PATCH] story-architect: init at 0.7.5 --- pkgs/by-name/st/starc/package.nix | 52 +++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 pkgs/by-name/st/starc/package.nix diff --git a/pkgs/by-name/st/starc/package.nix b/pkgs/by-name/st/starc/package.nix new file mode 100644 index 00000000000000..e8a8654abaf725 --- /dev/null +++ b/pkgs/by-name/st/starc/package.nix @@ -0,0 +1,52 @@ +{ + stdenvNoCC, + lib, + fetchurl, + appimageTools, + makeWrapper, +}: + +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "starc"; + version = "0.7.5"; + + src = fetchurl { + url = "https://github.com/story-apps/starc/releases/download/v${finalAttrs.version}/starc-setup.AppImage"; + hash = "sha256-KAY04nXVyXnjKJxzh3Pvi50Vs0EPbLk0VgfZuz7MQR0="; + }; + + dontUnpack = true; + + nativeBuildInputs = [ makeWrapper ]; + + installPhase = + let + appimageContents = appimageTools.extract { inherit (finalAttrs) pname version src; }; + starc-unwrapped = appimageTools.wrapType2 { inherit (finalAttrs) pname version src; }; + in + '' + runHook preInstall + + # Fixup desktop item icons + install -D ${appimageContents}/starc.desktop -t $out/share/applications/ + + substituteInPlace $out/share/applications/starc.desktop \ + --replace-fail "Icon=starc" "${"Icon=dev.storyapps.starc\nStartupWMClass=Story Architect"}" + + cp -r ${appimageContents}/share/* $out/share/ + + makeWrapper ${starc-unwrapped}/bin/starc $out/bin/starc \ + --unset QT_PLUGIN_PATH + + runHook postInstall + ''; + + meta = { + description = "Intuitive screenwriting app that streamlines the writing process"; + homepage = "https://starc.app/"; + mainProgram = "starc"; + license = lib.licenses.unfree; + maintainers = with lib.maintainers; [ pancaek ]; + platforms = lib.platforms.unix; + }; +})