mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 04:58:01 +00:00
Gabriel Arazas
11806b9c4b
Most of it is specifically for NixOS usage but in case that it is possible for independent desktop sessions entirely made in home-manager especially in non-NixOS systems, it will be... nice.
68 lines
2.1 KiB
Nix
68 lines
2.1 KiB
Nix
{ pkgs, lib, self }:
|
|
|
|
let
|
|
sampleDesktopName = "horizontal-hunger";
|
|
in
|
|
lib.runTests {
|
|
testsBuilderMakeSampleXDGAssociationList = {
|
|
expr =
|
|
let
|
|
xdgAssociations = self.builders.makeXDGMimeAssociationList {
|
|
defaultApplications = {
|
|
"application/pdf" = "firefox.desktop";
|
|
};
|
|
};
|
|
in builtins.readFile "${xdgAssociations}/share/applications/mimeapps.list";
|
|
expected =
|
|
builtins.readFile ./data/fixtures/xdg-mime-sample-mimeapps.list;
|
|
};
|
|
|
|
# This should only create the "Default Applications" section of the
|
|
# specific-desktop mimeapps.list.
|
|
testsBuilderMakeSampleDesktopSpecificXDGAssociationList = {
|
|
expr =
|
|
let
|
|
xdgAssociations = self.builders.makeXDGMimeAssociationList {
|
|
desktopName = sampleDesktopName;
|
|
defaultApplications = {
|
|
"application/pdf" = "firefox.desktop";
|
|
};
|
|
};
|
|
in builtins.readFile "${xdgAssociations}/share/applications/${sampleDesktopName}-mimeapps.list";
|
|
expected =
|
|
builtins.readFile ./data/fixtures/xdg-mime-sample-desktop-specific-mimeapps.list;
|
|
};
|
|
|
|
testsBuilderMakeSampleXDGPortalCommonConfig = {
|
|
expr =
|
|
let
|
|
xdgPortalConf = self.builders.makeXDGPortalConfiguration {
|
|
config.preferred = {
|
|
default = "gtk";
|
|
"org.freedesktop.impl.portal.Screencast" = "gnome";
|
|
};
|
|
};
|
|
in
|
|
builtins.readFile "${xdgPortalConf}/share/xdg-desktop-portal/portals.conf";
|
|
expected =
|
|
builtins.readFile ./data/fixtures/xdg-portal.conf;
|
|
};
|
|
|
|
# We're just testing out if the destination is correct at this point.
|
|
testsBuilderMakeSampleXDGPortalDesktopSpecificConfig = {
|
|
expr =
|
|
let
|
|
xdgPortalConf = self.builders.makeXDGPortalConfiguration {
|
|
desktopName = sampleDesktopName;
|
|
config.preferred = {
|
|
default = "gtk";
|
|
"org.freedesktop.impl.portal.Screencast" = "gnome";
|
|
};
|
|
};
|
|
in
|
|
builtins.readFile "${xdgPortalConf}/share/xdg-desktop-portal/${sampleDesktopName}-portals.conf";
|
|
expected =
|
|
builtins.readFile ./data/fixtures/xdg-portal.conf;
|
|
};
|
|
}
|