# expede's Dotfiles Nix configurations for NixOS. Floral-themed hostnames throughout. ## Hosts | Host | Platform | Type | Description | |----------|--------------|---------|-----------------------------------------| | dahlia | x86_64-linux | Desktop | niri session, AMD GPU, Jellyfin, Steam | | kielo | x86_64-linux | Server | hel.subduction.keyhive.org | | wisteria | x86_64-linux | Laptop | Framework 13, niri session, fingerprint | ## Rebuild All commands run from the `nix/` directory. ### macOS (Latte) ```bash darwin-rebuild switch --flake .#Latte ``` ### NixOS ```bash # Desktop sudo nixos-rebuild switch --flake .#dahlia # Server sudo nixos-rebuild switch --flake .#kielo ``` ### Update Flake Inputs ```bash # Update all inputs nix flake update # Update specific input nix flake lock --update-input nixpkgs ``` ### Doom Emacs After changes to `nix/modules/home/doom/`: ```bash doom sync ``` ## Initial Setup ### macOS (Latte) 1. Install Nix (Determinate Systems installer recommended): ```bash curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install ``` 2. Clone this repo: ```bash git clone https://github.com/expede/dots.git ~/Documents/dots cd ~/Documents/dots/nix ``` 3. Bootstrap nix-darwin (first run only): ```bash nix run nix-darwin -- switch --flake .#Latte ``` 4. Subsequent rebuilds use: ```bash darwin-rebuild switch --flake .#Latte ``` 5. Set Fish as default shell: ```bash echo /run/current-system/sw/bin/fish | sudo tee -a /etc/shells chsh -s /run/current-system/sw/bin/fish ``` 6. Install Doom Emacs: ```bash git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs ~/.config/emacs/bin/doom install doom sync ``` 7. Configure 1Password SSH agent — enable in 1Password settings: - Settings > Developer > SSH Agent > Enable - Settings > Developer > CLI > Enable CLI integration ### NixOS (dahlia / kielo) 1. Boot NixOS installer (minimal ISO recommended) 2. Partition disks and mount at `/mnt` (host-specific, see `nixos/hosts//hardware.nix`) 3. Clone this repo: ```bash nix-shell -p git git clone https://github.com/expede/dots.git /mnt/etc/nixos/dots ``` 4. Generate hardware config (optional, compare with existing): ```bash nixos-generate-config --root /mnt --show-hardware-config ``` 5. Install: ```bash cd /mnt/etc/nixos/dots/nix nixos-install --flake .# ``` 6. After reboot, move dots to home and rebuild: ```bash sudo mv /etc/nixos/dots ~/Documents/dots sudo chown -R $USER:users ~/Documents/dots cd ~/Documents/dots/nix sudo nixos-rebuild switch --flake .# ``` 7. Set Fish as default shell: ```bash chsh -s $(which fish) ``` 8. Install Doom Emacs (desktop only): ```bash git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs ~/.config/emacs/bin/doom install doom sync ``` ## Templates ### Rust Scaffold a new Rust project with pinned toolchain, nightly rustfmt, and dev commands: ```bash # From any directory nix flake init -t github:expede/dots#rust # Enter dev shell nix develop ``` Type `menu` in the dev shell to see available commands: | Command | Description | |---------|-------------| | `build` | Compile the project | | `test` | Run tests (with watch mode) | | `lint` | Run clippy | | `fmt` | Format with nightly rustfmt | | `doc` | Generate documentation | | `watch` | Watch for changes | #### Configuration Edit `flake.nix` to customize: ```nix # Pin Rust version rustVersion = "1.90.0"; # Enable cross-compilation targets (darwin, linux-musl, wasm, embedded) enableCrossTargets = true; ``` #### Included Tools - **Toolchain:** cargo, clippy, rust-src, rust-std, llvm-tools-preview - **Formatting:** nightly rustfmt, alejandra, taplo - **Cargo extensions:** cargo-deny, cargo-expand, cargo-nextest, cargo-outdated, cargo-sort, cargo-udeps, cargo-watch ## Structure ``` nix/ ├── flake.nix # Central flake with mkSystem abstraction ├── darwin/ # macOS-specific (nix-darwin) ├── nixos/hosts/ # NixOS host configurations ├── templates/ # Project templates │ └── rust/ # Rust project template └── modules/home/ # Home-manager modules ├── hosts/ # Per-host overrides └── doom/ # Doom Emacs configuration ```