Split packages into includes and excludes

Packages can still be excluded with the include list by prefixing
with "-", this is discouraged.
This commit is contained in:
Ehmry - 2022-06-23 09:40:29 -05:00
parent 6243c33736
commit 6ba2d4800f
4 changed files with 19 additions and 9 deletions

View File

@ -38,7 +38,7 @@ let
# add package to include in the image, ie. packages that you don't
# want to install manually later
packages = [ "tcpdump" ];
packages.include = [ "tcpdump" ];
services.disabled = [ "dnsmasq" ];
@ -80,7 +80,7 @@ in sys.config.system.build.image
# add package to include in the image, ie. packages that you don't
# want to install manually later
packages = [ "tcpdump" ];
packages.include = [ "tcpdump" ];
services.disabled = [ "dnsmasq" ];

View File

@ -3,7 +3,7 @@
{
system.profile = "avm_fritz7412";
packages = [ "tcpdump" "vxlan" "kmod-vxlan" ];
packages.include = [ "tcpdump" "vxlan" "kmod-vxlan" ];
files = pkgs.runCommandNoCC "image-files" { } ''
mkdir -p $out/etc/uci-defaults

View File

@ -4,7 +4,9 @@
system.build.image = import ../../builder.nix {
inherit pkgs;
inherit (config.system) release target variant profile;
inherit (config) packages files;
inherit (config) files;
packages = config.packages.include
++ map (x: "-${x}") config.packages.exclude;
disabledServices = config.services.disabled;
};
}

View File

@ -1,10 +1,18 @@
{ lib, ... }:
{
options.packages = with lib; mkOption {
type = with types; listOf str;
default = [ ];
example = [ "tcpdump" "vxlan" "kmod-vxlan" ];
description = "Extra OpenWRT packages (can be prefixed with "-").";
options.packages = with lib; {
include = mkOption {
type = with types; listOf str;
default = [ ];
example = [ "tcpdump" "vxlan" "kmod-vxlan" ];
description = "Extra OpenWRT packages (can be prefixed with " - ").";
};
exclude = mkOption {
type = with types; listOf str;
default = [ ];
example = [ "vi" ];
description = "OpenWRT packages to be excluded.";
};
};
}