nixpkgs/pkgs/build-support/make-desktopitem/default.nix

32 lines
572 B
Nix
Raw Normal View History

{stdenv}:
{ name
, type ? "Application"
, exec
, icon ? ""
, comment ? ""
, terminal ? "false"
, desktopName
, genericName
, mimeType ? ""
, categories ? "Application;Other;"
}:
stdenv.mkDerivation {
inherit name;
buildCommand = ''
mkdir -p $out/share/applications
cat > $out/share/applications/$name.desktop <<EOF
[Desktop Entry]
Type=${type}
Exec=${exec}
Icon=${icon}
Comment=${comment}
Terminal=${terminal}
Name=${desktopName}
GenericName=${genericName}
MimeType=${mimeType}
Categories=${categories}
EOF
'';
}