fix: add stylix compatibility shims for missing program options
Stylix unconditionally imports all target modules, which expect certain program options to exist even when those programs aren't enabled. This causes evaluation errors. Add stylix-compat.nix with stub options for: - programs.neovim.initLua (maps to extraLuaConfig) - programs.opencode.tui/themes Also: - Disable neovim/neovide stylix targets (we deploy theme lua via theme-loader) - Set autoEnable = false to only enable explicitly listed targets - Enable programs.neovim to satisfy stylix's neovim target - Update stylix to latest version Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,7 @@ in
|
||||
imports = [
|
||||
inputs.nix-colors.homeManagerModules.default
|
||||
inputs.walker.homeManagerModules.default
|
||||
./stylix-compat.nix # Compatibility shims for stylix target modules
|
||||
./options.nix
|
||||
./state.nix
|
||||
./overrides.nix
|
||||
@@ -40,11 +41,13 @@ in
|
||||
|
||||
colorScheme = lib.mkDefault (nomarchyLib.getColorScheme config.nomarchy.theme);
|
||||
|
||||
# Enable neovim program module (required for stylix integration)
|
||||
programs.neovim.enable = lib.mkDefault true;
|
||||
|
||||
home.packages = lib.mkDefault (with pkgs; [
|
||||
# Core applications
|
||||
firefox
|
||||
xfce.thunar
|
||||
neovim
|
||||
|
||||
# Media
|
||||
imv # Image viewer
|
||||
|
||||
35
modules/home/stylix-compat.nix
Normal file
35
modules/home/stylix-compat.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
# Compatibility shims for stylix target modules
|
||||
# Stylix unconditionally imports all target modules, which expect certain
|
||||
# program options to exist. This module defines stub options for programs
|
||||
# we don't use to prevent evaluation errors.
|
||||
|
||||
{
|
||||
options = {
|
||||
# Neovim: stylix uses initLua but home-manager uses extraLuaConfig
|
||||
programs.neovim.initLua = lib.mkOption {
|
||||
type = lib.types.lines;
|
||||
default = "";
|
||||
description = "Lua code to run at init (compatibility shim for stylix)";
|
||||
};
|
||||
|
||||
# OpenCode: stylix expects programs.opencode options
|
||||
programs.opencode = {
|
||||
tui = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.anything;
|
||||
default = {};
|
||||
description = "OpenCode TUI settings (stylix compatibility shim)";
|
||||
};
|
||||
themes = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.anything;
|
||||
default = {};
|
||||
description = "OpenCode themes (stylix compatibility shim)";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.programs.neovim.initLua != "") {
|
||||
programs.neovim.extraLuaConfig = config.programs.neovim.initLua;
|
||||
};
|
||||
}
|
||||
@@ -39,6 +39,7 @@ in
|
||||
stylix = {
|
||||
enable = lib.mkDefault true;
|
||||
enableReleaseChecks = lib.mkDefault false;
|
||||
autoEnable = lib.mkDefault false; # Disable auto-detection, explicitly enable targets
|
||||
image = lib.mkDefault activeWallpaper;
|
||||
base16Scheme = lib.mkDefault currentPalette;
|
||||
|
||||
@@ -80,6 +81,8 @@ in
|
||||
targets = lib.mkDefault {
|
||||
hyprland.enable = false; # We keep our custom hyprland config for borders/rules
|
||||
waybar.enable = false; # We keep our custom waybar CSS
|
||||
neovim.enable = false; # We deploy theme lua files via theme-loader instead
|
||||
neovide.enable = false; # Neovide depends on neovim program module
|
||||
alacritty.enable = true;
|
||||
kitty.enable = true;
|
||||
gtk.enable = true;
|
||||
|
||||
Reference in New Issue
Block a user