Kieran's opinionated (and probably slightly dumb) nix config

docs: update the readme to remove stale info

dunkirk.sh 023c6cd5 19cd4823

verified
+33 -116
+33 -116
README.md
··· 5 5 > [!CAUTION] 6 6 > These dots are highly prone to change / breakage. 7 7 > 8 - > ~I am not a nix os expert (this is my first time touching nix), so I'm not sure if this will work or not. I'm just trying to get my dots up on github.~ 8 + > ~~I am not a nix os expert (this is my first time touching nix), so I'm not sure if this will work or not. I'm just trying to get my dots up on github.~~ 9 9 > 10 - > After `284` successful days of these dots being in constant operation, many many rebuilds, and `364` commits these dots have been rock solid and I have no complaints. 10 + > After `591` days of these dots being in constant operation, many many rebuilds, and `776` commits these dots have been rock solid and I have no complaints. 11 11 12 12 ## The layout 13 13 14 - ```bash 15 - ~/dots # symlinked to /etc/nixos 16 - ├── dots # any config files that need to be symlinked go here, e.g. my hyprland config 14 + ``` 15 + ~/dots 16 + ├── .github/workflows # CI/CD (deploy-rs + per-service reusable workflow) 17 + ├── dots # config files symlinked by home-manager 17 18 │ └── wallpapers 18 19 ├── machines 19 - │ ├── atalanta # my macOS M4 machine 20 - │ ├── ember # my dell r210 server (in my basement) 21 - │ ├── moonlark # my framework 13 <dead> 22 - │ ├── nest # shared tilde server through hc 23 - │ ├── prattle # oracle cloud x86_64 server 24 - │ ├── tacyon # rpi 5 25 - │ └── terebithia # oracle cloud aarch64 server 20 + │ ├── atalanta # macOS M4 (nix-darwin) 21 + │ ├── ember # dell r210 server (basement) 22 + │ ├── moonlark # framework 13 (dead) 23 + │ ├── nest # shared tilde server (home-manager only) 24 + │ ├── prattle # oracle cloud x86_64 25 + │ ├── tacyon # rpi 5 26 + │ └── terebithia # oracle cloud aarch64 (main server) 26 27 ├── modules 27 - │ ├── lib # shared nix utilities 28 - │ │ └── mkService.nix # base service factory 29 - │ ├── home # home-manager modules 28 + │ ├── lib 29 + │ │ └── mkService.nix # service factory (see Deployment section) 30 + │ ├── home # home-manager modules 30 31 │ │ ├── aesthetics # theming and wallpapers 31 - │ │ ├── apps # any app specific config 32 - │ │ │ └── crush # vendored for now 33 - │ │ ├── system # home-manager system configs 34 - │ │ └── wm # window managers; just hyprland for now 35 - │ │ └── hyprland 36 - │ └── nixos # nixos modules 37 - │ ├── apps # also app specific configs 38 - │ ├── services # self-hosted services with automatic backup 39 - │ │ └── restic # backup system (see modules/nixos/services/restic/README.md) 40 - │ └── system # pam and my fancy wifi module for now 41 - └── secrets # keep your grubby hands (or paws) off my data 42 - 43 - 16 directories 32 + │ │ ├── apps # app configs (ghostty, helix, git, ssh, etc.) 33 + │ │ ├── system # shell, environment 34 + │ │ └── wm/hyprland 35 + │ └── nixos # nixos modules 36 + │ ├── apps # system-level app configs 37 + │ ├── services # self-hosted services (mkService-based + custom) 38 + │ │ ├── restic # backup system with CLI 39 + │ │ └── bore # tunnel proxy 40 + │ └── system # pam, wifi 41 + ├── packages # custom nix packages 42 + └── secrets # agenix-encrypted secrets 44 43 ``` 45 44 46 45 ## Installation ··· 48 47 > [!WARNING] 49 48 > Also to note that this configuration will **not** work if you do not change any of the [secrets](./secrets) since they are encrypted. 50 49 51 - You could either install a NixOS machine (rn there is just `moonlark`), use the home-manager instructions, or use nix-darwin for macOS. 50 + You could install a NixOS machine, use the home-manager instructions, or use nix-darwin for macOS. 52 51 53 52 ### macOS with nix-darwin 54 53 ··· 115 114 116 115 #### Using nixos-anywhere (Recommended for remote installations) 117 116 118 - > [!WARN] 117 + > [!WARNING] 119 118 > This only currently works with `prattle` and `terebithia` as they have the proper disko configs setup. 120 119 121 120 For remote installations (like Oracle Cloud), use [nixos-anywhere](https://github.com/nix-community/nixos-anywhere): ··· 141 140 ./install.sh 142 141 ``` 143 142 144 - #### The manual way 145 - 146 - Install NixOS via the [official guide](https://nixos.org/download.html) 147 - 148 - Connect to wifi 149 - 150 - ```bash 151 - wpa_passphrase your-ESSID your-passphrase | sudo tee /etc/wpa_supplicant.conf 152 - sudo systemctl restart wpa_supplicant 153 - ``` 143 + #### Post-install 154 144 155 - Check with `ping 1.1.1.1` if that doesn't work then use `wpa_cli` 156 - 157 - ```bash 158 - sudo systemctl start wpa_supplicant 159 - wpa_cli 160 - 161 - add_network 0 162 - 163 - set_network 0 ssid "put your ssid here" 164 - 165 - set_network 0 psk "put your password here" 166 - 167 - enable network 0 168 - 169 - exit 170 - ``` 171 - 172 - Aquire root permissions while keeping your current context with 173 - 174 - ```bash 175 - sudo -i 176 - ``` 177 - 178 - Enable git and rebuild your flake with the following 179 - 180 - ```bash 181 - sed -i 's/^{$/{\n programs.git.enable = true;/' /etc/nixos/configuration.nix 182 - nixos-rebuild switch 183 - ``` 184 - 185 - Download the disk configuration and run it 186 - 187 - ```bash 188 - curl -L https://github.com/taciturnaxolotl/dots/raw/main/moonlark/disk-config.nix -o /tmp/disk-config.nix 189 - nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode destroy,format,mount /tmp/disk-config.nix 190 - ``` 191 - 192 - Run nixos generate config and cd into it 193 - 194 - ```bash 195 - nixos-generate-config --root /mnt 196 - cd /mnt/etc/nixos 197 - ``` 198 - 199 - Clone this repo to your `/mnt/etc/nixos` folder 200 - 201 - ```bash 202 - rm * 203 - git clone https://github.com/taciturnaxolotl/dots.git . 204 - ``` 205 - 206 - Add your ssh private key to `/mnt/etc/ssh/id_rsa` 207 - 208 - install the flake, and umount the filesystem, and then reboot 209 - 210 - ```bash 211 - nixos-install --flake .#moonlark --no-root-passwd 212 - reboot 213 - ``` 214 - 215 - Pray to the nix gods that it works 🙏 216 - 217 - If it worked then you should be able to login with the user `kierank` and the password `lolzthisaintsecure!` 218 - 219 - You should immediately change the password 145 + After first boot, log in with user `kierank` and the default password, then change it immediately: 220 146 221 147 ```bash 222 148 passwd kierank 223 149 ``` 224 150 225 - Move the config to your local directory, link to `/etc/nixos`, and change permissions 151 + Move the config to your home directory and symlink: 226 152 227 153 ```bash 228 154 sudo mv /etc/nixos ~/dots 229 155 sudo ln -s ~/dots /etc/nixos 230 156 sudo chown -R $(id -un):users ~/dots 231 - sudo chown kierank -R ~/dots 232 - sudo chown kierank -R ~/dots/.* 233 157 ``` 234 158 235 - 17. Setup the fingerprint reader and verify it works (you may need to swipe your finger across the fingerprint sensor instead of simply laying it there) 236 - 237 - ```bash 238 - sudo fprintd-enroll -f right-index-finger kierank 239 - sudo fprintd-verify kierank 240 - ``` 241 - 242 - Finally enable [atuin](https://atuin.sh/) 159 + Set up [atuin](https://atuin.sh/) for shell history sync: 243 160 244 161 ```bash 245 162 atuin login