wrapper-manager-fds/tests: add test config for XDG desktop entries

This commit is contained in:
Gabriel Arazas 2024-10-12 11:42:36 +08:00
parent 5a04d1670b
commit a6f448348d
2 changed files with 43 additions and 0 deletions

View File

@ -15,6 +15,7 @@ in
modules = [ ./wrapper-neofetch.nix ];
specialArgs.yourMomName = "Yor mom";
};
xdg-desktop-entry = build { modules = [ ./xdg-desktop-entry.nix ]; };
single-basepackage = build { modules = [ ./single-basepackage.nix ]; };
neofetch-with-additional-files = build { modules = [ ./neofetch-with-additional-files.nix ]; };
lib-modules-make-wraparound = build { modules = [ ./lib-modules-subset/make-wraparound.nix ]; };

View File

@ -0,0 +1,42 @@
{
config,
lib,
pkgs,
...
}:
{
wrappers.nvim = {
arg0 = lib.getExe' pkgs.neovim "nvim";
xdg.desktopEntry = {
enable = true;
settings = {
terminal = true;
extraConfig."X-GNOME-Autostart-Phase" = "WindowManager";
keywords = [ "Text editor" ];
startupNotify = false;
startupWMClass = "MyOwnClass";
};
};
};
xdg.desktopEntries.nvim-custom = {
name = "nvim-custom";
genericName = "Text editor";
terminal = true;
exec = "nvim";
};
build.extraPassthru.wrapperManagerTests = {
actuallyBuilt =
let
wrapper = config.build.toplevel;
in
pkgs.runCommand "wrapper-manager-xdg-desktop-entry-actually-built" { } ''
[ -e "${wrapper}/share/applications/nvim-custom.desktop" ] \
&& [ -e "${wrapper}/share/applications/nvim.desktop" ] \
&& [ -x "${wrapper}/bin/${config.wrappers.nvim.executableName}" ] && touch $out
'';
};
}