modularize flatpaks
All checks were successful
nix flake show / show-flake (push) Successful in 29s

This commit is contained in:
smayzy 2025-07-20 16:16:40 +02:00
parent 57a949c2bf
commit 4a049d94ce
7 changed files with 91 additions and 25 deletions

View File

@ -41,18 +41,4 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
]; ];
services.flatpak = {
enable = true;
update.onActivation = true;
packages = [
"com.heroicgameslauncher.hgl"
"com.github.tchx84.Flatseal"
"com.obsproject.Studio"
"com.usebottles.bottles"
"it.mijorus.gearlever"
"com.google.AndroidStudio"
];
};
} }

View File

@ -31,15 +31,4 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
]; ];
services.flatpak = {
enable = true;
update.onActivation = true;
packages = [
"com.github.tchx84.Flatseal"
"com.usebottles.bottles"
"it.mijorus.gearlever"
"com.google.AndroidStudio"
];
};
} }

View File

@ -17,6 +17,7 @@
./displaymanager ./displaymanager
./vpn ./vpn
./utilities ./utilities
./flatpak
]; ];
# Timzone and locales (same for all machines so I put it here) # Timzone and locales (same for all machines so I put it here)

View File

@ -0,0 +1,6 @@
{ lib, config, pkgs, ... }:
{
imports = [
./flatpak.nix
];
}

View File

@ -0,0 +1,73 @@
{ lib, config, pkgs, ... }:
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;
};
};
}

View File

@ -33,6 +33,12 @@ in
blender.enable = true; blender.enable = true;
inkscape.enable = true; inkscape.enable = true;
komikku.enable = true; komikku.enable = true;
flatpak = {
enable = true;
media = true;
dev = true;
gaming = true;
};
}; };
}; };
} }

View File

@ -32,6 +32,11 @@ in
thunderbird.enable = true; thunderbird.enable = true;
inkscape.enable = true; inkscape.enable = true;
komikku.enable = true; komikku.enable = true;
flatpak = {
enable = true;
dev.enable = true;
media.enable = true;
};
}; };
services.logind.lidSwitch = "ignore"; services.logind.lidSwitch = "ignore";
}; };