Compare commits
No commits in common. "63b45642b8d37ed769bf4ec005529989d08aabeb" and "c148aa428f36f2ceade95a2023acbe9ad7431ebe" have entirely different histories.
63b45642b8
...
c148aa428f
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,4 +1 @@
|
|||||||
result
|
result
|
||||||
*.AppImage
|
|
||||||
|
|
||||||
.direnv/
|
|
||||||
|
23
README.md
23
README.md
@ -1,23 +0,0 @@
|
|||||||
# Story Architect Flake
|
|
||||||
|
|
||||||
This flake packages the [Story Architect](https://github.com/story-apps/starc) AppImage.
|
|
||||||
|
|
||||||
## Build
|
|
||||||
|
|
||||||
```txt
|
|
||||||
nix build
|
|
||||||
```
|
|
||||||
|
|
||||||
## Developing
|
|
||||||
|
|
||||||
```txt
|
|
||||||
nix develop
|
|
||||||
nix run .#dev
|
|
||||||
```
|
|
||||||
|
|
||||||
The `nix run .#dev` command will download the AppImage used for building.
|
|
||||||
It can then be inspected locally with tools like `file` and `appimage-run`, which are offered by the `nix develop` command.
|
|
||||||
|
|
||||||
### Resources
|
|
||||||
|
|
||||||
* [Nix Manual](https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-appimageTools)
|
|
66
flake.nix
66
flake.nix
@ -15,51 +15,49 @@
|
|||||||
name = "starc";
|
name = "starc";
|
||||||
version = "0.6.4";
|
version = "0.6.4";
|
||||||
|
|
||||||
appImage = pkgs.fetchurl {
|
icon = pkgs.fetchurl {
|
||||||
url = "https://github.com/story-apps/starc/releases/download/v${version}/starc-setup.AppImage";
|
url = "https://github.com/story-apps/starc/blob/v${version}/img/starc.png";
|
||||||
sha256 = "sha256-KLawvuLyqd7aPidH3ghr7mLl9NFQ7nduhnxAq0RpToQ=";
|
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}"];
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
packages.${system} = {
|
packages.${system} = {
|
||||||
default = pkgs.appimageTools.wrapType2 {
|
default = pkgs.appimageTools.wrapType1 {
|
||||||
inherit name;
|
inherit name;
|
||||||
|
|
||||||
src = appImage;
|
src = pkgs.fetchurl {
|
||||||
|
url = "https://github.com/story-apps/starc/releases/download/v${version}/starc-setup.AppImage";
|
||||||
extraInstallCommands = let
|
sha256 = "sha256-KLawvuLyqd7aPidH3ghr7mLl9NFQ7nduhnxAq0RpToQ=";
|
||||||
contents = pkgs.appimageTools.extract {
|
|
||||||
src = appImage;
|
|
||||||
pname = name;
|
|
||||||
inherit version;
|
|
||||||
};
|
};
|
||||||
in ''
|
|
||||||
|
extraInstallCommands = ''
|
||||||
# Install .desktop file
|
# Install .desktop file
|
||||||
mkdir -p $out/share/applications
|
mkdir -p $out/share/
|
||||||
cp ${contents}/${name}.desktop $out/share/applications
|
ln -s "${desktopItem}/share/applications" $out/share/applications
|
||||||
|
|
||||||
# Install icons
|
# Install icons
|
||||||
mkdir -p $out/share
|
for dimension in 128 256 512; do
|
||||||
cp -r ${contents}/share/icons $out/share
|
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
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
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
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user