Thanks to visit codestin.com
Credit goes to github.com

Skip to content
forked from malob/nixpkgs

My Nix system configs!

License

kpritam/nixpkgs

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Pritam's Nix-Darwin Configuration

A modern, declarative macOS system configuration using nix-darwin and Home Manager.

πŸš€ Quick Start

Prerequisites

  1. Install Nix with flakes support:

    curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
  2. Clone and apply this configuration:

    git clone <your-repo-url> ~/.config/nixpkgs
    cd ~/.config/nixpkgs
    nix flake update
    darwin-rebuild switch --flake .#MacBookPro

✨ What's Included

πŸ”’ Security & Privacy

  • TouchID authentication for sudo
  • Application firewall enabled with stealth mode
  • Secure system defaults
  • Privacy-focused DNS (Cloudflare + Google)

πŸ’» Development Environment

  • Editors: VS Code Insiders, Zed Preview, Neovim, Emacs
  • Version Control: Git with delta diffs, GitHub CLI
  • Languages: Go, Node.js, Rust, Python (uv), Lua
  • Tools: Docker alternatives (OrbStack, Colima), Kubernetes tools, AWS CLI

🎨 UI/UX Enhancements

  • Window Management: Yabai + skhd for tiling
  • Productivity: Raycast, Hammerspoon automation
  • Fonts: Nerd Fonts collection for programming
  • Terminal: Modern shell tools (bat, eza, fd, ripgrep, zoxide)

πŸ“¦ Package Management

  • Nix: Reproducible system and user packages
  • Homebrew: GUI applications and tools not in nixpkgs
  • Home Manager: Declarative user environment

πŸ— Architecture

This configuration follows modern Nix best practices:

Flake-based Configuration

  • All dependencies managed through flake.nix
  • Pinned inputs for reproducibility
  • Support for both stable and unstable nixpkgs

Modular Structure

  • System Level: darwin/ - macOS system configuration
  • User Level: home/ - User-specific settings via Home Manager
  • Libraries: lib/ - Reusable helper functions
  • Custom Modules: modules/ - Extended functionality

Key Features

  • Legacy Compatibility: default.nix via flake-compat
  • Optimized Performance: Binary caches, auto-optimization enabled
  • Apple Silicon Support: Native aarch64-darwin configuration
  • Secure Defaults: Hardened system preferences

πŸ›  Usage

Daily Commands

# Rebuild system configuration
darwin-rebuild switch --flake .

# Update all dependencies
nix flake update

# Check configuration before building
nix flake check

# Build without switching (for testing)
darwin-rebuild build --flake .

Maintenance

# Clean up old generations
darwin-rebuild --list-generations
nix-collect-garbage -d

# Optimize Nix store
nix store optimise

# Update specific input
nix flake lock --update-input nixpkgs-unstable

πŸ“ Customization

Personal Information

Update user details in flake.nix:

primaryUserDefaults = {
  username = "pritamkadam";
  fullName = "Pritam Kadam";
  email = "[email protected]";
  nixConfigDirectory = "~/.config/nixpkgs";
};

Adding Packages

System Preferences

Modify darwin/defaults.nix for:

  • macOS system defaults
  • Security settings
  • UI preferences

πŸ” File Structure

.
β”œβ”€β”€ flake.nix              # Main flake configuration
β”œβ”€β”€ flake.lock            # Dependency lock file
β”œβ”€β”€ default.nix           # Legacy compatibility
β”œβ”€β”€ darwin/               # macOS system configuration
β”‚   β”œβ”€β”€ defaults.nix      # System defaults & security
β”‚   β”œβ”€β”€ general.nix       # General system settings  
β”‚   β”œβ”€β”€ homebrew.nix      # Homebrew packages
β”‚   └── bootstrap.nix     # Minimal bootstrap config
β”œβ”€β”€ home/                 # Home Manager configuration
β”‚   β”œβ”€β”€ packages.nix      # User packages & programs
β”‚   β”œβ”€β”€ git.nix          # Git configuration
β”‚   β”œβ”€β”€ fish.nix         # Fish shell setup
β”‚   └── *.nix            # Other configurations
β”œβ”€β”€ lib/                  # Reusable functions
β”‚   └── mkDarwinSystem.nix # Darwin system builder
└── modules/              # Custom modules
    └── darwin/
        └── users.nix     # User management

πŸš€ Getting Started

  1. Fork this repository and customize the personal information
  2. Review packages in homebrew.nix and packages.nix
  3. Adjust system defaults in darwin/defaults.nix to your preferences
  4. Test the configuration with darwin-rebuild build --flake .
  5. Apply changes with darwin-rebuild switch --flake .

πŸ› Troubleshooting

Common Issues

  • Build failures: Run nix flake check to validate syntax
  • Permission errors: Ensure you're in the admin group
  • Homebrew conflicts: Avoid duplicate packages between Nix and Homebrew

Resources

πŸ“„ License

This configuration is provided as-is for educational purposes. Feel free to use and modify.

About

My Nix system configs!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Nix 79.4%
  • Shell 20.6%