Skip to content

ermyril/dotfiles

Repository files navigation

NixOS Flake Configuration

A unified Nix flake managing NixOS workstations, a laptop, a macOS machine, and a container host — with shared modules, home-manager integration, and remote deployment.

Hosts

Host System Role
north x86_64-linux Main workstation — COSMIC + GNOME, AI (ComfyUI), streaming, gaming
minibook x86_64-linux Portable laptop — GNOME, encrypted disk, Waydroid
macbook aarch64-darwin Apple Silicon Mac — nix-darwin, yabai/skhd
rukako x86_64-linux Container host — Proxmox LXC, Caddy, Mailcow

Structure

flake.nix                        # Flake inputs & host definitions
hosts/
  north/                         # North-specific config & modules
  minibook/                      # Minibook-specific config & packages
  macbook/                       # macOS-specific nix-darwin config
  rukako/                        # Container host bootstrap
modules/
  DE/                            # Desktop environment modules
    cosmic.nix                   # COSMIC DE + LightDM (slick-greeter)
    gnome.nix                    # GNOME DE + excluded default apps
    hyprland.nix                 # Hyprland WM (optional)
  shared/                        # Shared between all hosts
    users.nix
    keyboard.nix
    nix-settings.nix
    packages/common.nix
    packages/development.nix
  nixos/                         # Linux-only system services
    packages.nix
    deluge.nix
    reaper.nix
  ai/comfyui.nix                 # ComfyUI (CUDA, port 8188)
  network/nas-nfs-mount.nix
  multimedia.nix                 # mpv, GIMP, Strawberry, etc.
home-manager/
  default.nix                    # Common user config (all platforms)
  platforms/linux.nix            # Linux-specific user config
  platforms/darwin.nix           # macOS-specific user config
  modules/                       # Composable HM modules
    emacs.nix
    dconf.nix
    hyprland-config.nix
    linux.nix
    ...

Prerequisites

  • Nix with flakes enabled
  • For NixOS hosts: SSH root access for remote deployment
  • For macbook: nix-darwin installed

Enable flakes if not already set:

echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf

Building

Always build before switching to catch evaluation errors early.

# Build a specific host (no activation)
sudo nixos-rebuild build --flake .#north
sudo nixos-rebuild build --flake .#minibook

# macOS
darwin-rebuild build --flake .#macbook

# Build all NixOS hosts via Makefile
make build

# Build a specific host via Makefile
make build-north
make build-minibook

Deploying

# Switch the local machine (NixOS)
sudo nixos-rebuild switch --flake .#north

# Switch via Makefile (deploys over SSH as root)
make deploy-north
make deploy-minibook
make deploy-rukako       # uses fixed IP 192.168.88.8

# Deploy all NixOS hosts
make deploy

# macOS (run locally on the Mac)
darwin-rebuild switch --flake .#macbook
make deploy-macbook

Adding a New Module

  1. Create the file under the appropriate directory (e.g. modules/myfeature.nix)
  2. Add it to the relevant host's module list in flake.nix
  3. Stage with git add before building — the flake evaluator only sees git-tracked files:
    git add modules/myfeature.nix
    sudo nixos-rebuild build --flake .#north

Adding a New Host

  1. Create hosts/<name>/configuration.nix (and any host-specific modules)
  2. Add a new nixosSystem (or darwinSystem) entry in flake.nix
  3. Stage the new files: git add hosts/<name>/
  4. Build: sudo nixos-rebuild build --flake .#<name>

Important Notes

  • Stage files before building. Nix flakes only see git-tracked files. Any new or moved file must be git add-ed before running a build or you'll get a "path does not exist" error.
  • Build before committing. Always run nixos-rebuild build and confirm it succeeds before committing to git.
  • Modules are self-contained. Each module under modules/DE/ includes everything to enable that feature — packages, services, PAM, portals, etc. Enable a whole subsystem by importing one file.

Proxmox LXC Image

To build a Proxmox LXC container template for rukako:

nix build .#proxmox-lxc
# or
make proxmox-lxc

Binary Caches

Configured in modules/shared/nix-settings.nix:

  • cache.nixos.org (default)
  • nix-community.cachix.org
  • cuda-maintainers.cachix.org
  • nur.cachix.org

Key Flake Inputs

Input Purpose
nixpkgs Base NixOS packages
home-manager User environment management
nix-darwin macOS system configuration
stylix Unified theming across HM and system
nur Nix User Repository overlay
streaming-setup OBS (CPU/CUDA), Reaper, audio tools
comfyui-nix ComfyUI AI image generation
kmonad Keyboard remapper
nixos-generators Build Proxmox LXC images

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •