macOS to NixOS the Purely Functional Linux Distribution by Daniel Britten

February 16, 2022

In the presentation macOS to NixOS the Purely Functional Linux Distribution, Daniel Britten shares his experience of switching from macOS to NixOS, highlighting the benefits and challenges of using the functional Linux distribution. Daniel was drawn to NixOS due to its unique declarative configuration and ease of experimentation, which allowed him to define all programs and system configurations in text files. NixOS offers a functional package manager, Next, that ensures consistency and ease of management by treating packages as values and storing them in the Next store. Britten discusses the advantages of NixOS, including atomic upgrades and rollbacks, stable systems, and the ability to learn and upskill. However, he also mentions some quirks, such as occasional issues with scripts that rely on bash and occasional Wi-Fi drops. Despite these challenges, Daniel concludes that the benefits of using NixOS outweigh the quirks and encourages others to check it out.

macOS to NixOS the Purely Functional Linux Distribution: A comprehensive overview

 

Why NixOS?

Background and motivation
Daniel Britten begins by recounting his initial use of Windows and macOS during his studies. However, as a computer science PhD student, he sought a more manageable and efficient system for his daily usage. This quest led him to NixOS, primarily due to its unique declarative configuration and the ease of experimentation and rollback it offered.

NixOS, built around the purely functional package manager Nix, treats packages as immutable values stored in the Nix store. This setup ensures consistency and ease of management, as packages are built by side effects-free functions that never change once built. For Daniel, the ability to define all programs and system configurations in text files and the practical benefits of more storage on his university-provided laptop were significant factors in his decision.

 

Community Insights
Daniel also shared insights from fellow NixOS users, who appreciated the distribution’s stability, ease of experimentation, and consistent configuration. The declarative nature of NixOS reduces the “it works on my machine” problem, making it a valuable tool for collaborative and reproducible work environments.

 

Benefits of NixOS

Functional package management
One of the standout features of NixOS is its purely functional package manager, which allows multiple software versions to coexist seamlessly. Different hashes and paths ensure complete dependencies, aiding reproducibility. Atomic upgrades and rollbacks provide stability, enabling users to revert to previous setups without hassle.

 

Declarative configuration
NixOS’s declarative configuration means that any system changes are predictable and easily reversible. This feature ensures that any breakages can be fixed systematically, fostering a learning environment where users are encouraged to upskill.

 

Stability and experimentation
The stability offered by NixOS, due to its atomic upgrades and rollbacks, makes it a safe platform for experimentation. Users can confidently try new configurations, knowing they can always revert to a previous stable state.

 

Challenges and Quirks

Learning curve and system quirks
Transitioning to NixOS wasn’t without its challenges. Daniel faced issues with scripts that rely on bash, occasional Wi-Fi drops, and sleep problems on his laptop. Additionally, some software update prompts didn’t work as expected. Despite these quirks, tools like Crypti, TikTok, and Google Docs proved useful during his transition.

 

Next shell and developer tools
Daniel found the Next Shell, a practical tool for developers, particularly beneficial. It can be used on both macOS and NixOS to set up dependencies and share developer environments. The Next Shell improved reproducibility and automation in his development environment, providing a smoother experience compared to other package managers.

 

Practical applications and demonstrations

Reproducible development environments
Daniel demonstrated how NixOS facilitates reproducible development environments. The Nix package manager and Next Shell pin dependencies to specific versions, solving the “it works on my machine” problem. This feature is crucial for ensuring consistent development environments across different machines and team members.

 

Configuration and customization
NixOS allows users to control the entire operating system through configuration files, a significant departure from managing dot files on macOS or other Linux distributions. The main configuration file, “configuration.nix,” defines the system’s setup, and users can easily override or uninstall packages by modifying this file.

 

Gaming and virtualization
NixOS supports gaming and virtualization tools like Docker and VirtualBox. However, users need to manage storage carefully, as the system’s generational storage approach can consume significant space. Deleting old generations is necessary to free up storage.

 

Final thoughts and recommendations

High investment, high reward
Daniel concludes by encouraging viewers to explore NixOS, noting that while the investment in learning the system and its functional language, Nix, is substantial, the rewards are equally significant. NixOS’s robustness, stability, and reproducibility make it a compelling choice for those willing to invest the time and effort.

 

Community and support
He reflects on the supportive NixOS community and its growth, emphasizing the collaborative spirit that makes mastering NixOS a rewarding endeavor. Daniel’s experience transitioning from macOS to NixOS highlights the distribution’s potential to enhance productivity and control over system configurations, making it an attractive option for computer science professionals and enthusiasts alike.

In summary, Daniel Britten’s journey from macOS to NixOS underscores the transformative potential of adopting a purely functional Linux distribution. NixOS’s unique features, despite its learning curve, offer significant benefits in terms of stability, reproducibility, and overall system management, making it a worthy consideration for tech-savvy users and developers.

 

Additional resources

Check out more from the MeetUp Func Prog Sweden. Func Prog Sweden is the community for anyone interested in functional programming. At the MeetUps the community explore different functional languages like Erlang, Elixir, Haskell, Scala, Clojure, OCaml, F# and more.