mirror of
https://github.com/nix-community/home-manager
synced 2024-11-24 12:09:46 +01:00
e58a7cb13d
The `makeDesktopItem` function changed in a backwards incompatible way
in
0c713dbed4
This commit updates the module accordingly.
Fixes #2767
67 lines
1.9 KiB
Nix
67 lines
1.9 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
{
|
|
config = {
|
|
xdg.desktopEntries = {
|
|
full = { # full definition
|
|
type = "Application";
|
|
exec = "test --option";
|
|
icon = "test";
|
|
comment = "My Application";
|
|
terminal = true;
|
|
name = "Test";
|
|
genericName = "Web Browser";
|
|
mimeType = [ "text/html" "text/xml" ];
|
|
categories = [ "Network" "WebBrowser" ];
|
|
startupNotify = false;
|
|
noDisplay = false;
|
|
prefersNonDefaultGPU = false;
|
|
extraConfig = ''
|
|
[X-ExtraSection]
|
|
Exec=foo -o
|
|
'';
|
|
settings = {
|
|
Keywords = "calc;math";
|
|
DBusActivatable = "false";
|
|
};
|
|
fileValidation = true;
|
|
};
|
|
min = { # minimal definition
|
|
exec = "test --option";
|
|
name = "Test";
|
|
};
|
|
};
|
|
|
|
#testing that preexisting entries in the store are overridden
|
|
home.packages = [
|
|
(pkgs.makeDesktopItem {
|
|
name = "full";
|
|
desktopName = "We don't want this";
|
|
exec = "no";
|
|
})
|
|
(pkgs.makeDesktopItem {
|
|
name = "min";
|
|
desktopName = "We don't want this";
|
|
exec = "no";
|
|
})
|
|
];
|
|
|
|
test.asserts.assertions.expected =
|
|
let currentFile = toString ./desktop-entries.nix;
|
|
in [''
|
|
The option definition `extraConfig' in `${currentFile}' no longer has any effect; please remove it.
|
|
The `extraConfig` option of `xdg.desktopEntries` has been removed following a change in Nixpkgs.
|
|
''];
|
|
|
|
nmt.script = ''
|
|
assertFileExists home-path/share/applications/full.desktop
|
|
assertFileExists home-path/share/applications/min.desktop
|
|
assertFileContent home-path/share/applications/full.desktop \
|
|
${./desktop-full-expected.desktop}
|
|
assertFileContent home-path/share/applications/min.desktop \
|
|
${./desktop-min-expected.desktop}
|
|
'';
|
|
};
|
|
}
|