diff options
| author | Natasha Moongrave <natasha@256phi.eu> | 2026-04-07 12:05:17 +0200 |
|---|---|---|
| committer | Natasha Moongrave <natasha@256phi.eu> | 2026-04-07 12:05:17 +0200 |
| commit | 31f8b7a3475cfe6f6c98aac0835477c5190f1d8e (patch) | |
| tree | 55a4c93f4df6ea7bca8a51ffafb2eb6dc4359b80 | |
| parent | b36a8271ad7e52d2ecfcf93ce98ce238c833f4a3 (diff) | |
| parent | eaf2ae5fbcbdfecb7d07aa1067b2e55209fcd411 (diff) | |
Merge branch 'refactor-rice-system'
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | README.md | 104 | ||||
| -rw-r--r-- | flake.nix | 9 | ||||
| -rw-r--r-- | home/mun/default.nix | 1 | ||||
| -rw-r--r-- | home/rices/nord-blue/default.nix | 15 | ||||
| -rw-r--r-- | home/rices/nord-blue/home.nix | 10 | ||||
| -rw-r--r-- | home/rices/original/default.nix | 16 | ||||
| -rw-r--r-- | home/rices/original/home.nix | 14 | ||||
| -rw-r--r-- | home/rices/plasma6/default.nix | 8 | ||||
| -rw-r--r-- | home/rices/plasma6/home.nix | 4 | ||||
| -rw-r--r-- | home/rices/plasma6/plasma.nix | 31 | ||||
| -rw-r--r-- | home/rices/plasma6/stylix.nix | 33 | ||||
| -rw-r--r-- | home/rices/plasma6/system.nix | 93 | ||||
| -rw-r--r-- | hosts/herra/packages.nix | 6 | ||||
| -rw-r--r-- | system/rice-desktop.nix | 193 |
15 files changed, 210 insertions, 328 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2be92b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result @@ -42,19 +42,19 @@ system/ # System-wide base config ├─ packages.nix, programs.nix, services.nix └─ users.nix, nix.nix -home/rices/{rice}/system.nix # Rice system config - ├─ Desktop (X11 + i3wm) - └─ Stylix (theming) +home/rices/{rice}/ # Rice configs (self-contained) + ├─ default.nix # Exports {system, home} + ├─ system.nix # NixOS: Desktop + Stylix + └─ home.nix # HM: imports program configs home/mun/ # User "mun" config └─ default.nix # User orchestrator - ├─ programs/ # git, ssh, zsh - └─ (imports rice via specialArgs) + └─ programs/ # git, ssh, zsh -home/rices/ # Desktop rices (home-manager) - ├─ nord-blue/ # Complete rice - ├─ original/ # Complete rice - └─ cosmic/ # WIP rice +home/rices/ # Desktop rices + ├─ nord-blue/ # Complete rice (i3wm) + ├─ original/ # Complete rice (i3wm) + └─ plasma6/ # Complete rice (KDE Plasma) ``` ## Directory Structure @@ -100,9 +100,10 @@ home/rices/ # Desktop rices (home-manager) │ └── zsh.nix │ └── rices/ # Desktop themes - ├── nord-blue/ # Complete rice - │ ├── system.nix # Desktop + stylix config - │ ├── default.nix # Home-manager modules + ├── nord-blue/ # Complete rice (i3wm) + │ ├── default.nix # Exports {system, home} + │ ├── system.nix # NixOS: Desktop + stylix + │ ├── home.nix # HM: imports all configs │ ├── i3.nix │ ├── alacritty.nix │ ├── nvim.nix @@ -110,9 +111,10 @@ home/rices/ # Desktop rices (home-manager) │ ├── picom.nix │ └── fastfetch.nix │ - ├── original/ # Complete rice - │ ├── system.nix # Desktop + stylix config - │ ├── default.nix # Home-manager modules + ├── original/ # Complete rice (i3wm) + │ ├── default.nix # Exports {system, home} + │ ├── system.nix # NixOS: Desktop + stylix + │ ├── home.nix # HM: imports all configs │ ├── variables.nix # Color definitions │ ├── i3.nix │ ├── kitty.nix @@ -125,10 +127,11 @@ home/rices/ # Desktop rices (home-manager) │ ├── scripts.nix │ └── xdg.nix │ - └── cosmic/ # WIP rice - ├── system.nix # Desktop + stylix config - ├── default.nix # Home-manager modules - └── fluxbox.nix + └── plasma6/ # Complete rice (KDE Plasma) + ├── default.nix # Exports {system, home} + ├── system.nix # NixOS: Plasma + stylix + ├── home.nix # HM: Plasma configs + └── variables.nix # Wallpaper path ``` ## Configuration Layers @@ -139,14 +142,14 @@ Base system config applied to all machines: boot, networking, audio, graphics, p ### 2. Machine Layer (`hosts/`) Per-machine identity (hostname), hardware configuration, and optional machine-specific overrides (e.g., herra uses Zen kernel). -### 3. Rice System Layer (`home/rices/*/system.nix`) -Desktop environment (X11 + i3wm) and stylix theming (colors, fonts, cursor). Imported at system level in flake. +### 3. Rice Layer (`home/rices/*/`) +Self-contained desktop environment configs. Each rice exports `{system, home}`: +- **system.nix**: NixOS-level (desktop environment, system packages, stylix theming) +- **home.nix**: Home-manager level (imports program configs like i3, terminal, editor) +- **default.nix**: Exports both modules for flake consumption ### 4. User Layer (`home/mun/`) -User-specific programs: git, ssh, zsh config. Imports the active rice via specialArgs. - -### 5. Rice Home Layer (`home/rices/*/`) -Desktop application configs: window manager, terminal, editor, compositor. Imported at home-manager level. +User-specific shared programs: git, ssh, zsh config. Only contains configs shared across all rices. ## Adding Configurations @@ -168,7 +171,7 @@ environment.systemPackages = with pkgs; [ **New rice module:** 1. Create file in target rice directory (e.g., `home/rices/nord-blue/mymodule.nix`) -2. Add to that rice's `default.nix` imports +2. Add to that rice's `home.nix` imports ## Switching Rices @@ -177,25 +180,56 @@ Rices are assigned per-host in `flake.nix`. Edit the `nixosConfigurations` secti ```nix nixosConfigurations = { kronos = mkSystem "kronos" "nord-blue"; # Laptop uses nord-blue - herra = mkSystem "herra" "cosmic"; # Desktop uses cosmic + herra = mkSystem "herra" "plasma6"; # Desktop uses plasma6 mystra = mkSystem "mystra" "nord-blue"; # Another machine uses nord-blue }; ``` Then rebuild: `sudo nixos-rebuild switch` -Each rice is imported twice: -1. **System-level**: `home/rices/${rice}/system.nix` (desktop + stylix) -2. **Home-level**: `home/rices/${rice}` (app configs via specialArgs) +Each rice exports `{system, home}` from its `default.nix`: +1. **system**: Imported by `mkSystem` (NixOS modules - desktop, stylix) +2. **home**: Imported by `mkHomeManagerModule` (HM modules - program configs) ## Creating a New Rice 1. Create directory: `home/rices/my-rice/` -2. Create `system.nix` with desktop environment and stylix config -3. Create `default.nix` orchestrator (imports home-manager modules) -4. Add application configs (i3.nix, terminal, editor, etc.) -5. Optional: Create `variables.nix` for shared color variables -6. Assign to host in `flake.nix`: `myhost = mkSystem "myhost" "my-rice";` +2. Create `system.nix` with NixOS-level configs: + ```nix + {pkgs, ...}: { + services.xserver = { + enable = true; + windowManager.i3.enable = true; + # ... desktop environment config + }; + + stylix = { + enable = true; + # ... theming config + }; + } + ``` +3. Create `home.nix` with home-manager imports: + ```nix + {...}: { + imports = [ + ./i3.nix + ./terminal.nix + ./editor.nix + # ... program configs + ]; + } + ``` +4. Create `default.nix` to export both modules: + ```nix + { + system = import ./system.nix; + home = import ./home.nix; + } + ``` +5. Add application configs (i3.nix, terminal, editor, etc.) +6. Optional: Create `variables.nix` for shared variables +7. Assign to host in `flake.nix`: `myhost = mkSystem "myhost" "my-rice";` ## Machine-Specific Config @@ -70,7 +70,12 @@ inherit hostname; inherit rice; }; - users.mun = import ./home/mun; + users.mun = { + imports = [ + ./home/mun + ./home/rices/${rice}/home.nix + ]; + }; sharedModules = [ nixowos.homeModules.default ]; @@ -92,7 +97,7 @@ } ./hosts/${hostname}/configuration.nix ./system - ./home/rices/${rice}/default.nix + ./home/rices/${rice}/system.nix home-manager.nixosModules.home-manager nixowos.nixosModules.default stylix.nixosModules.stylix diff --git a/home/mun/default.nix b/home/mun/default.nix index 36d78f7..d149984 100644 --- a/home/mun/default.nix +++ b/home/mun/default.nix @@ -7,7 +7,6 @@ ./programs/zsh.nix ./programs/ssh.nix ./programs/git.nix - ../rices/${rice} ]; nixowos = { diff --git a/home/rices/nord-blue/default.nix b/home/rices/nord-blue/default.nix index 1eb5514..6b7865d 100644 --- a/home/rices/nord-blue/default.nix +++ b/home/rices/nord-blue/default.nix @@ -1,13 +1,4 @@ -{...}: { - imports = [ - ./alacritty.nix - ./i3.nix - ./nvim.nix - ./helix.nix - ./picom.nix - ./fastfetch.nix - ]; - - # Rice is purely home-manager level - # Desktop environment (X server, i3wm) is set in system/desktop.nix +{ + system = import ./system.nix; + home = import ./home.nix; } diff --git a/home/rices/nord-blue/home.nix b/home/rices/nord-blue/home.nix new file mode 100644 index 0000000..61d2af4 --- /dev/null +++ b/home/rices/nord-blue/home.nix @@ -0,0 +1,10 @@ +{...}: { + imports = [ + ./alacritty.nix + ./i3.nix + ./nvim.nix + ./helix.nix + ./picom.nix + ./fastfetch.nix + ]; +} diff --git a/home/rices/original/default.nix b/home/rices/original/default.nix index cb2b4ca..6b7865d 100644 --- a/home/rices/original/default.nix +++ b/home/rices/original/default.nix @@ -1,14 +1,4 @@ -{...}: { - imports = [ - ./dunst.nix - ./i3.nix - ./kitty.nix - ./neovim.nix - ./nnn.nix - ./picom.nix - ./polybar.nix - ./rofi.nix - ./scripts.nix - ./xdg.nix - ]; +{ + system = import ./system.nix; + home = import ./home.nix; } diff --git a/home/rices/original/home.nix b/home/rices/original/home.nix new file mode 100644 index 0000000..cb2b4ca --- /dev/null +++ b/home/rices/original/home.nix @@ -0,0 +1,14 @@ +{...}: { + imports = [ + ./dunst.nix + ./i3.nix + ./kitty.nix + ./neovim.nix + ./nnn.nix + ./picom.nix + ./polybar.nix + ./rofi.nix + ./scripts.nix + ./xdg.nix + ]; +} diff --git a/home/rices/plasma6/default.nix b/home/rices/plasma6/default.nix index d363548..6b7865d 100644 --- a/home/rices/plasma6/default.nix +++ b/home/rices/plasma6/default.nix @@ -1,6 +1,4 @@ -{...}: { - imports = [ - ./stylix.nix - ./plasma.nix - ]; +{ + system = import ./system.nix; + home = import ./home.nix; } diff --git a/home/rices/plasma6/home.nix b/home/rices/plasma6/home.nix new file mode 100644 index 0000000..0dd85ad --- /dev/null +++ b/home/rices/plasma6/home.nix @@ -0,0 +1,4 @@ +{...}: { + # Plasma-specific HM configs can go here + # For now, minimal/empty +} diff --git a/home/rices/plasma6/plasma.nix b/home/rices/plasma6/plasma.nix deleted file mode 100644 index 44270a8..0000000 --- a/home/rices/plasma6/plasma.nix +++ /dev/null @@ -1,31 +0,0 @@ -{pkgs, ...}: { - services.desktopManager.plasma6.enable = true; - - environment.plasma6.excludePackages = with pkgs; [ - kdePackages.elisa # Music player - kdePackages.kdepim-runtime # Akonadi agents - kdePackages.kmahjongg - kdePackages.kmines - kdePackages.konversation # IRC client - kdePackages.kpat # Solitaire - kdePackages.ksudoku - kdePackages.ktorrent - ]; - - environment.systemPackages = with pkgs; [ - # KDE Utilities - kdePackages.kcalc # Calculator - kdePackages.kcharselect # Character map - kdePackages.kclock # Clock app - kdePackages.kcolorchooser # Color picker - kdePackages.ksystemlog # System log viewer - kdiff3 # File/directory comparison tool - - # Hardware/System Utilities (Optional) - kdePackages.isoimagewriter # Write hybrid ISOs to USB - kdePackages.partitionmanager # Disk and partition management - hardinfo2 # System benchmarks and hardware info - wayland-utils # Wayland diagnostic tools - wl-clipboard # Wayland copy/paste support - ]; -} diff --git a/home/rices/plasma6/stylix.nix b/home/rices/plasma6/stylix.nix deleted file mode 100644 index 1c89567..0000000 --- a/home/rices/plasma6/stylix.nix +++ /dev/null @@ -1,33 +0,0 @@ -{pkgs, ...}: let - vars = import ./variables.nix; -in { - stylix = { - enable = true; - base16Scheme = "${pkgs.base16-schemes}/share/themes/espresso.yaml"; - polarity = "dark"; - - image = vars.image; - - fonts = { - serif = { - package = pkgs.dejavu_fonts; - name = "DejaVu Serif"; - }; - - sansSerif = { - package = pkgs.dejavu_fonts; - name = "DejaVu Sans"; - }; - - monospace = { - package = pkgs.dejavu_fonts; - name = "DejaVu Sans Mono"; - }; - - emoji = { - package = pkgs.noto-fonts-color-emoji; - name = "Noto Color Emoji"; - }; - }; - }; -} diff --git a/home/rices/plasma6/system.nix b/home/rices/plasma6/system.nix new file mode 100644 index 0000000..f195684 --- /dev/null +++ b/home/rices/plasma6/system.nix @@ -0,0 +1,93 @@ +{pkgs, ...}: let + vars = import ./variables.nix; +in { + # Enable Plasma 6 desktop (ly display manager is enabled in system/services.nix) + services.desktopManager.plasma6.enable = true; + + # X11 configuration + services.xserver = { + enable = true; + xkb = { + layout = "cz"; + options = "eurosign:e,caps:escape"; + }; + }; + + # Exclude unwanted KDE packages + environment.plasma6.excludePackages = with pkgs.kdePackages; [ + elisa # Music player + kdepim-runtime # Akonadi agents + kmahjongg + kmines + konversation # IRC client + kpat # Solitaire + ksudoku + ktorrent + ]; + + # KDE utilities and system packages + environment.systemPackages = with pkgs; [ + # KDE Utilities + kdePackages.kcalc # Calculator + kdePackages.kcharselect # Character map + kdePackages.kclock # Clock app + kdePackages.kcolorchooser # Color picker + kdePackages.ksystemlog # System log viewer + kdiff3 # File/directory comparison tool + + # Hardware/System Utilities + kdePackages.isoimagewriter # Write hybrid ISOs to USB + kdePackages.partitionmanager # Disk and partition management + hardinfo2 # System benchmarks and hardware info + wayland-utils # Wayland diagnostic tools + wl-clipboard # Wayland copy/paste support + ]; + + # Stylix theming + stylix = { + enable = true; + autoEnable = true; + base16Scheme = "${pkgs.base16-schemes}/share/themes/espresso.yaml"; + image = vars.image; + + fonts = { + monospace = { + package = pkgs.dejavu_fonts; + name = "DejaVu Sans Mono"; + }; + sansSerif = { + package = pkgs.dejavu_fonts; + name = "DejaVu Sans"; + }; + serif = { + package = pkgs.dejavu_fonts; + name = "DejaVu Serif"; + }; + emoji = { + package = pkgs.noto-fonts-color-emoji; + name = "Noto Color Emoji"; + }; + sizes = { + terminal = 11; + applications = 11; + desktop = 11; + }; + }; + + cursor = { + package = pkgs.bibata-cursors; + name = "Bibata-Modern-Classic"; + size = 24; + }; + + opacity = { + terminal = 0.95; + applications = 1.0; + desktop = 1.0; + popups = 0.95; + }; + + polarity = "dark"; + targets.nixos-icons.enable = false; + }; +} diff --git a/hosts/herra/packages.nix b/hosts/herra/packages.nix index d8c6755..f8c8c5d 100644 --- a/hosts/herra/packages.nix +++ b/hosts/herra/packages.nix @@ -3,16 +3,16 @@ # System btop radeontop - alsamixer + alsa-utils # provides alsamixer # Streaming / Recording obs-studio easyeffects - obs-ndi + # obs-ndi not available in current package set # Audio pavucontrol - jack + jack2 # Video ffmpeg diff --git a/system/rice-desktop.nix b/system/rice-desktop.nix deleted file mode 100644 index 78a63e9..0000000 --- a/system/rice-desktop.nix +++ /dev/null @@ -1,193 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: let - cfg = config.rice; -in { - options.rice = { - desktop = { - environment = lib.mkOption { - type = lib.types.enum ["i3" "plasma" "none"]; - default = "i3"; - description = "Desktop environment to use"; - }; - - wayland.enable = lib.mkOption { - type = lib.types.bool; - default = false; - description = "Enable Wayland support"; - }; - - compositor.enable = lib.mkOption { - type = lib.types.bool; - default = true; - description = "Enable picom compositor (for X11 environments)"; - }; - }; - - stylix = { - overrideColors = lib.mkOption { - type = lib.types.bool; - default = false; - description = "Override system stylix colors with rice-specific colors"; - }; - - base16Scheme = lib.mkOption { - type = lib.types.nullOr lib.types.attrs; - default = null; - description = "Custom Base16 color scheme"; - }; - - wallpaper = lib.mkOption { - type = lib.types.nullOr lib.types.path; - default = null; - description = "Custom wallpaper path or derivation"; - }; - - fonts = lib.mkOption { - type = lib.types.nullOr lib.types.attrs; - default = null; - description = "Custom font configuration"; - }; - }; - }; - - config = lib.mkMerge [ - # Default stylix configuration (can be overridden by rices) - { - stylix = { - enable = true; - autoEnable = true; - - # Default Base16 scheme - Nord Blue inspired - base16Scheme = lib.mkDefault { - base00 = "2D333F"; # background - base01 = "3B4252"; # lighter background - base02 = "434C5E"; # selection background - base03 = "4C566A"; # comments - base04 = "D8DEE9"; # dark foreground - base05 = "C6D0F5"; # foreground - base06 = "E5E9F0"; # light foreground - base07 = "ECEFF4"; # lightest foreground - base08 = "BF616A"; # red - base09 = "D5A18E"; # orange/tan - base0A = "EBCB8B"; # yellow - base0B = "A3BE8C"; # green - base0C = "88C0D0"; # cyan - base0D = "82A3C0"; # blue (accent) - base0E = "B48EAD"; # purple - base0F = "5E81AC"; # dark blue - }; - - # Default wallpaper - image = lib.mkDefault (pkgs.fetchurl { - url = "https://raw.githubusercontent.com/NixOS/nixos-artwork/master/wallpapers/nix-wallpaper-simple-blue.png"; - sha256 = "sha256-utrcjzfeJoFOpUbFY2eIUNCKy5rjLt57xIoUUssJmdI="; - }); - - # Default fonts - fonts = lib.mkDefault { - monospace = { - package = pkgs.nerd-fonts.jetbrains-mono; - name = "JetBrainsMono Nerd Font"; - }; - sansSerif = { - package = pkgs.noto-fonts; - name = "Noto Sans"; - }; - serif = { - package = pkgs.noto-fonts; - name = "Noto Serif"; - }; - emoji = { - package = pkgs.noto-fonts-color-emoji; - name = "Noto Color Emoji"; - }; - sizes = { - terminal = 10; - applications = 11; - desktop = 11; - }; - }; - - # Default cursor - cursor = lib.mkDefault { - package = pkgs.bibata-cursors; - name = "Bibata-Modern-Classic"; - size = 24; - }; - - # Default opacity - opacity = lib.mkDefault { - terminal = 0.95; - applications = 1.0; - desktop = 1.0; - popups = 0.95; - }; - - # Default polarity - polarity = lib.mkDefault "dark"; - - # Disable nixos-icons to avoid conflict - targets.nixos-icons.enable = false; - }; - } - - # Rice-specific stylix overrides - (lib.mkIf cfg.stylix.overrideColors { - stylix = { - base16Scheme = lib.mkIf (cfg.stylix.base16Scheme != null) (lib.mkForce cfg.stylix.base16Scheme); - image = lib.mkIf (cfg.stylix.wallpaper != null) (lib.mkForce cfg.stylix.wallpaper); - fonts = lib.mkIf (cfg.stylix.fonts != null) (lib.mkForce cfg.stylix.fonts); - }; - }) - - # i3 desktop environment - (lib.mkIf (cfg.desktop.environment == "i3") { - services.xserver = { - enable = true; - windowManager.i3.enable = true; - - # Czech QWERTZ layout - xkb = { - layout = "cz"; - options = "eurosign:e,caps:escape"; - }; - }; - - # Compositor for X11 - services.picom.enable = cfg.desktop.compositor.enable; - }) - - # KDE Plasma desktop environment - (lib.mkIf (cfg.desktop.environment == "plasma") { - # Enable KDE Plasma 6 - services.displayManager.sddm = { - enable = true; - wayland.enable = cfg.desktop.wayland.enable; - }; - - services.desktopManager.plasma6.enable = true; - - # X11 configuration for Plasma (if not using Wayland) - services.xserver = { - enable = true; - xkb = { - layout = "cz"; - options = "eurosign:e,caps:escape"; - }; - }; - - # KDE-specific packages - environment.systemPackages = with pkgs; [ - kdePackages.kate - kdePackages.konsole - kdePackages.dolphin - kdePackages.spectacle - kdePackages.gwenview - ]; - }) - ]; -} |
