Skip to content

Latest commit

 

History

121 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


NixOS Flake

TODO

# 1. Copy hardware configuration from NixOS installation
cp /etc/nixos/hardware-configuration.nix hosts/${HOST}/hardware-configuration.nix

# 2. Create directories for user data
for dir in ~/Music ~/Documents ~/Pictures/wallpapers/others; do
    mkdir -p "$dir"
done

# 3. Copy wallpapers
cp -r wallpapers/otherWallpaper/gruvbox/* ~/Pictures/wallpapers/others/ && \
    cp -r wallpapers/otherWallpaper/nixos/* ~/Pictures/wallpapers/others/ && \
    ln -sf $PWD/wallpapers/wallpaper.png ~/Pictures/wallpapers/wallpaper

sudo nixos-rebuild switch --flake .#${HOST}

🗃️ Overview

📚 Layout

  • flake.nix base of the configuration
  • hosts 🌳 per-host configurations that contain machine specific configurations
    • desktop 🖥️ Desktop specific configuration (NixOS)
    • macbook 💻 MacBook specific configuration (nix-darwin)
  • modules 🍱 modularized configurations
    • nixos ⚙️ NixOS system configuration
    • darwin 🍎 nix-darwin system configuration
    • home 🏠 my Home-Manager config
      • common shared across all machines (shell, git, editors, terminal tools)
      • linux Linux-only (niri, waybar-era Wayland tooling, GUI apps)
      • darwin macOS-only extras
  • wallpapers 🌄 wallpapers collection

macOS (nix-darwin + home-manager)

The Mac is managed declaratively with nix-darwin and home-manager. GUI apps are installed as Homebrew casks driven by nix-homebrew.

# 1. Install Nix (Determinate installer — flakes enabled by default).
#    Open a NEW terminal afterwards so the daemon is on PATH.
curl -fsSL https://install.determinate.systems/nix | sh -s -- install

# 2. Bootstrap nix-darwin (darwin-rebuild doesn't exist yet, so run it via nix).
sudo nix run github:nix-darwin/nix-darwin/master#darwin-rebuild -- \
    switch --flake ~/git/nix-config#Andres-MacBook-Pro
#    If it complains that /etc/zshrc (or /etc/bashrc) already exists:
#      sudo mv /etc/zshrc /etc/zshrc.before-nix-darwin
#    then re-run the command. The first run also installs Homebrew + casks.

# 3. Apply changes on every subsequent edit.
sudo darwin-rebuild switch --flake ~/git/nix-config#Andres-MacBook-Pro

# 4. Set fish as the login shell (one-time). The rebuild registers fish in
#    /etc/shells via `environment.shells`, so chsh will accept it.
chsh -s /run/current-system/sw/bin/fish
#    Open a new terminal afterwards. fish is configured in modules/home/common/shell.nix.

Note: the Determinate installer ships Determinate Nix, which manages the Nix daemon itself, so the darwin config sets nix.enable = false (see modules/darwin/nix.nix). Add GUI apps by editing the casks list in modules/darwin/homebrew.nix.

👥 Credits

Based on anddani/nix-home

About

My NixOS config

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages