added documentation and dev tools

This commit is contained in:
Kristian Krsnik 2024-01-25 17:19:11 +01:00
parent c148aa428f
commit 8170151c84
Signed by: Kristian
GPG Key ID: FD1330AC9F909E85
4 changed files with 51 additions and 4 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
use flake

3
.gitignore vendored
View File

@ -1 +1,4 @@
result
*.AppImage
.direnv/

23
README.md Normal file
View File

@ -0,0 +1,23 @@
# 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)

View File

@ -20,6 +20,11 @@
sha256 = "sha256-wixqb1cV+WEhgxsl2CeOjrid4P0daHqh0O40h2iPst4=";
};
appimage = pkgs.fetchurl {
url = "https://github.com/story-apps/starc/releases/download/v${version}/starc-setup.AppImage";
sha256 = "sha256-KLawvuLyqd7aPidH3ghr7mLl9NFQ7nduhnxAq0RpToQ=";
};
desktopItem = pkgs.makeDesktopItem {
exec = name;
@ -39,10 +44,7 @@
default = pkgs.appimageTools.wrapType1 {
inherit name;
src = pkgs.fetchurl {
url = "https://github.com/story-apps/starc/releases/download/v${version}/starc-setup.AppImage";
sha256 = "sha256-KLawvuLyqd7aPidH3ghr7mLl9NFQ7nduhnxAq0RpToQ=";
};
src = appimage;
extraInstallCommands = ''
# Install .desktop file
@ -59,5 +61,23 @@
'';
};
};
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
];
};
};
};
}