Kieran's opinionated (and probably slightly dumb) nix config
1# Kieran's Dots 2 3![nix rebuild with flake update](.github/images/nix-update.webp) 4 5> [!CAUTION] 6> These dots are highly prone to change / breakage. 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.~ 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. 11 12## The layout 13 14```bash 15~/dots # symlinked to /etc/nixos 16├── home-manager # all the configs that use home manager are stored centrally here 17│ ├── dots # any config files that need to be symlinked go here, e.g. my hyprland config 18│ │ └── wallpapers 19│ ├── machines # the different machines by hostname 20│ │ ├── ember 21│ │ ├── moonlark 22│ │ ├── nest 23│ │ └── tacyon 24│ └── modules 25│ ├── aesthetics # theming and wallpapers 26│ ├── apps # any app specific config 27│ ├── system # nxipkgs stuff mainly 28│ └── wm # window managers; just hyprland for now 29│ └── hyprland 30├── nixos 31│ ├── machines # again machines by hostname 32│ │ └── moonlark 33│ └── modules 34│ ├── apps # also app specific configs 35│ └── system # pam and my fancy wifi module for now 36└── secrets 37 3816 directories 39``` 40 41## Installation 42 43> [!WARNING] 44> Also to note that this configuration will **not** work if you do not change any of the [secrets](./secrets) since they are encrypted. 45 46You could either install a NixOS machine (rn there is just `moonlark`) or you can use the home-manager instructions 47 48### Home Manager 49 50Install nix via the determinate systems installer 51 52```bash 53curl -fsSL https://install.determinate.systems/nix | sh -s -- install --determinate 54``` 55 56then copy ssh keys and chmod them 57 58```bash 59scp .ssh/id_rsa* nest:/home/kierank/.ssh/ 60ssh nest chmod 600 ~/.ssh/id_rsa* 61``` 62 63and then clone the repo 64 65```bash 66git clone git@github.com:taciturnaxolotl/dots.git 67cd dots 68``` 69 70and execute the machine profile 71 72```bash 73nix-shell -p home-manager 74home-manager switch --flake .#nest 75``` 76 77setup atuin and import previous shell history 78 79```bash 80atuin login 81atuin import 82``` 83 84### NixOS 85 86> These instructions have been validated by installing on my friend's machine ([`Nat2-Dev/dots`](https://github.com/Nat2-Dev/dots)) 87 88You have two options for installation: either the full guide as follows or the install script below and instructions in [INSTALL_GUIDE.md](/INSTALL_GUIDE.md) 89 90```bash 91curl -L https://raw.githubusercontent.com/taciturnaxolotl/dots/main/install.sh -o install.sh 92chmod +x install.sh 93./install.sh 94``` 95 96#### The manual way 97 98Install NixOS via the [official guide](https://nixos.org/download.html) 99 100Connect to wifi 101 102```bash 103wpa_passphrase your-ESSID your-passphrase | sudo tee /etc/wpa_supplicant.conf 104sudo systemctl restart wpa_supplicant 105``` 106 107Check with `ping 1.1.1.1` if that doesn't work then use `wpa_cli` 108 109```bash 110sudo systemctl start wpa_supplicant 111wpa_cli 112 113add_network 0 114 115set_network 0 ssid "put your ssid here" 116 117set_network 0 psk "put your password here" 118 119enable network 0 120 121exit 122``` 123 124Aquire root permissions while keeping your current context with 125 126```bash 127sudo -i 128``` 129 130Enable git and rebuild your flake with the following 131 132```bash 133sed -i 's/^{$/{\n programs.git.enable = true;/' /etc/nixos/configuration.nix 134nixos-rebuild switch 135``` 136 137Download the disk configuration and run it 138 139```bash 140curl -L https://github.com/taciturnaxolotl/dots/raw/main/moonlark/disk-config.nix -o /tmp/disk-config.nix 141nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode destroy,format,mount /tmp/disk-config.nix 142``` 143 144Run nixos generate config and cd into it 145 146```bash 147nixos-generate-config --root /mnt 148cd /mnt/etc/nixos 149``` 150 151Clone this repo to your `/mnt/etc/nixos` folder 152 153```bash 154rm * 155git clone https://github.com/taciturnaxolotl/dots.git . 156``` 157 158Add your ssh private key to `/mnt/etc/ssh/id_rsa` 159 160install the flake, and umount the filesystem, and then reboot 161 162```bash 163nixos-install --flake .#moonlark --no-root-passwd 164reboot 165``` 166 167Pray to the nix gods that it works 🙏 168 169If it worked then you should be able to login with the user `kierank` and the password `lolzthisaintsecure!` 170 171You should immediately change the password 172 173```bash 174passwd kierank 175``` 176 177Move the config to your local directory, link to `/etc/nixos`, and change permissions 178 179```bash 180sudo mv /etc/nixos ~/dots 181sudo ln -s ~/dots /etc/nixos 182sudo chown -R $(id -un):users ~/dots 183sudo chown kierank -R ~/dots 184sudo chown kierank -R ~/dots/.* 185``` 186 18717. 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) 188 189```bash 190sudo fprintd-enroll -f right-index-finger kierank 191sudo fprintd-verify kierank 192``` 193 194Finally enable [atuin](https://atuin.sh/) 195 196```bash 197atuin login 198atuin sync 199``` 200 201## Screenshots 202 203<details> 204 <summary>I've stuck the rest of the screenshots in a spoiler to preserve space</summary> 205<br/> 206 207**Last updated: 2024-12-27** 208 209![the github page of this repo](.github/images/github.webp) 210![nautilus file manager](.github/images/nautilus.webp) 211![neofetch](.github/images/neofetch.webp) 212![spotify with cava next to it](.github/images/spotify.webp) 213![zed with the hyprland config open](.github/images/zed.webp) 214![cool-retro-term with neofetch](.github/images/cool-retro-term.webp) 215 216</details> 217 218## Credits 219 220Thanks a bunch to the following people for their dots, configs, and general inspiration which i've shamelessly stolen from: 221 222- [NixOS/nixos-hardware](https://github.com/NixOS/nixos-hardware) 223- [hyprland-community/hyprnix](https://github.com/hyprland-community/hyprnix) 224- [spikespaz/dotfiles](https://github.com/spikespaz/dotfiles) 225- [Misterio77/nix-starter-configs](https://github.com/Misterio77/nix-starter-configs) 226- [mccd.space install guide](https://mccd.space/posts/git-to-deploy/) 227- [disco docs](https://github.com/nix-community/disko/blob/master/docs/quickstart.md) 228- [XDG_CONFIG_HOME setting](https://github.com/NixOS/nixpkgs/issues/224525) 229- [Daru-san/spicetify-nix](https://github.com/Daru-san/spicetify-nix) 230- [agenix](https://nixos.wiki/wiki/Agenix) 231- [wpa_supplicant env file docs](https://search.nixos.org/options?show=networking.wireless.environmentFile&from=0&size=50&sort=relevance&type=packages&query=networking.wireless) 232- [escaping nix variables](https://www.reddit.com/r/NixOS/comments/jmlohf/escaping_interpolation_in_bash_string/) 233- [nerd fonts cheat sheet](https://www.nerdfonts.com/cheat-sheet) 234- [setting the default shell in nix](https://www.reddit.com/r/NixOS/comments/z16mt8/cant_seem_to_set_default_shell_using_homemanager/) 235- [hyprwm/contrib](https://github.com/hyprwm/contrib) 236- [gtk with home manager](https://hoverbear.org/blog/declarative-gnome-configuration-in-nixos/) 237- [setting up the proper portals](https://github.com/NixOS/nixpkgs/issues/274554) 238- [tuigreet setup](https://github.com/sjcobb2022/nixos-config/blob/29077cee1fc82c5296908f0594e28276dacbe0b0/hosts/common/optional/greetd.nix) 239 240## 📜 License 241 242The code is licensed under `MIT`! That means MIT allows for free use, modification, and distribution of the software, requiring only that the original copyright notice and disclaimer are included in copies. All artwork and images are copyright reserved but may be used with proper attribution to the authors. 243 244<p align="center"> 245 <img src="https://raw.githubusercontent.com/taciturnaxolotl/carriage/master/.github/images/line-break.svg" /> 246</p> 247 248<p align="center"> 249 <i><code>&copy 2025-present <a href="https://github.com/taciturnaxolotl">Kieran Klukas</a></code></i> 250</p> 251 252<p align="center"> 253 <a href="https://github.com/taciturnaxolotl/dots/blob/master/LICENSE.md"><img src="https://img.shields.io/static/v1.svg?style=for-the-badge&label=License&message=MIT&logoColor=d9e0ee&colorA=363a4f&colorB=b7bdf8"/></a> 254</p>