aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: dbca951b0f9e33aa4c6374b9aa8dde76221b94f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# dotfiles

My Development Setup, managed with [Nix](https://nixos.org), [nix-darwin](https://github.com/LnL7/nix-darwin), and [home-manager](https://github.com/nix-community/home-manager). Works on macOS, NixOS, and standalone Linux.

## Quickstart

Setting up a new machine? Follow [INSTALL.md](INSTALL.md) — it covers the
prerequisites (Homebrew, App Store, 1Password SSH agent) that the commands below
assume are already in place.

### 1. Install Determinate Nix

```shell
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --determinate
```

### 2. Clone the repository

```shell
git clone https://simenandre.no/dotfiles.git ~/ghq/simenandre.no/dotfiles
cd ~/ghq/simenandre.no/dotfiles
```

### 3. Apply the configuration

#### macOS

Configurations are per-machine — `makkie` (user `simenandre`) and `default`
(user `cobraz`). Substitute the one you are on.

On first run, bootstrap nix-darwin:

```shell
sudo nix run nix-darwin#darwin-rebuild -- switch --flake .#makkie
```

On subsequent runs:

```shell
sudo darwin-rebuild switch --flake .#makkie
```

#### NixOS

Generate hardware config and rebuild:

```shell
sudo nixos-generate-config --show-hardware-config > hosts/nixbox/hardware-configuration.nix
sudo nixos-rebuild switch --flake .#nixbox
```

#### Linux (standalone home-manager)

```shell
# x86_64
home-manager switch --flake .#simenandre

# aarch64
home-manager switch --flake .#simenandre@aarch64-linux
```

## Structure

```
flake.nix               # Entry point – inputs & all configurations
INSTALL.md              # Full setup guide for a new machine
hosts/
  nixbox/
    hardware-configuration.nix
modules/
  darwin/
    default.nix          # System-level configuration (nix settings, core packages)
    homebrew.nix         # Homebrew packages (taps, brews, casks, Mac App Store)
    macos.nix            # macOS system defaults
  home/
    default.nix          # home-manager entry point (platform-aware home directory)
    claude.nix           # Claude Code instructions and skills
    git.nix              # Git configuration (platform-aware SSH signing path)
    zsh.nix              # Zsh configuration (zshenv, zshrc, aliases, path, completions)
    starship.nix         # Starship prompt
    tmux.nix             # Tmux configuration
    lazygit.nix          # Lazygit configuration
    twm.nix              # twm workspace manager configuration
    ghostty.nix          # Ghostty terminal configuration
  nixos/
    default.nix          # NixOS system configuration
scripts/
  cleanup.sh             # macOS cleanup utility
```