<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.nixos.org/w/index.php?action=history&amp;feed=atom&amp;title=Desktop_Items</id>
	<title>Desktop Items - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.nixos.org/w/index.php?action=history&amp;feed=atom&amp;title=Desktop_Items"/>
	<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=Desktop_Items&amp;action=history"/>
	<updated>2026-06-04T19:45:44Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://wiki.nixos.org/w/index.php?title=Desktop_Items&amp;diff=32581&amp;oldid=prev</id>
		<title>Username-Generic: Rewrote a paragraph to be more comprehensible</title>
		<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=Desktop_Items&amp;diff=32581&amp;oldid=prev"/>
		<updated>2026-06-03T21:46:36Z</updated>

		<summary type="html">&lt;p&gt;Rewrote a paragraph to be more comprehensible&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:46, 3 June 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l17&quot;&gt;Line 17:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;====Copying desktop items====&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;====Copying desktop items====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Desktop items are typically stored within &lt;/del&gt;&amp;lt;code&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;application&lt;/del&gt;&amp;lt;/code&amp;gt; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;subdirectories &lt;/del&gt;of paths &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;assigned to the &lt;/del&gt;&amp;lt;code&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;XDG_DATA_DIRS&lt;/del&gt;&amp;lt;/code&amp;gt; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;environment variable&lt;/del&gt;. On NixOS, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;those files get included in &lt;/del&gt;that variable &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;after being copied to an installed &lt;/del&gt;package&#039;s &amp;lt;code&amp;gt;$out/share/applications&amp;lt;/code&amp;gt; directory. This can be achieved by either linking or copying the files &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;in a &lt;/del&gt;phase &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;manually&lt;/del&gt;, or by using the [https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/setup-hooks/copy-desktop-items.sh copyDesktopItems] hook:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The environment variable &lt;/ins&gt;&amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;XDG_DATA_DIRS&lt;/ins&gt;&amp;lt;/code&amp;gt; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;can be read by application launchers in search &lt;/ins&gt;of &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;desktop files. More specifically, it lists &lt;/ins&gt;paths &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;which may contain &lt;/ins&gt;&amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;applications&lt;/ins&gt;&amp;lt;/code&amp;gt; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;directories that store them&lt;/ins&gt;. On NixOS, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;once a package is installed, its desktop items become discoverable by &lt;/ins&gt;that variable &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;so long as they are placed in the &lt;/ins&gt;package &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;output&lt;/ins&gt;&#039;s &amp;lt;code&amp;gt;$out/share/applications&amp;lt;/code&amp;gt; directory. This can be achieved by either linking or copying the files &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;there, during an installation [[Derivations#Phases|&lt;/ins&gt;phase&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;, or by using the [https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/setup-hooks/copy-desktop-items.sh copyDesktopItems] hook:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;nix&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;nix&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff:1.41:old-32580:rev-32581:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Username-Generic</name></author>
	</entry>
	<entry>
		<id>https://wiki.nixos.org/w/index.php?title=Desktop_Items&amp;diff=32580&amp;oldid=prev</id>
		<title>Username-Generic: Created an article about Desktop Items</title>
		<link rel="alternate" type="text/html" href="https://wiki.nixos.org/w/index.php?title=Desktop_Items&amp;diff=32580&amp;oldid=prev"/>
		<updated>2026-06-03T20:58:15Z</updated>

		<summary type="html">&lt;p&gt;Created an article about Desktop Items&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Desktop items (more commonly referred to as &amp;quot;desktop entries&amp;quot;) are special files used to provide information to application launchers regarding specific programs, directories, or URLs, which they are meant to handle. As a universal standard, these files should to adhere to [https://specifications.freedesktop.org/desktop-entry/latest/index.html their freedesktop.org specification].&lt;br /&gt;
&lt;br /&gt;
==Packaging==&lt;br /&gt;
&lt;br /&gt;
====Creating desktop items====&lt;br /&gt;
&lt;br /&gt;
If provided upstream, desktop item files can be copied over to a package&amp;#039;s output directly. Alternatively, they may also be generated by using the [https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/make-desktopitem/default.nix makeDesktopItem] builder:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nix&amp;quot;&amp;gt;&lt;br /&gt;
makeDesktopItem {&lt;br /&gt;
  name = &amp;quot;Example Program&amp;quot;;&lt;br /&gt;
  exec = &amp;quot;example-program&amp;quot;;&lt;br /&gt;
  categories = [ &amp;quot;Education&amp;quot; ];&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Copying desktop items====&lt;br /&gt;
&lt;br /&gt;
Desktop items are typically stored within &amp;lt;code&amp;gt;application&amp;lt;/code&amp;gt; subdirectories of paths assigned to the &amp;lt;code&amp;gt;XDG_DATA_DIRS&amp;lt;/code&amp;gt; environment variable. On NixOS, those files get included in that variable after being copied to an installed package&amp;#039;s &amp;lt;code&amp;gt;$out/share/applications&amp;lt;/code&amp;gt; directory. This can be achieved by either linking or copying the files in a phase manually, or by using the [https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/setup-hooks/copy-desktop-items.sh copyDesktopItems] hook:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;nix&amp;quot;&amp;gt;&lt;br /&gt;
# The hook reads items from this variable.&lt;br /&gt;
desktopItems = [&lt;br /&gt;
  (makeDesktopItem {&lt;br /&gt;
    name = &amp;quot;Example Program&amp;quot;;&lt;br /&gt;
    exec = &amp;quot;example-program&amp;quot;;&lt;br /&gt;
    categories = [ &amp;quot;Education&amp;quot; ];&lt;br /&gt;
  })&lt;br /&gt;
  # ...&lt;br /&gt;
];&lt;br /&gt;
&lt;br /&gt;
nativeBuildInputs = [&lt;br /&gt;
  copyDesktopItems&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Tips and Tricks==&lt;br /&gt;
&lt;br /&gt;
====Validating desktop items====&lt;br /&gt;
&lt;br /&gt;
To quickly validate an existing desktop item, the following command may be run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot;&amp;gt;&lt;br /&gt;
$ nix-shell -p buildPackages.desktop-file-utils --run &amp;quot;desktop-file-validate ./path/to/file.desktop&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Username-Generic</name></author>
	</entry>
</feed>