nixpkgs-suyu/nixos/modules/services/desktops/flatpak.nix

43 lines
807 B
Nix
Raw Normal View History

2017-12-31 05:10:15 +01:00
# flatpak service.
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.flatpak;
in {
2018-05-11 06:00:44 +02:00
meta = {
doc = ./flatpak.xml;
maintainers = pkgs.flatpak.meta.maintainers;
};
2017-12-31 05:10:15 +01:00
###### interface
options = {
services.flatpak = {
enable = mkEnableOption "flatpak";
};
};
###### implementation
config = mkIf cfg.enable {
assertions = [
{ assertion = (config.xdg.portal.enable == true);
message = "To use Flatpak you must enable XDG Desktop Portals with xdg.portal.enable.";
}
];
2017-12-31 05:10:15 +01:00
environment.systemPackages = [ pkgs.flatpak ];
services.dbus.packages = [ pkgs.flatpak ];
systemd.packages = [ pkgs.flatpak ];
2017-12-31 05:10:15 +01:00
environment.profiles = [
"$HOME/.local/share/flatpak/exports"
"/var/lib/flatpak/exports"
];
2017-12-31 05:10:15 +01:00
};
}