From 0367cc8b5a7d4e6e62ca7c9f429f8a1901194297 Mon Sep 17 00:00:00 2001 From: Izorkin Date: Fri, 3 Mar 2023 16:12:56 +0300 Subject: [PATCH 1/3] nixos/profiles/base: remove duplicate systemPackages --- nixos/modules/profiles/base.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nixos/modules/profiles/base.nix b/nixos/modules/profiles/base.nix index 518a1f8d0b30..4ac1727655cb 100644 --- a/nixos/modules/profiles/base.nix +++ b/nixos/modules/profiles/base.nix @@ -1,5 +1,5 @@ # This module defines the software packages included in the "minimal" -# installation CD. It might be useful elsewhere. +# installation CD. It might be useful elsewhere. { config, lib, pkgs, ... }: @@ -17,7 +17,6 @@ pkgs.ddrescue pkgs.ccrypt pkgs.cryptsetup # needed for dm-crypt volumes - pkgs.mkpasswd # for generating password files # Some text editors. (pkgs.vim.customize { @@ -32,7 +31,6 @@ pkgs.fuse pkgs.fuse3 pkgs.sshfs-fuse - pkgs.rsync pkgs.socat pkgs.screen pkgs.tcpdump From 3e3367aa6a18cf4ec4c79c21f36eec150b3d7939 Mon Sep 17 00:00:00 2001 From: Izorkin Date: Fri, 3 Mar 2023 16:16:31 +0300 Subject: [PATCH 2/3] nixos/profiles/base: remove duplicate and optimize fsPackages --- nixos/modules/profiles/base.nix | 12 ++---------- nixos/modules/tasks/filesystems/vfat.nix | 2 +- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/nixos/modules/profiles/base.nix b/nixos/modules/profiles/base.nix index 4ac1727655cb..9f32f85a61ec 100644 --- a/nixos/modules/profiles/base.nix +++ b/nixos/modules/profiles/base.nix @@ -43,22 +43,14 @@ pkgs.usbutils pkgs.nvme-cli - # Tools to create / manipulate filesystems. - pkgs.ntfsprogs # for resizing NTFS partitions - pkgs.dosfstools - pkgs.mtools - pkgs.xfsprogs.bin - pkgs.jfsutils - pkgs.f2fs-tools - # Some compression/archiver tools. pkgs.unzip pkgs.zip ]; - # Include support for various filesystems. + # Include support for various filesystems and tools to create / manipulate them. boot.supportedFilesystems = - [ "btrfs" "reiserfs" "vfat" "f2fs" "xfs" "ntfs" "cifs" ] ++ + [ "btrfs" "cifs" "f2fs" "jfs" "ntfs" "reiserfs" "vfat" "xfs" ] ++ lib.optional (lib.meta.availableOn pkgs.stdenv.hostPlatform config.boot.zfs.package) "zfs"; # Configure host id for ZFS to work diff --git a/nixos/modules/tasks/filesystems/vfat.nix b/nixos/modules/tasks/filesystems/vfat.nix index 5baab1c802cf..5421b617b43b 100644 --- a/nixos/modules/tasks/filesystems/vfat.nix +++ b/nixos/modules/tasks/filesystems/vfat.nix @@ -11,7 +11,7 @@ in { config = mkIf (any (fs: fs == "vfat") config.boot.supportedFilesystems) { - system.fsPackages = [ pkgs.dosfstools ]; + system.fsPackages = [ pkgs.dosfstools pkgs.mtools ]; boot.initrd.kernelModules = mkIf inInitrd [ "vfat" "nls_cp437" "nls_iso8859-1" ]; From bb5370b8b33570e62347a958e309c0161c271db8 Mon Sep 17 00:00:00 2001 From: Izorkin Date: Sat, 4 Mar 2023 12:08:24 +0300 Subject: [PATCH 3/3] nixos/modules/installer/netboot/netboot-minimal: reduce closure size --- nixos/doc/manual/release-notes/rl-2305.section.md | 2 ++ nixos/modules/installer/netboot/netboot-minimal.nix | 3 +++ 2 files changed, 5 insertions(+) diff --git a/nixos/doc/manual/release-notes/rl-2305.section.md b/nixos/doc/manual/release-notes/rl-2305.section.md index 1fe577822985..5c377f5a7f3a 100644 --- a/nixos/doc/manual/release-notes/rl-2305.section.md +++ b/nixos/doc/manual/release-notes/rl-2305.section.md @@ -183,6 +183,8 @@ In addition to numerous new and upgraded packages, this release has the followin - To reduce closure size in `nixos/modules/profiles/minimal.nix` profile disabled installation documentations and manuals. Also disabled `logrotate` and `udisks2` services. +- To reduce closure size in `nixos/modules/installer/netboot/netboot-minimal.nix` profile disabled load linux firmwares, pre-installing the complete stdenv and `networking.wireless` service. + - The minimal ISO image now uses the `nixos/modules/profiles/minimal.nix` profile. - The `ghcWithPackages` and `ghcWithHoogle` wrappers will now also symlink GHC's diff --git a/nixos/modules/installer/netboot/netboot-minimal.nix b/nixos/modules/installer/netboot/netboot-minimal.nix index 91065d52faf4..5ca255acf35f 100644 --- a/nixos/modules/installer/netboot/netboot-minimal.nix +++ b/nixos/modules/installer/netboot/netboot-minimal.nix @@ -9,4 +9,7 @@ ]; documentation.man.enable = lib.mkOverride 500 true; + hardware.enableRedistributableFirmware = lib.mkOverride 70 false; + system.extraDependencies = lib.mkOverride 70 []; + networking.wireless.enable = lib.mkOverride 500 false; }