Files
lhns--steam-frame-nix/modules/applications-menu/check.nix
T
Pierre Kisters 59513bcbb1 Applications menu for KDE apps in the Steam session
SteamOS only ships /etc/xdg/menus/plasma-applications.menu; the nested
desktop sets XDG_MENU_PREFIX=plasma-, the Steam session doesn't, so KDE
apps started there (Dolphin from the "+" menu) built an empty app
database: "no installed application can open" every file.

session.applicationsMenu (module applications-menu, on by default) links
~/.config/menus/applications.menu to Plasma's menu. Flake check: the link
is generated by default and absent when disabled.
2026-09-29 03:01:38 +02:00

32 lines
1.1 KiB
Nix

# Evaluates the applications-menu module against a stub of Home Manager's
# options: on by default the link to Plasma's menu is generated, disabled it
# is absent.
{ pkgs }:
let
inherit (pkgs) lib;
eval = cfg: (lib.evalModules {
modules = [
../applications-menu.nix
{
options.xdg.configFile = lib.mkOption {
type = lib.types.attrsOf (lib.types.attrsOf lib.types.anything);
default = { };
};
options.lib = lib.mkOption { type = lib.types.attrsOf lib.types.anything; };
config = {
_module.check = false; # Home Manager options the stub doesn't declare
_module.args.pkgs = pkgs;
lib.file.mkOutOfStoreSymlink = p: "out-of-store:${p}";
};
}
cfg
];
}).config.xdg.configFile;
on = eval { };
off = eval { steamFrame.session.applicationsMenu.enable = false; };
in
assert on."menus/applications.menu".source
== "out-of-store:/etc/xdg/menus/plasma-applications.menu";
assert !(off ? "menus/applications.menu");
pkgs.runCommand "applications-menu-check" { } "touch $out"