Compare commits
7 Commits
c148aa428f
...
main
Author | SHA1 | Date | |
---|---|---|---|
e230bf8cc6
|
|||
cf08d0e3b4
|
|||
5586cecb4f
|
|||
fd8519482d
|
|||
044bcc975b
|
|||
63b45642b8
|
|||
8170151c84
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -1 +1,4 @@
|
||||
result
|
||||
*.AppImage
|
||||
|
||||
.direnv/
|
||||
|
27
README.md
Normal file
27
README.md
Normal file
@ -0,0 +1,27 @@
|
||||
# Story Architect Flake
|
||||
|
||||
This flake packages the [Story Architect](https://github.com/story-apps/starc) AppImage.
|
||||
|
||||
## Build
|
||||
|
||||
```txt
|
||||
nix build
|
||||
```
|
||||
|
||||
## Developing
|
||||
|
||||
```txt
|
||||
nix develop
|
||||
```
|
||||
|
||||
This will put you in a shell with `appimage-run` and other useful utilities.
|
||||
It will also download the AppImage that is currently being packaged.
|
||||
To manually download the AppImage do:
|
||||
|
||||
```txt
|
||||
nix run .#dev
|
||||
```
|
||||
|
||||
### Resources
|
||||
|
||||
* [Nix Manual](https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-appimageTools)
|
77
flake.nix
77
flake.nix
@ -13,51 +13,60 @@
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
||||
name = "starc";
|
||||
version = "0.6.4";
|
||||
version = "0.7.5";
|
||||
|
||||
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}"];
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://github.com/story-apps/starc/releases/download/v${version}/starc-setup.AppImage";
|
||||
sha256 = "sha256-KAY04nXVyXnjKJxzh3Pvi50Vs0EPbLk0VgfZuz7MQR0=";
|
||||
};
|
||||
in {
|
||||
packages.${system} = {
|
||||
default = pkgs.appimageTools.wrapType1 {
|
||||
inherit name;
|
||||
default = pkgs.appimageTools.wrapType2 {
|
||||
inherit name src;
|
||||
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://github.com/story-apps/starc/releases/download/v${version}/starc-setup.AppImage";
|
||||
sha256 = "sha256-KLawvuLyqd7aPidH3ghr7mLl9NFQ7nduhnxAq0RpToQ=";
|
||||
};
|
||||
|
||||
extraInstallCommands = ''
|
||||
extraInstallCommands = let
|
||||
contents = pkgs.appimageTools.extract {
|
||||
inherit name src;
|
||||
};
|
||||
in ''
|
||||
# Install .desktop file
|
||||
mkdir -p $out/share/
|
||||
ln -s "${desktopItem}/share/applications" $out/share/applications
|
||||
install -m 444 ${contents}/${name}.desktop -Dt $out/share/applications
|
||||
|
||||
# Install 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
|
||||
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} -C - -Lo ${name}.AppImage
|
||||
''}";
|
||||
type = "app";
|
||||
};
|
||||
};
|
||||
|
||||
overlays = {
|
||||
default = final: prev: {
|
||||
starc = self.packages.${system}.default;
|
||||
};
|
||||
};
|
||||
|
||||
devShells.${system} = {
|
||||
default = pkgs.mkShellNoCC {
|
||||
packages = with pkgs; [
|
||||
appimage-run
|
||||
file
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
${self.apps.${system}.dev.program}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user