NixOS: a purely functional Linux distribution

Existing package and system configuration management tools suffer from an imperative model, where system administration actions such as upgrading packages or changes to system configuration files are stateful: they destructively update the state of the system. This leads to many problems, such as the inability to roll back changes easily, to run multiple versions of a package side-by-side, to reproduce a configuration deterministically on another machine, or to reliably upgrade a system. In this paper we show that we can overcome these problems by moving to a purely functional system configuration model. This means that all static parts of a system (such as software packages, configuration files and system startup scripts) are built by pure functions and are immutable, stored in a way analogously to a heap in a purely function language. We have implemented this model in NixOS, a non-trivial Linux distribution that uses the Nix package manager to build the entire system configuration from a purely functional specification.

[1]  Eelco Dolstra Secure sharing between untrusted users in a transparent source/binary deployment model , 2005, ASE '05.

[2]  Mark Burgess,et al.  A Site Configuration Engine , 1995, Comput. Syst..

[3]  John DeTreville Making System Configuration More Declarative , 2005, HotOS.

[4]  Paul Hudak,et al.  Conception, evolution, and application of functional programming languages , 1989, CSUR.

[5]  Mark P. Jones,et al.  A principled approach to operating system construction in Haskell , 2005, ICFP '05.

[6]  Eric Foster-Johnson Red Hat RPM guide , 2002 .

[7]  Steve Traugott,et al.  Why Order Matters: Turing Equivalence in Automated Systems Administration , 2002, LISA.

[8]  Merijn de Jonge,et al.  Imposing a memory management discipline on software deployment , 2004, Proceedings. 26th International Conference on Software Engineering.

[9]  David Fox,et al.  Experience report: using functional programming to manage a linux distribution , 2007, ICFP '07.

[10]  Geoffrey Clemm The Odin System , 1995, SCM.

[11]  Anthony M. Sloane,et al.  Post-design domain-specific language embedding: a case study in the software engineering domain , 2002, Proceedings of the 35th Annual Hawaii International Conference on System Sciences.

[12]  Eelco Dolstra,et al.  Maximal Laziness: An Efficient Interpretation Technique for Purely Functional DSLs , 2009, LDTA.

[13]  Peyton Jones,et al.  Haskell 98 language and libraries : the revised report , 2003 .

[14]  Eelco Dolstra,et al.  The purely functional software deployment model , 2006 .

[15]  Roberto Di Cosmo,et al.  HotSWUp '08 Proceedings of the 1st International Workshop on Hot Topics in Software Upgrades , 2008 .

[16]  Simon L. Peyton Jones,et al.  Implementing lazy functional languages on stock hardware: the Spineless Tagless G-machine , 1992, Journal of Functional Programming.

[17]  Craig A. Knoblock,et al.  Advanced Programming in the UNIX Environment , 1992, Addison-Wesley professional computing series.

[18]  Geoffrey Michael Clemm The Odin system: an object manager for extensible software environments , 1986 .

[19]  Allan Heydon,et al.  The Vesta Approach to Software Configuration Management , 2001 .

[20]  Luke Kanies ISconf: Theory, Practice, and Beyond , 2003, LISA.

[21]  W. Richard Stevens,et al.  Advanced Programming in the UNIX Environment, Second Edition , 2008 .

[22]  Marshall K. McKusick,et al.  Union Mounts in 4.4BSD-Lite , 1995, USENIX.

[23]  John Hart,et al.  An Analysis of RPM Validation Drift , 2002, LISA.

[24]  Allan Heydon,et al.  Caching function calls using precise dependencies , 2000, PLDI '00.

[25]  Stuart I. Feldman,et al.  Make — a program for maintaining computer programs , 1979, Softw. Pract. Exp..

[26]  Eelco Dolstra,et al.  Purely Functional System Configuration Management , 2007, HotOS.

[27]  Roberto Di Cosmo,et al.  Package upgrades in FOSS distributions: details and challenges , 2008, HotSWUp '08.