Hello,
I want to optimize my nixos build as I am running it of a flash medium and the less it weighs, the longer it’ll live.
Querying packages
I have started with querying all installed packages. However, I get different counts depending on which method I use:
[root@S720:/etc/nixos]# nix-store -q --requisites /run/current-system | wc -l
973
[root@S720:/etc/nixos]# neofetch | grep Pack
Packages: 641 (nix-system)
Why does that happen?
Debloat
I wanted to remove all wireless capabilities and the sound server.
For the benchmarks I am using bluez
, wpa_supplicant
and pipewire
.
I have tried playing around with the config and I cannot seem to turn them off…
I do not get any conficting statements in my config, the default is <i-dont-want-this>.enable = false;
and still I have the unnescessary packages:
# nix-store -q --requisites /run/current-system | grep -P "wpa|bluez|pipe"
/nix/store/j6mwswpa6zqhdm1lm2lv9iix3arn774g-glibc-2.38-27
/nix/store/dp9qpfqm080qhisnfrmwbhv34g1azys6-bluez-5.70
/nix/store/34p1ibgfjihkf5gbfbrq62qgyaf8pmq7-pipewire-1.0.1
/nix/store/qxv3raf90syc7v0av1q6h6jhxhnh8v3c-wpa_supplicant-2.10
/nix/store/llg80dgdc9bnx15i36iyx7ivp598vx7g-libpipeline-1.5.7
/nix/store/ahv1bgr56k1jmjzak8cijyrfvq5q5q14-lesspipe-2.10
Querying package details
On Arch-based distros there is pacman --query --info <package>
, which work something like this:
$ pacman -Qi bluez
Name : bluez
Version : 5.72-2
Description : Daemons for the bluetooth protocol stack
Architecture : x86_64
URL : http://www.bluez.org/
Licenses : GPL-2.0-only
Groups : None
Provides : None
Depends On : dbus glib2 alsa-lib glibc
Optional Deps : None
Required By : fwupd
Optional For : networkmanager
Conflicts With : None
Replaces : None
Here I can clearly see the dependencies and what requires this package.
I have read man nix-store-query
and I still am not sure what flags will accomplish that.
Can somebody help me figure this out?