os
os copied to clipboard
My OS & dotfiles configuration for Linux and MacOS devices (Nix)
OS dotfiles for Nix(OS)
This repository configures all of my digital devices that run ✨ Nix(OS) ✨ !
Help
This repository can be useful if you're relatively experienced with NixOS and are looking for inspiration. If you are a complete beginner, I recommend looking elsewhere first:
- https://nix.dev/
- https://nixos.org/manual/nixos/stable/
- https://ianthehenry.com/posts/how-to-learn-nix/
- https://xeiaso.net/blog/nix-flakes-1-2022-02-21
- https://xeiaso.net/blog/nix-flakes-2-2022-02-27
- https://xeiaso.net/blog/nix-flakes-3-2022-04-07
Structure
Hosts
A machine, such as a server or laptop, is called a host.
Host configurations live in the hosts directory.
If a host is using NixOS, the configuration of a host is comprised of three parts:
- a hardware configuration
- a system configuration
- a home configuration
If a host is using MacOS, the configuration is comprised only of a home configuration.
All of these files are imported by ./flake.nix.
System services, apps, ...
Software installed on a system-level is configured in sys. All files here are NixOS modules and their configuration options are namespaced under skogsbrus. Hosts declare and configure their system modules in ./hosts/<hostname>/system.nix.
User services, apps, ...
Software and configuration files in user-land live in home and is configured by Home Manager and are for the most part also NixOS modules.
Adding a new device
- Add it to
flake.nix. - Add a new folder in hosts with a hardware, system, and home configuration.
- Run
make. - Done!
Note that the hostname of the new device must match the name of the host in ./flake.nix.
MacOS specifics
For MacOS devices, some caveats apply. To set up my repository for compatibility with MacOS, I followed this excellent blog post: https://xyno.space/post/nix-darwin-introduction.