fredrikaverpil/dotfiles

No description

204 stars7 forksUpdated Jan 26, 2026
npx skills add fredrikaverpil/dotfiles

README

dotfiles šŸ©

screenshot

Personal dotfiles using Nix for reproducible system/package management and GNU Stow for dotfile symlinking.

Quick start

Initial installation

[!IMPORTANT]

Make sure your terminal has full disk access on macOS before installing.

# Clone repo
git clone https://github.com/fredrikaverpil/dotfiles.git ~/.dotfiles
cd ~/.dotfiles

# Install Nix (Determinate Systems installer - enables flakes by default, better uninstall,
# survives macOS updates, consistent installation across Linux/macOS)
# Choose "Determinate Nix" when prompted (performance optimized, better error messages)
# Learn more: https://determinate.systems/nix
# IMPORTANT: choose "no" during install, so to install upstream Nix.
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install

# Set hostname to match a configuration in nix/hosts/
# macOS: sudo scutil --set HostName <hostname>
# Linux: sudo hostnamectl set-hostname <hostname>

# Apply configuration
# Linux (NixOS):
sudo nixos-rebuild switch --flake ~/.dotfiles#$(hostname)

# macOS (first time only):
sudo nix --extra-experimental-features "nix-command flakes" run nix-darwin -- switch --flake ~/.dotfiles#$(hostname)

# After first-time setup, use the rebuild script:
./rebuild.sh
# Rebuild system + packages + dotfiles (reproducible, uses flake.lock)
./rebuild.sh

# Update ALL flake inputs then rebuild
./rebuild.sh --update

# Update only unstable inputs (nixpkgs-unstable, nix-darwin, home-manager-unstable, dotfiles)
./rebuild.sh --update-unstable

# Dotfiles only (no Nix rebuild)
./rebuild.sh --stow
Troubleshooting

Update stable vs unstable

By default, ./rebuild.sh aims to be "reproducible" and uses the locked flake.lock. Use --update-unstable to update Darwin-related inputs, or --update to update all inputs.

# Update only unstable/Darwin-related inputs
./rebuild.sh --update-unstable
# Or manually: nix flake update nixpkgs-unstable nix-darwin home-manager-unstable dotfiles

# Update only stable/Linux-related inputs
nix flake update nixpkgs home-manager nixos-raspberrypi disko

macOS permissions

If you get errors about com.apple.universalaccess or system settings during nix-darwin activation:

  1. Grant Full Disk Access to your terminal:
    • Open System Settings > Privacy & Security > Full Disk Access
    • Click + and add your terminal app (e.g., /Applications/Utilities/Terminal.app)
    • Enable the checkbox for your terminal

SSL certificate issues (when choosing upstream Nix)

If you get SSL certificate errors after switching from Determinate to upstream Nix:

# Fix broken certificate symlink
sudo rm /etc/ssl/certs/ca-certificates.crt
sudo ln -s /etc/ssl/cert.pem /etc/ssl/certs/ca-certificates.crt

# Clean up leftover Determinate configuration
sudo cp /etc/nix/nix.conf /etc/nix/nix.conf.backup
sudo tee /etc/nix/nix.conf << 'EOF'
extra-experimental-features = nix-command flakes
max-jobs = auto
ssl-cert-file = /etc/ssl/cert.pem
EOF

General troubleshooting

# Check configuration
nix flake check ~/.dotfiles

# Verbose rebuild
sudo nixos-rebuild switch --flake ~/.dotfiles --show-trace  # Linux
darwin-rebuild switch --flake ~/.dotfiles --show-trace      # macOS

# Clean cache
nix-collect-garbage -d

# Rollback
sudo nixos-rebuild --rollback  # Linux
darwin-rebuild --rollback      # macOS

Nix management responsibilities

Repo structure
ā”œā”€ā”€ nix/                             # Nix configurations
│   ā”œā”€ā”€ hosts/                       # Host-specific configurations
│   │   └── $host/                   # Individual host directory
│   │       ā”œā”€ā”€ configuration.nix    # System settings
│   │       ā”œā”€ā”€ hardware.nix         # Hardware config (optional, for NixOS)
│   │       └── users/
│   │           └── $username.nix    # User config
│   ā”œā”€ā”€ lib/                         # Helper functions
│   │   ā”œā”€ā”€ default.nix              # Library entry point
│   │   ā”œā”€ā”€ systems.nix              # System configuration helpers
│   │   └── users.nix                # User configuration helpers
│   └── shared/                      # Shared configurations
│       ā”œā”€ā”€ home/
│       │   ā”œā”€ā”€ common.nix           # Cross-platform user packages
│       │   ā”œā”€ā”€ darwin.nix           # macOS user config
│       │   └── linux.nix            # Linux user config
│       ā”œā”€ā”€ overlays/
│       │   ā”œā”€ā”€ default.nix          # Overlay entry point
│       │   └── neovim.nix           # Neovim overlay
│       └── system/
│           ā”œā”€ā”€ common.nix           # Cross-platform system packages
│           ā”œā”€ā”€ darwin.nix           # macOS system config + Homebrew
│           └── linux.nix            # Linux system config
ā”œ

...
Read full README

Statistics

Stars204
Forks7
Open Issues3
LicenseMIT License
CreatedApr 8, 2016