liminalOS/modules/linux/flatpak/default.nix

52 lines
1.2 KiB
Nix
Raw Permalink Normal View History

2024-12-08 16:42:57 -08:00
# NOTE: this module is IMPURE. Flatpaks are declaratively specified but not
# versioned. Therefore, they are not included in generational rollbacks and
# persist between generations. This is not ideal, but at least it is a better
# situation than imperative installation
{
inputs,
config,
lib,
...
}:
let
cfg = config.liminalOS.programs.flatpak;
in
2024-12-08 16:42:57 -08:00
{
options.liminalOS.programs.flatpak = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether to enable Nix flatpak support with some fixes as well as declarative flatpak management.
'';
};
};
config = lib.mkIf cfg.enable {
xdg.portal.enable = true;
services.flatpak = {
enable = true;
2024-12-08 16:42:57 -08:00
overrides = {
global = {
Context.sockets = [
"wayland"
"!x11"
"!fallback-x11"
];
2024-12-08 16:42:57 -08:00
Environment = {
# Fix un-themed cursor in some Wayland apps
XCURSOR_PATH = "/run/host/user-share/icons:/run/host/share/icons";
};
2024-12-08 16:42:57 -08:00
};
};
update.auto = {
enable = true;
onCalendar = "weekly";
};
2024-12-08 16:42:57 -08:00
};
};
}