Table of Contents
Shabka (Arabic for Network) is a declarative congruent representation of my workstations (desktops, and laptops), network devices and servers. It's based on the NixOS operating system, and uses home-manager to setup the home directory of the users, for both NixOS and the other operating systems, including Mac.
See What is "declarative congruence"? for more information on the subject.
Nix is a powerful package manager for Linux and other Unix systems that makes package management reliable and reproducible. It provides atomic upgrades and rollbacks, side-by-side installation of multiple versions of a package, multi-user package management and easy setup of build environments. Read more…
Packages are built from Nix expressions, which is a simple functional language. A Nix expression describes everything that goes into a package build action (a “derivation”): other packages, sources, the build script, environment variables for the build script, etc. Nix tries very hard to ensure that Nix expressions are deterministic: building a Nix expression twice should yield the same result.
Because it's a functional language, it's easy to support building variants of a package: turn the Nix expression into a function and call it any number of times with the appropriate arguments. Due to the hashing scheme, variants don't conflict with each other in the Nix store.
Nix has a large set of Nix expressions containing thousands of existing Unix packages, in the Nix Packages collection (Nixpkgs).
NixOS is a Linux distribution with a unique approach to package and configuration management. Built on top of the Nix package manager, it is completely declarative, makes upgrading systems reliable, and has many other advantages.
Similar to Nix, NixOS is built upon the concept of atomic system updates as well as rollbacks, and that includes the kernel and the initrd images for early boot.
You simply cannot find yourself on a system that does not boot anymore, provided the hardware is not defective and you have not broken GRUB or Systemd-boot.
Please see the NixOS about page for a quick taste of managing a NixOS system.
Please see doc/modules for documentation on all the supported options.
Directory | Description |
---|---|
overlays | package and module overrides used throughout the configuration. |
scripts | various development scripts to help with the development. |
external | Nix expressions for fetching externals such as nixos-hardware. |
hosts | top-level expressions specific to individual workstations or servers. |
modules/nixos | custom NixOS modules under the shabka namespace controlled by host configuration. |
modules/home | custom home-manager modules under the shabka namespace controlled by host configuration. |
util | Nix expressions, mainly functions, used as helpers in the actual modules. |
os-specific | OS-specific configuration files, and bootstrap scripts not belonging to NixOS or the home-manager. |
libexec | development helpers, mainly used by the scripts (not invoked directly). |
network | top-level expressions describing a NixOps network. |
terraform | cloud-resources that are not nixops-able. |
Wael Nasreddine | Marc 'risson' Schmitt |
Thanks to #nixos
community on Freenode, particularly infinisil
,
clever
and samueldr
for helping me learn how to configure my NixOS
system and debug it.
The host configuration, the modules and the options are inspired by @dustinlacewell's dotfiles.
The images from the declarative congruence description above are taken from the paper published on Usenet, written by Steve Traugott and Lance Brown.
All source code is licensed under the MIT License.