nixos/global/flatpak/default.nix

18 lines
422 B
Nix

{ pkgs
, lib
, config
, ... }: with lib; let
cfg = config.global.flatpak;
in {
options.global.flatpak = {
enable = mkEnableOption "flatpak sandbox";
};
config = mkIf cfg.enable {
services.flatpak.enable = true;
xdg.portal.enable = true;
users.home.persist.directories = [ ".local/share/flatpak" ".var" ];
environment.persistence."/nix/persist/fhs".directories = [ "/var/lib/flatpak" ];
};
}