nix-bundle
nix-bundle copied to clipboard
Create .desktop files on the fly
See https://github.com/matthewbauer/nix-bundle/commit/43f0f0401f4b62e39a44d1fe97934df78f59961f#commitcomment-20773045
Basically, some applications don't have good .desktop files, so we may need to create them custom.
I find myself using things like this:
app_src = input : pkgs.stdenv.mkDerivation rec {
name="share";
exec="bin/main";
src = input;
buildCommand = ''
source $stdenv/setup
cp -rL $src/. $out/
chmod +w -R $out/
substituteInPlace $out/share/applications/example.desktop \
--replace '@icon@' $out/share/example-appimage \
--replace '@out@' $out/bin \
--replace '@exec@' $out/${exec}
mkdir -p $out/nix-support
echo "file binary-dist $out/${exec}" > $out/nix-support/hydra-build-products
echo $(basename ${exec})> $out/nix-support/hydra-release-name
chmod -w -R $out/
'';
system = builtins.currentSystem;
};