1
0
Fork 0
nix-configuration/modules/ui/flatpak.nix

56 lines
1.3 KiB
Nix
Raw Normal View History

{
nix-flatpak,
pkgs,
config,
lib,
...
}:
2024-02-29 09:53:34 -05:00
# Flatpak support and options
let
cfg = config.aux.system.ui.flatpak;
2024-02-29 09:53:34 -05:00
in
with lib;
{
options = {
aux.system.ui.flatpak = {
enable = mkEnableOption (mdDoc "Enables Flatpak support.");
packages = lib.mkOption {
description = "Flatpak packages to install.";
type = lib.types.listOf lib.types.str;
default = [ ];
example = lib.literalExpression "[ \"com.valvesoftware.Steam\" ]";
};
2024-06-25 14:13:15 -04:00
remotes = lib.mkOption {
description = "The list of remote Flatpak repos to pull from. Includes Flathub by default.";
type = lib.types.listOf lib.types.attrs;
default = [
{
name = "flathub";
location = "https://dl.flathub.org/repo/flathub.flatpakrepo";
}
];
};
};
};
2024-02-29 09:53:34 -05:00
config = mkIf cfg.enable {
# Enable Flatpak
services.flatpak = {
enable = true;
2024-02-29 09:53:34 -05:00
# Manage all Flatpak packages and remotes
uninstallUnmanaged = true;
2024-02-29 15:07:39 -05:00
# Enable automatic updates alongside nixos-rebuild
update.onActivation = true;
2024-02-29 09:53:34 -05:00
# Add remote(s)
2024-06-25 14:13:15 -04:00
remotes = cfg.remotes;
2024-02-29 09:53:34 -05:00
# Install base Flatpaks. For details, see https://github.com/gmodena/nix-flatpak
packages = cfg.packages;
};
};
2024-02-29 09:53:34 -05:00
}