nixos/flatpak: add package option

this patch adds the `services.flatpak.package` option to
allow overriding the package added by this module to
`environment.systemPackages` and the likes.

This is useful in scenarios where applications call the
flatpak binary to query information like writable directories
and there is a custom package returning different results
from the vanilla binary.

See https://github.com/crabdancing/nixpak-flatpak-wrapper
This commit is contained in:
networkException 2024-08-03 15:49:33 +02:00
parent 85bcad4a96
commit af69223f46
No known key found for this signature in database
GPG Key ID: E3877443AE684391

View File

@ -15,6 +15,8 @@ in {
options = {
services.flatpak = {
enable = mkEnableOption "flatpak";
package = mkPackageOption pkgs "flatpak" { };
};
};
@ -28,16 +30,16 @@ in {
}
];
environment.systemPackages = [ pkgs.flatpak ];
environment.systemPackages = [ cfg.package ];
security.polkit.enable = true;
fonts.fontDir.enable = true;
services.dbus.packages = [ pkgs.flatpak ];
services.dbus.packages = [ cfg.package ];
systemd.packages = [ pkgs.flatpak ];
systemd.tmpfiles.packages = [ pkgs.flatpak ];
systemd.packages = [ cfg.package ];
systemd.tmpfiles.packages = [ cfg.package ];
environment.profiles = [
"$HOME/.local/share/flatpak/exports"