nix-bundle icon indicating copy to clipboard operation
nix-bundle copied to clipboard

Create .desktop files on the fly

Open matthewbauer opened this issue 8 years ago • 1 comments

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.

matthewbauer avatar Feb 06 '17 23:02 matthewbauer

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;
   };

tomberek avatar Oct 10 '18 04:10 tomberek