nixpkgs/nixos/modules/services/desktops/flatpak.nix
pennae 0a6e6cf7e6 nixos/manual: render module chapters with nixos-render-docs
this converts meta.doc into an md pointer, not an xml pointer. since we
no longer need xml for manual chapters we can also remove support for
manual chapters from md-to-db.sh

since pandoc converts smart quotes to docbook quote elements and our
nixos-render-docs does not we lose this distinction in the rendered
output. that's probably not that bad, our stylesheet didn't make use of
this anyway (and pre-23.05 versions of the chapters didn't use quote
elements either).

also updates the nixpkgs manual to clarify that option docs support all
extensions (although it doesn't support headings at all, so heading
anchors don't work by extension).
2023-01-27 20:07:34 +01:00

57 lines
1.1 KiB
Nix

# flatpak service.
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.flatpak;
in {
meta = {
doc = ./flatpak.md;
maintainers = pkgs.flatpak.meta.maintainers;
};
###### interface
options = {
services.flatpak = {
enable = mkEnableOption (lib.mdDoc "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.";
}
];
environment.systemPackages = [ pkgs.flatpak ];
security.polkit.enable = true;
services.dbus.packages = [ pkgs.flatpak ];
systemd.packages = [ pkgs.flatpak ];
environment.profiles = [
"$HOME/.local/share/flatpak/exports"
"/var/lib/flatpak/exports"
];
# It has been possible since https://github.com/flatpak/flatpak/releases/tag/1.3.2
# to build a SELinux policy module.
# TODO: use sysusers.d
users.users.flatpak = {
description = "Flatpak system helper";
group = "flatpak";
isSystemUser = true;
};
users.groups.flatpak = { };
};
}