From 1e06ca249fc47b31683c2fffc2e613ead3368860 Mon Sep 17 00:00:00 2001 From: Tristan Druyen Date: Mon, 5 Aug 2024 08:42:51 +0200 Subject: [PATCH] Remove kernel specializations - remove all special kernels, including mini-cachyos foo --- systems/nixos-fw16/default.nix | 53 ------ systems/nixos-fw16/mini_kernel.nix | 51 ------ systems/nixos-fw16/modprobed.db | 274 ----------------------------- 3 files changed, 378 deletions(-) delete mode 100644 systems/nixos-fw16/mini_kernel.nix delete mode 100644 systems/nixos-fw16/modprobed.db diff --git a/systems/nixos-fw16/default.nix b/systems/nixos-fw16/default.nix index 7ee777b..a4a4ba1 100644 --- a/systems/nixos-fw16/default.nix +++ b/systems/nixos-fw16/default.nix @@ -80,59 +80,6 @@ }; }; - specialisation.linux-latest.configuration = { - chaotic.scx.enable = lib.mkForce false; - boot.kernelPackages = lib.mkForce pkgs.linuxPackages_latest; - - environment.etc."specialisation".text = "linux-latest"; - system.nixos.tags = [ - "linux-latest" - ]; - }; - - specialisation.linux-zen.configuration = { - chaotic.scx.enable = lib.mkForce false; - boot.kernelPackages = lib.mkForce pkgs.linuxPackages_zen; - - environment.etc."specialisation".text = "linux-zen"; - system.nixos.tags = [ "linux-zen" ]; - }; - - specialisation.linux-xanmod-latest.configuration = { - chaotic.scx.enable = lib.mkForce false; - boot.kernelPackages = lib.mkForce pkgs.linuxPackages_xanmod_latest; - - environment.etc."specialisation".text = "linux-xanmod-latest"; - system.nixos.tags = [ "linux-xanmod-latest" ]; - }; - - specialisation.linux-cachy-mini.configuration = { - boot.kernelPatches = [ - (import ./mini_kernel.nix { - inherit inputs lib; - pkgs = pkgs.pkgsAMD64Microarchs.znver4; - }).patch - ]; - - environment.etc."specialisation".text = "linux-cachy-mini"; - system.nixos.tags = [ "linux-cachy-mini" ]; - }; - - - # specialisation.linux-cachy-mini-lto.configuration = { - # boot.kernelPackages = lib.mkForce pkgs.pkgsAMD64Microarchs.znver4.linuxPackages_cachyos-lto; - # boot.kernelPatches = [ - # (import ./mini_kernel.nix { - # inherit inputs lib; - # pkgs = pkgs.pkgsAMD64Microarchs.znver4; - # }).patch - # ]; - # environment.etc."specialisation".text = "linux-cachy-mini-lto"; - # system.nixos.tags = [ "linux-cachy-mini-lto" ]; - # }; - - - boot = { # kernelPackages = pkgs.linuxPackages_cachyos; # bootstrap kernelPackages = pkgs.pkgsAMD64Microarchs.znver4.linuxPackages_cachyos; diff --git a/systems/nixos-fw16/mini_kernel.nix b/systems/nixos-fw16/mini_kernel.nix deleted file mode 100644 index 283bfcc..0000000 --- a/systems/nixos-fw16/mini_kernel.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ inputs -, lib -, pkgs -, ... -}: -let - mainConfig = import "${inputs.chaotic}/pkgs/linux-cachyos/config-nix/cachyos.x86_64-linux.nix"; - usedModules = builtins.readFile ./modprobed.db; - toLowerParts = list: (lib.lists.unique - (lib.lists.flatten - (builtins.map - (elem: (lib.strings.splitString "_" (lib.strings.toLower elem))) - list))); - usedModuleNames = builtins.map (x: lib.strings.toLower x) (lib.strings.splitString "\n" usedModules); - usedModuleNameParts = toLowerParts usedModuleNames; - filterParts = [ "crypto" "intel" "hid" "drm" "x86" "64" "" ]; - usedModuleNamePartsFiltered = (lib.lists.partition (elem: !(builtins.elem elem filterParts)) usedModuleNameParts).right; - usedModuleNamePartsTrace = builtins.trace usedModuleNameParts usedModuleNamePartsFiltered; - filteredConfig = builtins.listToAttrs ( - builtins.map - (attr: - let - no_conf_key = builtins.replaceStrings [ "CONFIG_" ] [ "" ] attr.name; - in - { - name = attr.name; - value = - if - attr.value - == "m" - && !(builtins.elem (lib.strings.toLower no_conf_key) usedModuleNames) - && ((lib.lists.intersectLists (toLowerParts [ no_conf_key ]) usedModuleNamePartsFiltered) == [ ]) - then "n" - else attr.value; - }) - (builtins.attrValues (builtins.mapAttrs (name: value: { inherit name value; }) mainConfig)) - ); - patchConfigStep1 = lib.attrsets.mapAttrs ((name: value: { - ${builtins.removePrefix "CONFIG_" name} = value; - }) - filteredConfig); - patchConfigFinal = lib.attrsets.filterAttrs ((n: v: v == "n") patchConfigStep1); - patch = { - name = "disable-unused-kmods"; - patch = null; - extraStructuredConfig = patchConfigFinal; - }; -in -{ - patch = patch; -} diff --git a/systems/nixos-fw16/modprobed.db b/systems/nixos-fw16/modprobed.db deleted file mode 100644 index 805c1dd..0000000 --- a/systems/nixos-fw16/modprobed.db +++ /dev/null @@ -1,274 +0,0 @@ -ac97_bus -adiantum -aesni_intel -af_alg -algif_hash -algif_skcipher -amd_atl -amdgpu -amd_pmc -amd_pmf -amd_sfh -amdtee -amdxcp -asn1_encoder -atkbd -bcachefs -blowfish_common -blowfish_generic -blowfish_x86_64 -bluetooth -bnep -bridge -br_netfilter -btbcm -btintel -btmtk -btrtl -btusb -camellia_aesni_avx2 -camellia_aesni_avx_x86_64 -camellia_generic -camellia_x86_64 -cast5_avx_x86_64 -cast5_generic -cast_common -cbc -ccp -cdc_acm -cdc_ether -cdc_mbim -cdc_ncm -cdc_wdm -cec -cfg80211 -chacha_x86_64 -cifs -cifs_arc4 -cifs_md4 -cmac -crc16 -crc32c_generic -crc32c_intel -crc32_pclmul -crct10dif_pclmul -cros_ec -cros_ec_chardev -cros_ec_debugfs -cros_ec_dev -cros_ec_lpcs -cros_ec_sysfs -cros_usbpd_charger -cros_usbpd_logger -cros_usbpd_notify -cryptd -crypto_simd -curve25519_x86_64 -des3_ede_x86_64 -des_generic -dimlib -dm_crypt -dm_mod -dns_resolver -drm_buddy -drm_display_helper -drm_exec -drm_suballoc_helper -drm_ttm_helper -encrypted_keys -fat -framework_laptop -gf128mul -ghash_clmulni_intel -gpio_cros_ec -gpu_sched -hid_generic -hid_multitouch -hid_sensor_als -hid_sensor_hub -hid_sensor_iio_common -hid_sensor_trigger -i2c_algo_bit -i2c_dev -i2c_hid -i2c_hid_acpi -i2c_piix4 -ib_cm -ib_core -industrialio -industrialio_triggered_buffer -inet_diag -intel_rapl_common -intel_rapl_msr -ip6t_rpfilter -ip6_udp_tunnel -ip_tables -ipt_REJECT -ipt_rpfilter -iw_cm -joydev -k10temp -kfifo_buf -kvm -kvm_amd -libarc4 -libchacha -libchacha20poly1305 -libcrc32c -libcurve25519_generic -libdes -libpoly1305 -libps2 -llc -loop -lrw -lz4_compress -lz4hc_compress -mac80211 -mac_hid -macvlan -mii -mousedev -mt76 -mt76_connac_lib -mt7921_common -mt7921e -mt792x_lib -netfs -nf_conntrack -nf_conntrack_broadcast -nf_conntrack_netbios_ns -nf_conntrack_netlink -nf_defrag_ipv4 -nf_defrag_ipv6 -nf_log_syslog -nf_nat -nfnetlink -nf_reject_ipv4 -nf_tables -nft_chain_nat -nft_compat -nhpoly1305 -nhpoly1305_avx2 -nhpoly1305_sse2 -nls_iso8859_1 -nls_ucs2_utils -nls_utf8 -nvme -nvme_auth -nvme_core -overlay -platform_profile -poly1305_x86_64 -polyval_clmulni -polyval_generic -qrtr -raid6_pq -rapl -rdma_cm -rfcomm -rfkill -roles -ryzen_smu -sch_fq_codel -serio -serpent_avx2 -serpent_avx_x86_64 -serpent_generic -serpent_sse2_x86_64 -sha1_ssse3 -sha256_ssse3 -sha512_ssse3 -snd -snd_acp_config -snd_acp_legacy_common -snd_acp_pci -snd_amd_sdw_acpi -snd_compress -snd_hda_codec -snd_hda_codec_generic -snd_hda_codec_hdmi -snd_hda_codec_realtek -snd_hda_core -snd_hda_intel -snd_hda_scodec_component -snd_hrtimer -snd_hwdep -snd_intel_dspcfg -snd_intel_sdw_acpi -snd_pci_acp3x -snd_pci_acp5x -snd_pci_acp6x -snd_pci_ps -snd_pcm -snd_pcm_dmaengine -snd_rn_pci_acp3x -snd_rpl_pci_acp6x -snd_seq -snd_seq_device -snd_seq_dummy -snd_soc_acpi -snd_soc_core -snd_sof -snd_sof_amd_acp -snd_sof_amd_acp63 -snd_sof_amd_rembrandt -snd_sof_amd_renoir -snd_sof_amd_vangogh -snd_sof_pci -snd_sof_utils -snd_sof_xtensa_dsp -snd_timer -soundcore -soundwire_amd -soundwire_bus -soundwire_generic_allocation -sp5100_tco -stp -tap -tcp_diag -tee -thunderbolt -trusted -ttm -tun -twofish_avx_x86_64 -twofish_common -twofish_generic -twofish_x86_64 -twofish_x86_64_3way -typec -typec_displayport -typec_ucsi -uas -ucsi_acpi -udp_tunnel -uinput -usbhid -usbnet -usb_storage -veth -vfat -video -vivaldi_fmap -wireguard -wmi -wmi_bmof -xfrm_algo -xfrm_user -xhci_pci -xhci_pci_renesas -xor -x_tables -xt_addrtype -xt_CHECKSUM -xt_conntrack -xt_CT -xt_LOG -xt_mark -xt_MASQUERADE -xt_nat -xt_pkttype -xts -xt_tcpudp -zram