mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-04 06:42:33 +03:00
Merge master into staging-next
This commit is contained in:
commit
7ab9f25c4a
81 changed files with 530 additions and 19014 deletions
|
@ -61,14 +61,6 @@ let
|
|||
// lib.optionalAttrs (cfg.database.type == "mysql") {
|
||||
withMySQL = true;
|
||||
}
|
||||
// lib.optionalAttrs (lib.isAttrs cfg.minifyStaticFiles) (
|
||||
with cfg.minifyStaticFiles;
|
||||
{
|
||||
esbuild = esbuild.package;
|
||||
lightningcss = lightningcss.package;
|
||||
scour = scour.package;
|
||||
}
|
||||
)
|
||||
);
|
||||
in
|
||||
p.overrideAttrs (
|
||||
|
@ -258,18 +250,21 @@ in
|
|||
};
|
||||
|
||||
minifyStaticFiles = mkOption {
|
||||
type =
|
||||
with types;
|
||||
either bool (submodule {
|
||||
type = types.either types.bool (
|
||||
types.submodule {
|
||||
options = {
|
||||
script = mkOption {
|
||||
type = types.submodule {
|
||||
options = {
|
||||
enable = mkEnableOption "Script minification";
|
||||
package = mkPackageOption pkgs "esbuild" { };
|
||||
enable = mkEnableOption "Script minification via esbuild";
|
||||
target = mkOption {
|
||||
type = with types; nullOr nonEmptyStr;
|
||||
type = types.nullOr types.nonEmptyStr;
|
||||
default = null;
|
||||
description = ''
|
||||
esbuild target environment string. If not set, a sane
|
||||
default will be provided. See:
|
||||
<https://esbuild.github.io/api/#target>.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -277,11 +272,15 @@ in
|
|||
style = mkOption {
|
||||
type = types.submodule {
|
||||
options = {
|
||||
enable = mkEnableOption "Script minification";
|
||||
package = mkPackageOption pkgs "lightningcss" { };
|
||||
enable = mkEnableOption "Script minification via Lightning CSS";
|
||||
target = mkOption {
|
||||
type = with types; nullOr nonEmptyStr;
|
||||
type = types.nullOr types.nonEmptyStr;
|
||||
default = null;
|
||||
description = ''
|
||||
Browserslists string target for browser compatibility.
|
||||
If not set, a sane default will be provided. See:
|
||||
<https://browsersl.ist>.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -289,15 +288,34 @@ in
|
|||
svg = mkOption {
|
||||
type = types.submodule {
|
||||
options = {
|
||||
enable = mkEnableOption "SVG minification";
|
||||
package = mkPackageOption pkgs "scour" { };
|
||||
enable = mkEnableOption "SVG minification via Scour";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
}
|
||||
);
|
||||
default = true;
|
||||
description = "Do minification on public static files";
|
||||
description = ''
|
||||
Do minification on public static files which reduces the size of
|
||||
assets — saving data for the server & users as well as offering a
|
||||
performance improvement. This adds typing for the `minifyStaticFiles`
|
||||
attribute for the Movim package which *will* override any existing
|
||||
override value. The default `true` will enable minification for all
|
||||
supported asset types with sane defaults.
|
||||
'';
|
||||
example =
|
||||
lib.literalExpression # nix
|
||||
''
|
||||
{
|
||||
script.enable = false;
|
||||
style = {
|
||||
enable = true;
|
||||
target = "> 0.5%, last 2 versions, Firefox ESR, not dead";
|
||||
};
|
||||
svg.enable = true;
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
precompressStaticFiles = mkOption {
|
||||
|
@ -818,4 +836,16 @@ in
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
(lib.mkRemovedOptionModule [ "minifyStaticFiles" "script" "package" ] ''
|
||||
Override services.movim.package instead.
|
||||
'')
|
||||
(lib.mkRemovedOptionModule [ "minifyStaticFiles" "style" "package" ] ''
|
||||
Override services.movim.package instead.
|
||||
'')
|
||||
(lib.mkRemovedOptionModule [ "minifyStaticFiles" "svg" "package" ] ''
|
||||
Override services.movim.package instead.
|
||||
'')
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue