NixOS - the purely functional Linux distribution

NixOS - the purely functional Linux distribution

Slides for a lightning talk on NixOS:
- reproducible system configurations using digital signatures
- immutable deployments
- how to detect environment changes using digital signatures
- why NixOS will set you free - upgrade, rollback and test changes without fear that something will break

Be1eff6cc2f4019d28692269ada64123?s=128

lenkodonchev

March 02, 2017
Tweet

Transcript

  1. The purely functional Linux Distribution Lenko Donchev @lenkodonchev

  2. NixOS is a Linux distribution with a unique approach to

    package and configuration management. Built on top of the Nix package manager, it is completely declarative and makes upgrading systems reliable.
  3. NixOS will set you FREE. You will have no fear

    of upgrading because in NixOS an upgrade will not break anything. You will not be afraid to upgrade because rollbacks are easy. If something doesn’t work you can always go back safely and reliably. Reliability is the key.
  4. How does it work? configuration.nix Crypto hash 0cg52ncqn9lajgdy4njma3wk7lf3591d /nix/store/0cg52ncqn9lajgdy4njma3wk7lf3591d -systemd-212.tar

  5. The basic idea /usr/bin/firefox Symbolic link /nix/store/0cg52ncqn9lajg………../bin/firefox

  6. NixOS is similar to GIT

  7. Benefits

  8. Install multiple versions of applications You can have multiple versions

    of the same application installed without any side effects.
  9. No more Dependency HELL Thanks to the crypto hash being

    part of the path to libraries and configuration files there is complete isolation between different application versions.
  10. Reliable upgrades While the configuration remains the same, you can

    upgrade your system safely to always obtain the same result, as if it were a new, fresh installation.
  11. Atomic upgrades Changes in a configuration are made in a

    transactional way, thus they are atomic, and changes are only applied when the transaction is finished. For instance, if an upgrade is interrupted or fails, the previous state continues to work.
  12. Rollbacks You can always rollback to a previous state. This

    is possible because a new configuration never overwrites a previous one. Old installations and configurations are kept simultaneously on the disk. Rolling back to an old configuration is just updating of symbolic links.
  13. Test changes safely Thanks to the rollback capabilities and simultaneous

    configurations, NixOS allows you to test a configuration, and if doesn't work just roll it back without fear that it will break anything.
  14. Reproducible system configurations You can copy a configuration from a

    machine to a similar machine and get the same system. This is ideal for making changes on test machines before applying changes on production machines or for deployments. There is a dedicated tool for reproducible deployments called NixOps.
  15. Mixed model with source and binaries Nix builds packages from

    source or from prebuilt binaries available for download from a cache server.
  16. Consistency When a package or configuration changes, all the necessary

    packages or dependencies are rebuilt too. The same happens with the kernel and the modules . When a library is updated, all the packages that use it are linked to the new version.
  17. Multi-user package management In NixOS, the packages installed with the

    root user are available for all the users, but each user can also install their own packages in their profile. The packages are still stored and managed in the Nix store, and different users can have different versions of the same package. If two users install the same version of the same package, only one copy is stored and shared among them.
  18. Give it a try!