nixos/STYLIX_MIGRATION_WORK.md

5.5 KiB

Stylix Migration Work - COMPLETED

Summary of Work Completed

1. Replaced Catppuccin with Stylix

  • Removed catppuccin input from flake.nix
  • Added stylix input (release-25.11 branch to match NixOS version)
  • Added stylix.nixosModules.stylix to frame12 modules in flake.nix
  • Removed catppuccin modules from nate, nate-work, and frame12 configurations

2. Stylix Configuration

File: /home/nate/nixos/frame12/default.nix

stylix = {
  enable = true;
  image = ./wallpaper.png;
  base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-macchiato.yaml";
  polarity = "dark";

  # System-wide cursor
  cursor = {
    package = pkgs.bibata-cursors;
    name = "Bibata-Modern-Classic";
    size = 32;
  };

  # Fonts
  fonts = {
    serif = { package = pkgs.lato; name = "Lato"; };
    sansSerif = { package = pkgs.lato; name = "Lato"; };
    monospace = { package = pkgs.maple-mono.NF; name = "Maple Mono NF"; };
    emoji = { package = pkgs.noto-fonts-color-emoji; name = "Noto Color Emoji"; };
    sizes = {
      applications = 12;
      desktop = 10;
      popups = 10;
      terminal = 11;
    };
  };

  targets.plymouth.enable = false;  # Keep custom Framework plymouth theme
};

3. Stylix Auto-Enable in Home Manager

File: /home/nate/nixos/frame12/modules/home-manager/home.nix

  • Enabled stylix.autoEnable = true for automatic theming of all programs

4. Programs Converted to Nix Configuration

All programs below now use programs.<name>.enable = true with Stylix auto-theming:

File: /home/nate/nixos/frame12/modules/home-manager/programs.nix

Program Status Notes
Ghostty DONE Maple Mono NF with ligatures, keybinds
Foot DONE Minimal config, Stylix handles fonts/colors
Helix DONE Full config with Colemak-DH bindings, languages, LSP
Bat DONE Simple enable
Fzf DONE With zsh integration
Btop DONE Simple enable
Mpv DONE Simple enable
Wofi DONE Simple enable

File: /home/nate/nixos/shared/modules/home-manager/waybar.nix

Program Status Notes
Waybar DONE Shared module with parameterized options

5. Waybar Shared Module

Created parameterized waybar module for use across multiple machines:

  • File: /home/nate/nixos/shared/modules/home-manager/waybar.nix
  • Options:
    • waybarConfig.enable - Enable waybar with Stylix theming
    • waybarConfig.terminal - Terminal for on-click commands (default: "ghostty")
    • waybarConfig.launcher - App launcher command (default: "wofi --show=drun")
    • waybarConfig.fontSize - Base font size (default: 16)
    • waybarConfig.font - Font family (default: "Overpass Nerd Font")
    • waybarConfig.position - Bar position: top/bottom (default: "top")
    • waybarConfig.margin - Margin in pixels (default: 3)
    • waybarConfig.extraModulesLeft - Additional left modules
    • waybarConfig.extraModulesRight - Additional right modules
    • waybarConfig.windowRewriteRules - Additional window title rewrite rules
    • waybarConfig.workspaceIcons - Additional workspace icons

6. Dotfiles Deleted

Dotfile Status
/home/nate/nixos/frame12/dotfiles/ghostty/ DELETED
/home/nate/nixos/shared/dotfiles/ghostty/ DELETED
/home/nate/nixos/shared/linked-dotfiles/helix/ DELETED
/home/nate/nixos/frame12/linked-dotfiles/waybar/ DELETED
  • Removed helix from xdg.configFile in home.nix
  • Removed waybar from xdg.configFile in home.nix

8. Packages Removed from Manual Lists

From home.nix home.packages:

  • helix (now programs.helix)
  • ghostty (now programs.ghostty)
  • bat (now programs.bat)
  • fzf (now programs.fzf)
  • mpv (now programs.mpv)

From niri_home.nix home.packages:

  • wofi (now programs.wofi)
  • waybar (now programs.waybar via waybarConfig)

From niri_conf.nix environment.systemPackages:

  • foot (now programs.foot in home-manager)
  • waybar (now programs.waybar via waybarConfig)
  • wofi (now programs.wofi)

File Structure After Migration

frame12/modules/home-manager/
├── home.nix          # Main home config, imports programs.nix
└── programs.nix      # All Stylix-themed program configs

frame12/modules/niri/
├── niri_home.nix     # Niri home config, imports shared waybar.nix
└── niri_conf.nix     # Niri system config

shared/modules/home-manager/
└── waybar.nix        # Parameterized waybar module with Stylix theming

Applications WITHOUT Direct Stylix Support

These retain manual CSS/config with catppuccin colors:

Application Config Location Notes
SwayNC /home/nate/nixos/shared/dotfiles/swaync/ Manual CSS with catppuccin colors
Niri /home/nate/nixos/frame12/linked-dotfiles/niri/ Border colors are custom gradients

Testing

# Dry-run build (validates configuration)
nix build .#nixosConfigurations.frame12.config.system.build.toplevel --dry-run

# Full rebuild
sudo nixos-rebuild switch --flake .#frame12

# Validate niri config
niri validate

Reference: Stylix Base16 Color Variables

Stylix provides these CSS variables for waybar and other GTK apps:

  • @base00 through @base0F - Base16 color palette
  • Colors map to catppuccin-macchiato scheme

Reference: Stylix Documentation