I recently installed NixOS and I ended up with 3 profiles:
- bruno (a user profile),
- default (used by root), and
- system (used by NixOS).
I found it convenient to use a stable channel for the system profile and an unstable channel for me (bruno profile):
~> nix-channel --list
unstable https://nixos.org/channels/nixos-unstable
~> sudo nix-channel --list
nixos https://nixos.org/channels/nixos-17.09
I have then declaratively installed a few packages through /etc/nixos/configuration.nix
:
environment.systemPackages = with pkgs; [
firefox
chromium
htop
# ...
];
And some imperatively: nix-env --install firefox
.
Now listing my installed packages, I'd expect to also see the ones provided by the system profile (as they are available in my user profile):
~> htop --version
htop 2.0.2 - (C) 2004-2016 Hisham Muhammad
Released under the GNU GPL.
~> nix-env -q | grep htop
~> nix-env -q | grep firefox
firefox-57.0
Only Firefox is listed. Let's try using the root profile:
~> sudo nix-env -q | grep htop
Same thing, it's actually completely empty. Maybe using the system profile:
~> sudo nix-env -p /nix/var/nix/profiles/system -q
Still nothing.
Coming from traditional package managers (Debian, Red Hat), I find confusing that Nix being defined as "The Purely Functional Package Manager" does not seem to provide a tool to query packages universally - nix-env
is mentioned throughout the manuals and feels like Debian apt
's alter ego.
Is there such a tool, or is this a non-problem, that is, people are generally fine with not having a list of all packages present across profiles/environments?