4 ms·
The author is probably clueless, not dishonest, in this particular mistake, but the Nix/NixOS installation command used is the slow one. Nix doesn't have versio
by lidHanteyk 7y ago
The author is probably clueless, not dishonest, in this particular mistake, but the Nix/NixOS installation command used is the slow one. Nix doesn't have versions for packages in the traditional sense. A fairer pair of test commands:
nix-env -iA nixpkgs.ack
nix-env -iA nixpkgs.qemu
This is because Nix considers an entire tree of Nix expressions at once, rather than examining each package in isolation. When nix-env is run without the -A flag, it must evaluate the entirety of nixpkgs and then search for the desired package amongst the complete tree. With -A instead, it is possible to evaluate only the portions of the tree which are relevant to the named package.
- tln 7y agoYeah, this is much speedier! On my machine, for the original command I get: created 56 symlinks in user environment real 0m 25.64s For your command I get: created 56 symlinks in user environment real 0m 4.39s
- Sean1708 7y agoTo be fair `nix-channel --update` does take a ridiculously long time: $ time nix-channel --update unpacking channels... created 2 symlinks in user environment nix-channel --update 1.92s user 16.58s system 15% cpu 1:56.62 total $ time nix-env -iA nixpkgs.ack installing 'perl5.28.2-ack-3.0.2' these paths will be fetched (0.06 MiB download, 0.19 MiB unpacked): /nix/store/43rvd2kinid0g48ng07d782dsqb497g1-perl5.28.2-ack-3.0.2 /nix/store/k3f819h2ncadkd6g8yzyzg24wn3vr609-perl5.28.2-ack-3.0.2-man /nix/store/p82srjihmh7vnq4szl9q83adcl9r6j2v-perl5.28.2-File-Next-1.16 copying path '/nix/store/k3f819h2ncadkd6g8yzyzg24wn3vr609-perl5.28.2-ack-3.0.2-man' from 'https://cache.nixos.org'... copying path '/nix/store/p82srjihmh7vnq4szl9q83adcl9r6j2v-perl5.28.2-File-Next-1.16' from 'https://cache.nixos.org'... copying path '/nix/store/43rvd2kinid0g48ng07d782dsqb497g1-perl5.28.2-ack-3.0.2' from 'https://cache.nixos.org'... building '/nix/store/p765c3dxn32zccl4q9xjgr74n2ljgiky-user-environment.drv'... created 134 symlinks in user environment nix-env -iA nixpkgs.ack 0.19s user 0.24s system 36% cpu 1.158 total