1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-03 15:41:02 +01:00
home-manager/tests/modules/misc/xdg/mime-apps-basics.nix
Robert Helgesson efcba687d3
xdg-mime-apps: add defaultApplicationPackages option
This option allows a user to inject default applications directly from
a list of specified packages. It was previously possible to do this,
but only through import from derivation.
2025-09-19 16:23:57 +02:00

44 lines
880 B
Nix

{ pkgs, ... }:
{
xdg.mimeApps = {
enable = true;
associations = {
added = {
"image/png" = [
"foo1.desktop"
"foo2.desktop"
"foo3.desktop"
];
"image/jpeg" = "foo4.desktop";
};
removed = {
"image/png" = "foo5.desktop";
};
};
defaultApplications = {
"image/png" = [
"default1.desktop"
"default2.desktop"
];
};
defaultApplicationPackages = [
(pkgs.makeDesktopItem {
type = "Application";
name = "test";
desktopName = "Test";
mimeTypes = [
"image/png"
"image/svg+xml"
];
})
];
};
nmt.script = ''
assertFileExists home-files/.config/mimeapps.list
assertFileContent \
home-files/.config/mimeapps.list \
${./mime-apps-basics-expected.ini}
'';
}