Skip to content

Commit 99d6bc2

Browse files
committed
remove some extra weight
1 parent 87f8fb0 commit 99d6bc2

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

nix/installer.nix

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,57 @@
1111
}).latestCompatibleLinuxPackages;
1212
boot.zfs.removeLinuxDRM = lib.mkDefault pkgs.hostPlatform.isAarch64;
1313

14-
documentation.enable = false;
14+
documentation.enable = lib.mkForce false;
15+
16+
# reduce closure size through package set crafting
17+
# where there's no otherwise globally effective
18+
# config setting available
19+
# TODO: some are candidates for a long-term upstream solution
20+
nixpkgs.overlays = [
21+
(final: prev: {
22+
# save ~12MB by not bundling manpages
23+
coreutils-full = prev.coreutils;
24+
# we don't need grub: save ~ 60MB
25+
grub2 = prev.coreutils;
26+
grub2_efi = prev.coreutils;
27+
# save ~20MB by making them minimal
28+
util-linux = prev.util-linux.override {
29+
nlsSupport = false;
30+
ncursesSupport = false;
31+
systemdSupport = false;
32+
translateManpages = false;
33+
};
34+
# save ~6MB by removing one bash
35+
bashInteractive = prev.bash;
36+
# saves ~25MB
37+
systemd = prev.systemd.override {
38+
pname = "systemd-slim";
39+
withDocumentation = false;
40+
withCoredump = false;
41+
withFido2 = false;
42+
withRepart = false;
43+
withMachined = false;
44+
withRemote = false;
45+
withTpm2Tss = false;
46+
withLibBPF = false;
47+
withAudit = false;
48+
withCompression = false;
49+
withImportd = false;
50+
withPortabled = false;
51+
};
52+
})
53+
];
54+
systemd.coredump.enable = false;
55+
1556

1657
environment.systemPackages = [
1758
# for zapping of disko
1859
pkgs.jq
1960
# for copying extra files of nixos-anywhere
2061
pkgs.rsync
62+
# for installing nixos via nixos-anywhere
63+
config.system.build.nixos-enter
64+
config.system.build.nixos-install
2165
];
2266

2367
imports = [

nix/noninteractive.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121

2222
# would pull in nano
2323
programs.nano.syntaxHighlight = lib.mkForce false;
24+
programs.nano.enable = false;
25+
26+
documentation.man.man-db.enable = false;
2427

2528
# prevents nano, strace
2629
environment.defaultPackages = lib.mkForce [

0 commit comments

Comments
 (0)