nix-config/modules/nix/flatpak/flatpak.nix
smayzy cacd136ca9
All checks were successful
nix flake show / show-flake (push) Successful in 40s
add server1 and change flatpak to make it works if not defined
2025-08-08 22:00:52 +02:00

79 lines
1.7 KiB
Nix

{ lib, config, ... }:
let
inherit (lib) mkIf mkOption types;
in
{
options.smayzy.flatpak = mkOption {
type = types.submodule {
options = {
enable = mkOption {
type = types.bool;
default = false;
description = "enable flatpak support";
};
gaming.enable = mkOption {
type = types.bool;
default = false;
description = "enable gaming flatpaks";
};
dev.enable = mkOption {
type = types.bool;
default = false;
description = "enable dev flatpaks";
};
utils.enable = mkOption {
type = types.bool;
default = true;
description = "enable utils flatpak";
};
media.enable = mkOption {
type = types.bool;
default = false;
description = "enable media flatpak";
};
};
};
default = {};
};
config = mkIf config.smayzy.flatpak.enable (
let
gaming = [
"com.heroicgameslauncher.hgl"
];
dev = [
"com.google.AndroidStudio"
];
utils = [
"com.usebottles.bottles"
"com.github.tchx84.Flatseal"
"it.mijorus.gearlever"
];
media = [
"com.obsproject.Studio"
];
flatpaks =
(if config.smayzy.flatpak.gaming.enable then gaming else [ ])
++ (if config.smayzy.flatpak.dev.enable then dev else [ ])
++ (if config.smayzy.flatpak.utils.enable then utils else [ ])
++ (if config.smayzy.flatpak.media.enable then media else [ ]);
in
{
services.flatpak = {
enable = true;
update.onActivation = true;
packages = flatpaks;
};
}
);
}