linted
This commit is contained in:
atagen 2025-02-02 16:57:31 +11:00
parent 4e99a0e323
commit 7485de646a
95 changed files with 2743 additions and 2282 deletions

View file

@ -2,62 +2,60 @@
config,
lib,
...
}: let
}:
let
inherit (lib) mkOption;
inherit (builtins) typeOf listToAttrs;
in {
in
{
options.flatpaks = mkOption {
default = [];
type = with lib.types;
listOf (either str (submodule {
options = {
name = mkOption {
type = str;
default = [ ];
type =
with lib.types;
listOf (
either str (submodule {
options = {
name = mkOption {
type = str;
};
overrides = mkOption {
type = attrsOf (attrsOf (either str (listOf str)));
default = { };
};
};
overrides = mkOption {
type = attrsOf (attrsOf (either str (listOf str)));
default = {};
};
};
}));
})
);
};
config.services.flatpak = let
userOverrides = listToAttrs (
map (
fp:
if (typeOf fp == "string")
then {
name = fp;
value = {};
}
else {
inherit (fp) name;
value = fp.overrides;
}
)
config.flatpaks
);
in {
enable = true;
uninstallUnmanaged = true;
update.auto.enable = true;
packages =
map (
fp:
if (typeOf fp == "set")
then fp.name
else fp
)
config.flatpaks;
overrides =
userOverrides
// {
config.services.flatpak =
let
userOverrides = listToAttrs (
map (
fp:
if (typeOf fp == "string") then
{
name = fp;
value = { };
}
else
{
inherit (fp) name;
value = fp.overrides;
}
) config.flatpaks
);
in
{
enable = true;
uninstallUnmanaged = true;
update.auto.enable = true;
packages = map (fp: if (typeOf fp == "set") then fp.name else fp) config.flatpaks;
overrides = userOverrides // {
global = {
Context.sockets = ["wayland"];
Context.sockets = [ "wayland" ];
Environment = {
ELECTRON_OZONE_PLATFORM_HINT = "auto";
};
};
};
};
};
}