No description
  • Nix 84.7%
  • Python 12.7%
  • Shell 1.8%
  • JavaScript 0.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-30 16:35:16 +08:00
.forgejo release: v4.0.1 2026-09-30 16:35:16 +08:00
docs release: v4.0.1 2026-09-30 16:35:16 +08:00
flake release: v4.0.1 2026-09-30 16:35:16 +08:00
home release: v4.0.1 2026-09-30 16:35:16 +08:00
hosts release: v4.0.1 2026-09-30 16:35:16 +08:00
lib release: v4.0.1 2026-09-30 16:35:16 +08:00
modules release: v4.0.1 2026-09-30 16:35:16 +08:00
pkgs release: v4.0.1 2026-09-30 16:35:16 +08:00
themes release: v4.0.1 2026-09-30 16:35:16 +08:00
tools release: v4.0.1 2026-09-30 16:35:16 +08:00
.editorconfig release: v4.0.1 2026-09-30 16:35:16 +08:00
.gitignore release: v4.0.1 2026-09-30 16:35:16 +08:00
flake.lock release: v4.0.1 2026-09-30 16:35:16 +08:00
flake.nix release: v4.0.1 2026-09-30 16:35:16 +08:00
LICENSE release: v4.0.1 2026-09-30 16:35:16 +08:00
README.md release: v4.0.1 2026-09-30 16:35:16 +08:00
statix.toml release: v4.0.1 2026-09-30 16:35:16 +08:00
treefmt.toml release: v4.0.1 2026-09-30 16:35:16 +08:00

Magrathea logo

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:

  • programs is a collection of apps configured with home-manager
  • scripts is a folder full of bash scripts (see SCRIPTS.md)
  • system is 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.nix for module composition and broad host policy
  • optional focused files such as hardware.nix, networking.nix, filesystems.nix, and services.nix for machine-specific choices
  • home.nix for user-level configuration
  • variables.nix for global variables
  • secrets/ for sensitive data

Installation

  1. Clone this repo to your system:
git clone https://git.msrl.be/42/magrathea.git ~/.config/nixos
  1. Copy the hosts/example folder, rename it to match your system's hostname, and update variables.nix with your machine's settings.

  2. Copy your hardware-configuration.nix into your new host's folder.

  3. Register your new host in flake.nix by adding it under nixosConfigurations.

Important

# CHANGEME comments 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

  1. 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.nix under home.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:

  1. Initialize age key: age-keygen -o ~/.config/sops/age/keys.txt
  2. Add your public key to .sops.yaml
  3. Create/edit secrets: sops hosts/<hostname>/secrets/secrets.yaml

Documentation

Credits

This configuration is inspired by Nixy by anotherhadi.