- Nix 84.7%
- Python 12.7%
- Shell 1.8%
- JavaScript 0.8%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .forgejo | ||
| docs | ||
| flake | ||
| home | ||
| hosts | ||
| lib | ||
| modules | ||
| pkgs | ||
| themes | ||
| tools | ||
| .editorconfig | ||
| .gitignore | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| README.md | ||
| statix.toml | ||
| treefmt.toml | ||
Magrathea
Inspired by Nixy by anotherhadi.
Magrathea is the declarative fleet of MSRL: a NixOS and home-manager configuration where every host is composed from typed, opt-in modules. Secrets are encrypted with sops-nix, themes come from Stylix, and the whole repository is verified by quality gates before anything reaches a machine.
Features:
- 💻 Hyprland-centric: Preconfigured Hyprland ecosystem (Hyprlock, Hypridle, Wayle, etc.)
- 🎨 Consistent Theming: Base16 & Stylix-powered themes
- ⌨️ Vim-like Everywhere: Unified keybindings (Hyprland, nvim, vimium, etc.)
- 🔒 Secrets Management: Sops-nix integration for secure credential storage
Table of Content
Architecture
The detailed ownership rules and module conventions are documented in ARCHITECTURE.md.
🏠 /home (User-level configuration)
Contains dotfiles and settings that apply to your user environment.
Subfolders:
programsis a collection of apps configured with home-managerscriptsis a folder full of bash scripts (see SCRIPTS.md)systemis some "desktop environment" configuration
🐧 /nixos
Those are the system-level configurations. (audio, bluetooth, gpu, bootloader, ...)
/modules
Reusable NixOS modules live under modules/nixos. Hardware capabilities expose
typed, opt-in options under msrl.hardware, while role bundles live under
modules/nixos/profiles.
/modules/nixos/services
Reusable application and infrastructure services for servers.
/pkgs and /overlays
Standalone packages and deliberate package-set overrides. Host modules may configure these artifacts, but their implementation remains independent of a specific machine.
🎨 /themes
This folder contains all system themes. Mainly stylix configurations. Check out the available themes and learn how to create your own in THEMES.md
💻 /hosts
This directory contains host-specific configurations. Each host includes:
configuration.nixfor module composition and broad host policy- optional focused files such as
hardware.nix,networking.nix,filesystems.nix, andservices.nixfor machine-specific choices home.nixfor user-level configurationvariables.nixfor global variablessecrets/for sensitive data
Installation
- Clone this repo to your system:
git clone https://git.msrl.be/42/magrathea.git ~/.config/nixos
-
Copy the
hosts/examplefolder, rename it to match your system's hostname, and updatevariables.nixwith your machine's settings. -
Copy your
hardware-configuration.nixinto your new host's folder. -
Register your new host in
flake.nixby adding it undernixosConfigurations.
Important
# CHANGEMEcomments are placed throughout the config to indicate necessary modifications. Use the following command to quickly locate them:rg "CHANGEME" ~/.config/nixos
Tip
When you add new files, don't forget to run
git add .to add them to the git repository
- Build the system
sudo nixos-rebuild switch --flake ~/.config/nixos#yourhostname
Usage
Daily commands
| Command | Description |
|---|---|
mag rebuild |
Rebuild and switch to the new configuration |
mag update |
Update flake inputs |
mag upgrade |
Update and rebuild |
mag gc |
Run garbage collection to free disk space |
mag test |
Test the configuration without switching |
Adding packages
- User packages: Add to
hosts/<hostname>/home.nixunderhome.packages - Host-only system packages: Add to the focused host module that owns the feature
- Reusable commands: Package under
pkgs/and expose them from a NixOS module
Secrets management
This config uses sops-nix for secrets:
- Initialize age key:
age-keygen -o ~/.config/sops/age/keys.txt - Add your public key to
.sops.yaml - Create/edit secrets:
sops hosts/<hostname>/secrets/secrets.yaml
Documentation
- ARCHITECTURE: Repository ownership and module conventions
- THEMES: How themes work and how to create your own
- SCRIPTS: A list of available scripts and their usage
- KEYBINDINGS-HYPRLAND: Keybindings available in Hyprland
- WALLPAPERS: An awesome collection of wallpapers
- CONTRIBUTING: How to contribute
- LICENSE: MIT License
Credits
This configuration is inspired by Nixy by anotherhadi.