cross: tune linuxMinimal

This commit is contained in:
2023-08-11 23:25:26 +00:00
parent 8089334ea9
commit dd53de96fe

View File

@@ -67,52 +67,53 @@ let
}; };
emulated = mkEmulated final prev; emulated = mkEmulated final prev;
# linuxMinimal = final.linux.override { linuxMinimal = final.linux.override {
# # customize stock linux to compile using less RAM # customize stock linux to compile using fewer resources.
# # default config is in: # on desko, takes 24 min v.s. 35~40 min for linux-megous
# # - <pkgs/os-specific/linux/kernel/common-config.nix> # default config is in:
# structuredExtraConfig = with lib.kernel; { # - <pkgs/os-specific/linux/kernel/common-config.nix>
# # recommended by: <https://nixos.wiki/wiki/Linux_kernel#Too_high_ram_usage> # documentation per config option is found with, for example:
# DEBUG_INFO_BTF = lib.mkForce no; # - `fd Kconfig . | xargs rg 'config SUNRPC_DEBUG'`
structuredExtraConfig = with lib.kernel; {
# recommended by: <https://nixos.wiki/wiki/Linux_kernel#Too_high_ram_usage>
DEBUG_INFO_BTF = lib.mkForce no;
# # other debug-related things i can probably disable # other debug-related things i can probably disable
# CC_OPTIMIZE_FOR_SIZE = lib.mkForce yes; CC_OPTIMIZE_FOR_SIZE = lib.mkForce yes;
# DEBUG_INFO = lib.mkForce no; DEBUG_INFO = lib.mkForce no;
# DEBUG_KERNEL = lib.mkForce no; DEBUG_KERNEL = lib.mkForce no;
# GDB_SCRIPTS = lib.mkForce no; GDB_SCRIPTS = lib.mkForce no;
# SCHED_DEBUG = lib.mkForce no; SCHED_DEBUG = lib.mkForce no;
# SUNRPC_DEBUG = lib.mkForce no; SUNRPC_DEBUG = lib.mkForce no;
# # disable un-needed features # disable un-needed features
# BT = no; BT = no;
# CAN = no; CAN = no;
# DRM = no; # uses a lot of space when compiling DRM = no; # uses a lot of space when compiling
# FPGA = no; FPGA = no;
# GNSS = no; GNSS = no;
# IIO = no; # 500 MB IIO = no; # 500 MB
# INPUT_TOUCHSCREEN = no; INPUT_TOUCHSCREEN = no;
# MEDIA_SDR_SUPPORT = no; MEDIA_SDR_SUPPORT = no;
# NFC = no; NFC = no;
# SND = no; # also uses a lot of disk space when compiling SND = no; # also uses a lot of disk space when compiling
# SOUND = no; SOUND = no;
# # WWAN = no; # 1.4 GB (drivers/net/wireless) (but WWAN=no doesn't actually disable that?) WAN = no; # X.25 protocol support
WIRELESS = no; # 1.4 GB (drivers/net/wireless), doesn't actually disable this
# # we could try disabling these, but i wonder if anything relies on them (e.g. autoconf) WWAN = no; # Wireless WAN
# # FONTS = lib.mkForce no; # disable features nixos explicitly enables, which we still don't need
# # FB = lib.mkForce no; FONTS = lib.mkForce no;
# # WAN = lib.mkForce no; FB = lib.mkForce no;
# # INET = no; # INET = no; # TCP/IP. `INET` means "IP network" (even when used on a LAN), not "Internet"
# # MEMTEST = lib.mkForce no; MEMTEST = lib.mkForce no;
# # # NET = lib.mkForce no; # we need net (9pnet_virtio; unix) for sharing fs with the build machine # # NET = lib.mkForce no; # we need net (9pnet_virtio; unix) for sharing fs with the build machine
# MEDIA_ANALOG_TV_SUPPORT = lib.mkForce no; MEDIA_ANALOG_TV_SUPPORT = lib.mkForce no;
# MEDIA_CAMERA_SUPPORT = lib.mkForce no; MEDIA_CAMERA_SUPPORT = lib.mkForce no;
# MEDIA_DIGITAL_TV_SUPPORT = lib.mkForce no; # 150 MB disk space when compiling MEDIA_DIGITAL_TV_SUPPORT = lib.mkForce no; # 150 MB disk space when compiling
# MICROCODE = lib.mkForce no; MICROCODE = lib.mkForce no;
# STAGING = lib.mkForce no; # 450 MB disk space when compiling STAGING = lib.mkForce no; # 450 MB disk space when compiling
};
# RTC_DRV_CMOS = yes; # something in the above config changes disabled this... };
# };
# };
# given a package that's defined for build == host, # given a package that's defined for build == host,
# build it from the native build machine by emulating the builder. # build it from the native build machine by emulating the builder.
emulateBuilderQemu = pkg: let emulateBuilderQemu = pkg: let