NixOS: A purely functional Linux distribution

Existing package and system configuration management tools suffer from an imperative model, where system administration actions such as package upgrades 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 deploy 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 analogous to a heap in a purely functional 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 modular, purely functional specification.

[1]  Satoshi Asami The FreeBSD Ports Collection , 1999, USENIX Annual Technical Conference, FREENIX Track.

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

[3]  David B. Tucker Applying Module System Research to Package Management , 2002 .

[4]  염흥렬,et al.  [서평]「Applied Cryptography」 , 1997 .

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

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

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

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

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

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

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

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

[13]  Alexander K. Petrenko,et al.  Electronic Notes in Theoretical Computer Science , 2009 .

[14]  Andres Löh,et al.  NixOS: a purely functional Linux distribution , 2008, ICFP.

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

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

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

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

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

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

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

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

[23]  Roy T. Fielding,et al.  Uniform Resource Identifiers (URI): Generic Syntax , 1998, RFC.

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

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

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

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

[28]  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.

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

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

[31]  Jacky Estublier Selected papers from the ICSE SCM-4 and SCM-5 Workshops, on Software Configuration Management , 1995 .

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

[33]  Walter F. Tichy,et al.  Proceedings 25th International Conference on Software Engineering , 2003, 25th International Conference on Software Engineering, 2003. Proceedings..