Compare commits

...

5 Commits

2 changed files with 28 additions and 17 deletions

View File

@ -12,11 +12,15 @@ nix build
```txt ```txt
nix develop nix develop
nix run .#dev
``` ```
The `nix run .#dev` command will download the AppImage used for building. This will put you in a shell with `appimage-run` and other useful utilities.
It can then be inspected locally with tools like `file` and `appimage-run`, which are offered by the `nix develop` command. It will also download the AppImage that is currently being packaged.
To manually download the AppImage do:
```txt
nix run .#dev
```
### Resources ### Resources

View File

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