Hi,
I have nix file that builds and installs an application, but there is no png icon in the github repo, so how can I add a icon myself?
The repo only contains a gif icon, but I think a png icon is required for it to show up in Gnome.
So I need to add a png file from somewhere else, wget/curl or base64 doesn’t work in the postInstall step.
I could fork the repo and add my own png icon but that seems stupid.
Any idea how to inject my own png file?
Thanks!!
Here is the nix file:
{ pkgs, ... }:
pkgs.stdenv.mkDerivation rec {
pname = "sheepshaver";
version = "96e512bd6376e78a2869f16dcc8a9028bce5ee72";
src = pkgs.fetchFromGitHub {
owner = "cebix";
repo = "macemu";
rev = version;
sha256 = "sha256-ZWE51cRAKj8YFkiBHtd1/M5bWElbdNC30gmYk/cmxEo=";
};
unpackPhase = ''
cp -R $src/ writable/
chmod -R u+w writable/
make -C writable/SheepShaver links
'';
sourceRoot = "writable/SheepShaver/src/Unix";
nativeBuildInputs = with pkgs; [
autoconf automake file perl pkg-config
];
buildInputs = with pkgs; [
gtk2 SDL xorg.libX11 xorg.libSM libslirp
];
configureFlags = [
"--enable-sdl-audio"
];
CPPFLAGS = "-DSTDC_HEADERS";
preConfigure = ''
NO_CONFIGURE=1 ./autogen.sh
'';
desktopEntry = pkgs.makeDesktopItem {
name = "SheepShaver";
desktopName = "SheepShaver";
exec = "SheepShaver";
icon = "SheepShaver";
terminal = false;
};
postInstall = ''
mkdir -p $out/share/applications $out/share/icons
# this doesn't work
cp $src/SheepShaver/doc/Linux/icon.gif $out/share/icons/SheepShaver.gif
cp ${desktopEntry}/share/applications/SheepShaver.desktop $out/share/applications/SheepShaver.desktop
'';
}