summary refs log tree commit diff
path: root/pkgs/build-support/make-desktopitem/default.nix
blob: 7f3b97a33b79a55d0f201ebbb8d92e0db04e542d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{stdenv}:
{ name
, type ? "Application"
, exec
, icon ? ""
, comment ? ""
, terminal ? "false"
, desktopName
, genericName
, mimeType ? ""
, categories ? "Application;Other;"
, encoding ? "UTF-8"
}:

stdenv.mkDerivation {
  inherit name;
  buildCommand = ''
    ensureDir $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}
    Encoding=${encoding}
    EOF
  '';
}