nix-config/modules/nix/flatpak/flatpak.nix
smayzy 092579af98
All checks were successful
nix flake show / show-flake (push) Successful in 27s
format with nixfmt to nixpkgs standarts
2025-07-24 19:19:46 +02:00

74 lines
1.6 KiB
Nix

{ lib, config, ... }:
let
inherit (lib) mkIf mkOption types;
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
{
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";
};
};
};
};
config = mkIf config.smayzy.flatpak.enable {
services.flatpak = {
enable = true;
update.onActivation = true;
packages = flatpaks;
};
};
}