mirror of
https://github.com/lhns/steam-frame-nix.git
synced 2026-10-06 02:00:13 +02:00
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.
32 lines
1.1 KiB
Nix
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"
|