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
|
2024-12-23 01:18:36 -08:00
|
|
|
{
|
2024-12-25 22:50:35 -08:00
|
|
|
inputs,
|
2024-12-23 01:18:36 -08:00
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
let
|
2024-12-23 04:29:01 -08:00
|
|
|
cfg = config.liminalOS.programs.flatpak;
|
2024-12-23 01:18:36 -08:00
|
|
|
in
|
2024-12-08 16:42:57 -08:00
|
|
|
{
|
2024-12-23 04:29:01 -08:00
|
|
|
options.liminalOS.programs.flatpak = {
|
2024-12-23 01:18:36 -08:00
|
|
|
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 {
|
2024-12-25 19:47:59 -08:00
|
|
|
xdg.portal.enable = true;
|
2024-12-23 01:18:36 -08:00
|
|
|
services.flatpak = {
|
|
|
|
enable = true;
|
2024-12-08 16:42:57 -08:00
|
|
|
|
2024-12-23 01:18:36 -08:00
|
|
|
overrides = {
|
|
|
|
global = {
|
|
|
|
Context.sockets = [
|
|
|
|
"wayland"
|
|
|
|
"!x11"
|
|
|
|
"!fallback-x11"
|
|
|
|
];
|
2024-12-08 16:42:57 -08:00
|
|
|
|
2024-12-23 01:18:36 -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
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-12-23 01:18:36 -08:00
|
|
|
update.auto = {
|
|
|
|
enable = true;
|
|
|
|
onCalendar = "weekly";
|
|
|
|
};
|
2024-12-08 16:42:57 -08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|