diff options
| -rw-r--r-- | CLAUDE.md | 57 | ||||
| -rw-r--r-- | flake.nix | 11 | ||||
| -rw-r--r-- | home/mun/default.nix | 2 | ||||
| -rw-r--r-- | home/rices/cassette-futurism/system.nix | 13 | ||||
| -rw-r--r-- | hosts/herra/configuration.nix | 1 | ||||
| -rwxr-xr-x | hosts/kronos/configuration.nix | 1 | ||||
| -rw-r--r-- | hosts/mystra/configuration.nix | 1 |
7 files changed, 56 insertions, 30 deletions
@@ -9,17 +9,27 @@ NixOS flake configuration for multiple machines (kronos laptop, herra desktop) u ## Common Commands ```bash -# Apply configuration +# Apply configuration (full rebuild and activation) sudo nixos-rebuild switch -# Test without applying +# Test configuration without making it the default boot option sudo nixos-rebuild test -# Validate flake syntax +# Validate flake syntax and check for errors nix flake check -# Preview changes +# Preview what changes would be made sudo nixos-rebuild dry-run + +# Update flake inputs to latest versions +nix flake update + +# Update specific input (e.g., nixpkgs) +nix flake lock --update-input nixpkgs + +# Build for specific host +sudo nixos-rebuild switch --flake .#kronos +sudo nixos-rebuild switch --flake .#herra ``` ## Architecture @@ -44,31 +54,52 @@ home/rices/{nord-blue,original}/ # Desktop themes ## Key Files -- `flake.nix` - Defines inputs (nixpkgs, home-manager, stylix, fenix) -- `hosts/kronos/configuration.nix` - Laptop config -- `hosts/herra/configuration.nix` - Desktop config (dual-boot) +- `flake.nix` - Defines inputs (nixpkgs, nixpkgs-unstable, home-manager, stylix, fenix, crane, nixowos) and outputs +- `hosts/kronos/configuration.nix` - Laptop-specific config (minimal: just hostname) +- `hosts/herra/configuration.nix` - Desktop config (dual-boot with Windows 11, uses GRUB OS prober) - `system/default.nix` - System module orchestrator - `system/packages.nix` - System-wide packages -- `home/mun/default.nix` - User orchestrator (imports active rice) -- `home/rices/nord-blue/variables.nix` - Active rice colors +- `home/mun/default.nix` - User orchestrator (imports active rice, user packages, programs) +- `home/rices/nord-blue/variables.nix` - Active rice color definitions +- `home/rices/nord-blue/default.nix` - Active rice module orchestrator ## Adding Configurations -**New system package:** Add to `system/packages.nix` +**New system package:** Add to `system/packages.nix` under `environment.systemPackages` + +**New user package:** Add to `home/mun/default.nix` under `home.packages` (supports fenix Rust toolchain, TeX Live combinations, RetroArch cores) **New system module:** Create in `system/`, add to `system/default.nix` imports **New user program:** Create in `home/mun/programs/`, add to `home/mun/default.nix` imports -**New rice module:** Create in active rice directory, add to its `default.nix` +**New rice module:** Create in active rice directory (`home/rices/nord-blue/`), add to its `default.nix` imports -**New rice:** Create `home/rices/my-rice/` with `default.nix` and `variables.nix` +**New rice:** Create `home/rices/my-rice/` with `default.nix` (imports modules) and `variables.nix` (colors, wallpaper) ## Switching Rices Edit `home/mun/default.nix` to change the rice import: ```nix -../rices/nord-blue # or ../rices/original +imports = [ + ./programs/zsh.nix + ./programs/ssh.nix + ./programs/git.nix + ../rices/nord-blue # Current: alacritty, i3, nvim, helix, picom, fastfetch + # ../rices/original # Alternative: kitty, i3, polybar, rofi, dunst, neovim, nnn, picom +]; ``` Then: `sudo nixos-rebuild switch` + +## Important Architecture Details + +**Overlays:** Flake provides `pkgs.unstable.*` for accessing bleeding-edge packages from nixpkgs-unstable while staying on stable 25.11 + +**NixOwOs Integration:** Enabled in `home/mun/default.nix` for NixOS branding/theming (os-release customization, overlays) + +**Machine Separation:** Host configs are intentionally minimal (hostname + hardware). All shared system config lives in `system/`, all shared user config in `home/mun/` + +**Rice Philosophy:** Rices are purely home-manager level. Desktop environment (X11 + i3wm base) is defined in `system/desktop.nix`, rices only configure appearance/theming + +**Stylix:** System-level theming framework imported at flake level, configured in `system/stylix.nix` @@ -76,8 +76,8 @@ }; }; - # Helper to create a NixOS system - mkSystem = hostname: + # Helper to create a NixOS system with rice + mkSystem = hostname: rice: nixpkgs.lib.nixosSystem { inherit system; specialArgs = {inherit inputs;}; @@ -91,6 +91,7 @@ } ./hosts/${hostname}/configuration.nix ./system + ./home/rices/${rice}/system.nix home-manager.nixosModules.home-manager nixowos.nixosModules.default stylix.nixosModules.stylix @@ -99,9 +100,9 @@ }; in { nixosConfigurations = { - kronos = mkSystem "kronos"; - herra = mkSystem "herra"; - mystra = mkSystem "mystra"; + kronos = mkSystem "kronos" "nord-blue"; + herra = mkSystem "herra" "cassette-futurism"; + mystra = mkSystem "mystra" "nord-blue"; }; }; } diff --git a/home/mun/default.nix b/home/mun/default.nix index 1d0f449..71b844b 100644 --- a/home/mun/default.nix +++ b/home/mun/default.nix @@ -1,6 +1,6 @@ { pkgs, - hostname, + hostname ? "kronos", ... }: let # Hostname-aware rice selection diff --git a/home/rices/cassette-futurism/system.nix b/home/rices/cassette-futurism/system.nix index 4a5baef..a998a2c 100644 --- a/home/rices/cassette-futurism/system.nix +++ b/home/rices/cassette-futurism/system.nix @@ -13,14 +13,11 @@ in { overrideColors = true; base16Scheme = vars.base16; - # Try user wallpaper, fallback to NixOS mosaic - wallpaper = - if builtins.pathExists vars.wallpaper - then vars.wallpaper - else pkgs.fetchurl { - url = vars.wallpaperFallback; - sha256 = "sha256-zVW0KZ26u2bjEMCf/hI/0FftCge+2hHLWbx/ijKSZ6U="; - }; + # Use fallback wallpaper (user can customize by replacing this) + wallpaper = pkgs.fetchurl { + url = vars.wallpaperFallback; + sha256 = "sha256-zVW0KZ26u2bjEMCf/hI/0FftCge+2hHLWbx/ijKSZ6U="; + }; # Retro fonts - VT323 for that authentic terminal look fonts = { diff --git a/hosts/herra/configuration.nix b/hosts/herra/configuration.nix index 9f104b8..2e0dd75 100644 --- a/hosts/herra/configuration.nix +++ b/hosts/herra/configuration.nix @@ -1,7 +1,6 @@ {...}: { imports = [ ./hardware-configuration.nix - ../../home/rices/cassette-futurism/system.nix ]; networking.hostName = "herra"; diff --git a/hosts/kronos/configuration.nix b/hosts/kronos/configuration.nix index decaf33..d032921 100755 --- a/hosts/kronos/configuration.nix +++ b/hosts/kronos/configuration.nix @@ -1,7 +1,6 @@ {...}: { imports = [ ./hardware-configuration.nix - ../../home/rices/nord-blue/system.nix ]; networking.hostName = "kronos"; diff --git a/hosts/mystra/configuration.nix b/hosts/mystra/configuration.nix index a67cdf3..24d906c 100644 --- a/hosts/mystra/configuration.nix +++ b/hosts/mystra/configuration.nix @@ -1,7 +1,6 @@ {...}: { imports = [ ./hardware-configuration.nix - ../../home/rices/nord-blue/system.nix ]; networking.hostName = "mystra"; } |
