Skip to main content

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.

Hide All
Anderson, Rick. 2000 (Jan.). The end of DLL hell. MSDN,
Beshers, Clifford, Fox, David, & Shaw, Jeremy. (2007). Experience report: using functional programming to manage a Linux distribution. In ICFP'07: Proceedings of the 2007 ACM SIGPLAN International Conference on Functional Programming, Hinze, R. and Ramsey, N. (eds.), New York, NY, USA: ACM, pp. 213218.
Boehm, Hans-Juergen. 1993 (June). Space efficient conservative garbage collection. Pages 197–206 of: Proceedings of the ACM SIGPLAN '93 Conference on Programming Language Design and Implementation. SIGPLAN Notices, no. 28/6.
den Breejen, Wouter. 2008 (Mar.). Managing state in a purely functional deployment model. M.Phil. thesis, Dept. of Information and Computing Sciences, Utrecht University. INF/SCR-2007-053.
Burgess, Mark. (1995). A site configuration engine. Computing systems, 8 (3), 309337.
Clemm, G. (February 1986) The Odin System — an Object Manager for Extensible Software Environments. Ph.D. thesis, University of Colorado at Boulder.
Clemm, G. (1995) The Odin system. In Selected Papers from the ICSE SCM-4 and SCM-5 Workshops on Software Configuration Management. Lecture Notes in Computer Science, no. 1005. Springer-Verlag, pp. 241262.
Cosmo, R. D., Zacchiroli, S. & Trezentos, P. (2008) Package upgrades in FOSS distributions: details and challenges. In HotSWUp '08: Proceedings of the 1st International Workshop on Hot Topics in Software Upgrades. New York, NY, USA: ACM, pp. 15.
den Breejen, W. (March 2008). Managing State in a Purely Functional Deployment Model. M.Phil. thesis, Dept. of Information and Computing Sciences, Utrecht University. INF/SCR-2007-053.
DeTreville, J. (2005) Making system configuration more declarative. In HotOS X: 10th Workshop on Hot Topics in Operating Systems. USENIX, pp. 6166.
Dolstra, E. (November 2005). Secure sharing between untrusted users in a transparent source/binary deployment model. In 20th IEEE/ACM International Conference on Automated Software Engineering (ASE 2005), pp. 154–163.
Dolstra, E. (2006) The Purely Functional Software Deployment Model. Ph.D. thesis, Faculty of Science, Utrecht University, The Netherlands.
Dolstra, E. (2008) Maximal laziness — an efficient interpretation technique for purely functional DSLs. In Eighth Workshop on Language Descriptions, Tools and Applications (LDTA 2008). Electronic Notes in Theoretical Computer Science, vol. 238, no. 5. Elsevier Science Publishers, pp. 8199.
Dolstra, E., Visser, E. & de Jonge, M. (2004) Imposing a memory management discipline on software deployment. In Proceedings of the 26th International Conference on Software Engineering (ICSE 2004). IEEE Computer Society, pp. 583592.
Feldman, S. I. (1979) Make—a program for maintaining computer programs, Soft.—Prac. Exp., 9 (4), 255265.
Foster-Johnson, E. (2003) Red Hat RPM Guide. John Wiley & Sons. Also Available at:
FreeBSD Project. (2009) FreeBSD Ports Collection. Available at:
Hallgren, T., Jones, M. P., Leslie, R. & Tolmach, A. (2005) A principled approach to operating system construction in Haskell. In ICFP '05: Tenth ACM SIGPLAN International Conference on Functional Programming. ACM, pp. 116128.
Hart, J. & D'Amelia, J. (2002) An analysis of RPM validation drift. In Proceedings of the 16th Systems Administration Conference (LISA '02). USENIX, pp. 155166.
Heydon, A., Levin, R. & Yu, Y. (2000) Caching function calls using precise dependencies. In ACM SIGPLAN '00 Conference on Programming Language Design and Implementation. ACM, pp. 311320.
Heydon, A., Levin, R., Mann, T. & Yu, Y. (March 2001). The Vesta Approach to Software Configuration Management. Tech. Rep. Research Report 168. Compaq Systems Research Center.
Hudak, P. (1989) Conception, evolution, and application of functional programming languages. ACM Comput. Surv., 21 (3), 359411.
Kanies, L. (2003) ISconf: Theory, practice and beyond. In Proceedings of the 17th USENIX Conference on System Administration (LISA '03). USENIX, pp. 115124.
Pendry, J.-S. & McKusick, M. K. (1995) Union mounts in 4.4BSD-Lite. Proceedings of the USENIX 1995 Technical Conference. USENIX, pp. 2533.
Peyton Jones, S. (1992) Implementing lazy functional languages on stock hardware: The Spineless Tagless G-machine. J. Funct. Program., 2 (2), 127202.
Peyton Jones, S. (ed). (2004) Haskell 98 Language and Libraries: The revised Report. Cambridge University Press.
Schneier, B. (1996) Applied Cryptography. 2nd ed.John Wiley & Sons.
Sloane, A. M. (2002) Post-design domain-specific language embedding: A case study in the software engineering domain. In Proceedings of the 35th Annual Hawaii International Conference on System Sciences (HICSS'02). Washington, DC, USA: IEEE Computer Society, pp. 281289.
Stevens, W. R. & Rago, S. A. (2005) Advanced Programming in the UNIX Environment. 2nd ed.Addison-Wesley.
TIS Committee. (May 1995) Tool Interface Specification (TIS) Executable and Linking Format (ELF) Specification, Version 1.2.
Traugott, S. & Brown, L. (2002) Why order matters: Turing equivalence in automated systems administration. In Proceedings of the 16th Systems Administration Conference (LISA '02). USENIX, pp. 99120.
Tucker, D. B. & Krishnamurthi, S. (2001) Applying module system research to package management. In Tenth International Workshop on Software Configuration Management (SCM-10).
Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Journal of Functional Programming
  • ISSN: 0956-7968
  • EISSN: 1469-7653
  • URL: /core/journals/journal-of-functional-programming
Please enter your name
Please enter a valid email address
Who would you like to send this to? *


Full text views

Total number of HTML views: 0
Total number of PDF views: 18 *
Loading metrics...

Abstract views

Total abstract views: 216 *
Loading metrics...

* Views captured on Cambridge Core between September 2016 - 25th March 2018. This data will be updated every 24 hours.