Compare commits

...

5 Commits

2 changed files with 28 additions and 17 deletions

View File

@ -12,11 +12,15 @@ nix build
```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.
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

View File

@ -13,33 +13,30 @@
pkgs = nixpkgs.legacyPackages.${system};
name = "starc";
version = "0.6.4";
version = "0.7.5";
appImage = pkgs.fetchurl {
src = pkgs.fetchurl {
url = "https://github.com/story-apps/starc/releases/download/v${version}/starc-setup.AppImage";
sha256 = "sha256-KLawvuLyqd7aPidH3ghr7mLl9NFQ7nduhnxAq0RpToQ=";
sha256 = "sha256-KAY04nXVyXnjKJxzh3Pvi50Vs0EPbLk0VgfZuz7MQR0=";
};
in {
packages.${system} = {
default = pkgs.appimageTools.wrapType2 {
inherit name;
src = appImage;
inherit name src;
extraInstallCommands = let
contents = pkgs.appimageTools.extract {
src = appImage;
pname = name;
inherit version;
inherit name src;
};
in ''
# Install .desktop file
mkdir -p $out/share/applications
cp ${contents}/${name}.desktop $out/share/applications
install -m 444 ${contents}/${name}.desktop -Dt $out/share/applications
# Install icons
mkdir -p $out/share
cp -r ${contents}/share/icons $out/share
for file in $(find ${contents}/share/icons -type f); do
directory=$(dirname ''${file#${contents}})
install -m 444 $file -D $out/$directory/${name}.png
done
'';
};
};
@ -47,18 +44,28 @@
apps.${system} = {
dev = {
program = "${pkgs.writeShellScript "download-appimage" ''
${pkgs.curl}/bin/curl ${appImage.url} -Lo ${name}.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}
'';
};
};
};