Files
lix/doc/manual/src/quick-start.md
T
Jade Lovelace 748d8310fa Fix the pages in the manual for Lix
This doesn't comprehensively fix everything outdated in the manual, or
make the manual greatly better, but it does note down where at least
jade noticed it was wrong, and it does fix all the instances of
referencing Nix to conform to the style guide to the best of our
ability.

A lot of things have been commented out for being wrong, and there are
three types of FIXME introduced:

- FIXME(Lix): generically Lix needs to fix it
- FIXME(Qyriad): re https://git.lix.systems/lix-project/lix/issues/215
- FIXME(meson): docs got outdated by meson changes and need rewriting

I did fix a bunch of it that I could, but there could certainly be
mistakes and this is definitely just an incremental improvement.

Fixes: https://git.lix.systems/lix-project/lix/issues/266
Change-Id: I5993c4603d7f026a887089fce77db08394362135
2024-05-05 16:11:01 -07:00

3.1 KiB

Quick Start

FIXME(Lix): This chapter is quite outdated with respect to recommended practices in 2024 and needs updating. The commands in here will work, however, and the installation section is up to date.

For more updated guidance, see the links on https://lix.systems/resources/

This chapter is for impatient people who don't like reading documentation. For more in-depth information you are kindly referred to subsequent chapters.

  1. Install Lix:

    On Linux and macOS the easiest way to install Lix is to run the following shell command (as a user other than root):

    $ curl -sSf -L https://install.lix.systems/lix | sh -s -- install
    

    For systems that already have Nix installed, such as NixOS systems, read our install page

    The install script will use sudo, so make sure you have sufficient rights.

    For other installation methods, see here.

  2. See what installable packages are currently available in the channel:

    $ nix-env --query --available --attr-path
    nixpkgs.docbook_xml_dtd_43                    docbook-xml-4.3
    nixpkgs.docbook_xml_dtd_45                    docbook-xml-4.5
    nixpkgs.firefox                               firefox-33.0.2
    nixpkgs.hello                                 hello-2.9
    nixpkgs.libxslt                               libxslt-1.1.28
    
  3. Install some packages from the channel:

    $ nix-env --install --attr nixpkgs.hello
    

    This should download pre-built packages; it should not build them locally (if it does, something went wrong).

  4. Test that they work:

    $ which hello
    /home/eelco/.nix-profile/bin/hello
    $ hello
    Hello, world!
    
  5. Uninstall a package:

    $ nix-env --uninstall hello
    
  6. You can also test a package without installing it:

    $ nix-shell --packages hello
    

    This builds or downloads GNU Hello and its dependencies, then drops you into a Bash shell where the hello command is present, all without affecting your normal environment:

    [nix-shell:~]$ hello
    Hello, world!
    
    [nix-shell:~]$ exit
    
    $ hello
    hello: command not found
    
  7. To keep up-to-date with the channel, do:

    $ nix-channel --update nixpkgs
    $ nix-env --upgrade '*'
    

    The latter command will upgrade each installed package for which there is a “newer” version (as determined by comparing the version numbers).

  8. If you're unhappy with the result of a nix-env action (e.g., an upgraded package turned out not to work properly), you can go back:

    $ nix-env --rollback
    
  9. You should periodically run the Lix garbage collector to get rid of unused packages, since uninstalls or upgrades don't actually delete them:

    $ nix-collect-garbage --delete-old
    

    N.B. on NixOS there is an option nix.gc.automatic to enable a systemd timer to automate this task.