Skip to content

tellmeY18/retire.nix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unified Nix Flake: macOS (nix-darwin) + NixOS

This repository provides a unified Nix flake for managing both macOS (via nix-darwin) and NixOS configurations. It enables reproducible, declarative system setups for both platforms from a single source of truth.

Features

  • Single Flake for Multiple Systems: Manage both macOS and NixOS hosts from one repository
  • macOS Support: Uses nix-darwin for system configuration with Homebrew integration
  • NixOS with ZFS: Configured with ZFS root and dataset provisioning using disko
  • Modular Design: Clean separation between host-specific and shared modules
  • Secrets Management: Integration with sops-nix for secure secrets handling
  • Sane Deployment: Integration with deploy-rs for secure secrets handling
  • Nix Utilities: Includes formatting tools and nix-index for better developer experience

Repository Structure

.
├── flake.nix                # Flake entrypoint: inputs, outputs, host configs
├── hosts/                   # Host-specific configurations
│   ├── darwin/              # macOS configurations
│   └── chopper/             # NixOS configuration for "chopper" host
├── modules/                 # Shared NixOS modules
│   ├── arr.nix              # Arr stack configuration
│   ├── conduit.nix          # Conduit Matrix homeserver
│   ├── esp.nix              # ESP-related tools
│   ├── nextcloud.nix        # Nextcloud server configuration
│   └── zfs.nix              # ZFS configuration and utilities
├── overlays/                # Nixpkgs overlays
├── packages/                # Custom packages
│   ├── chopper/             # Packages specific to chopper
│   ├── darwin/              # Packages specific to macOS
│   └── default.nix          # Package definitions
└── scripts/                 # Helper scripts

Usage

macOS (nix-darwin)

nh darwin switch <PATH>

NixOS

nh os switch <PATH>

Customization

  • Add new host configurations under hosts/<hostname>/
  • Reference new hosts in flake.nix under the appropriate section
  • Create reusable modules in the modules/ directory
  • Add custom packages in the packages/ directory

Common Commands

# Update flake inputs
nix flake update

# Check system generation history
nix profile history --profile /nix/var/nix/profiles/system

# Format nix files
nix fmt

# Search packages
nix search nixpkgs <package-name>

# Start a dev shell
nix develop

Resources

License

See LICENSE for details.

About

Rock on which I plan to retire my distro hopping.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages