News for hackers. Stuff that matters.
Re:Apple Unveils MacBook Pro Featuring M2 Pro and M2 Max by kitsunesoba on Tuesday January 17, 2023 @11:57AM (#34414977)
Can I just do “nix install foo”? I looked into nix ages ago but opening a text file any time I wanted to install some random package just felt too weird.
Re:Apple Unveils MacBook Pro Featuring M2 Pro and M2 Max by rgrmrts on Tuesday January 17, 2023 @02:13PM (#34417206)
Yes! (kind of, I wish `nix install` was a thing)

    # search for a package called `foo`
    nix search nixpkgs foo
    # install package foo, user-wide
    nix-env -i foo
The CLI UX can get better, and I'm fairly sure folks are working on it.

You can also test-drive a package without committing to it, e.g. you want to try the program `cowsay` but only want to use it once:

    nix-shell -p cowsay
    cowsay
    exit
This spawns a new shell with `cowsay` available, and after you exit it won't be cluttering your system packages.