{
  pkgs,
  inputs,
  config,
  lib,
  ...
}: let
  cfg = config.system.flatpak;
in {
  options.system.flatpak = {
    enable = lib.mkEnableOption "enables nix-flatpak on nixos side";
  };

  imports = [inputs.nix-flatpak.nixosModules.nix-flatpak];

  config = lib.mkIf cfg.enable {
    services.flatpak.enable = true;
  };
}
