I’ve done lots of looking up and reading the documentation multiple times but it seems to be missing something. The theme isn’t applied to programs.
I installed Stylix looking at the installation page, and the home manager module, both as flakes. It says "Installing Home Manager as a NixOS moduleis highly recommended" and “When Stylix is installed and enabled in a NixOS configuration, it will automatically set up its Home Manager modules if it detects that Home Manager is available”.
I have pkgs.base16-schemes installed but the theme is not applied to any of the programs. Even when I try having them installed via home-manager instead (in configuration.nix):
Should already be working, what’s the issue? See the very next paragraph:
When Stylix is installed and enabled in a NixOS configuration, it will automatically set up its Home Manager modules if it detects that Home Manager is available
When I just have inputs.stylix.nixosModules.stylix, the colorscheme isn’t applied to kitty or neovim.
When I comment out inputs.stylix.nixosModules.stylix and just do inputs.stylix.homeModules.stylix I get error: The option dconf does not exist.
When I add both I get this error (I don’t have gnome installed):
error: The option `stylix.targets.gnome.enable' in `/nix/store/r0pfy9hccrvw2g1k46a3n34ijs34787p-source/modules/gnome/hm.nix' is already declared in `/nix/store/r0pfy9hccrvw2g1k46a3n34ijs34787p-source/modules/gnome/nixos.nix'.
YMMV, sometimes stylix must edit the single configuration file of the program in question (I imagine this applies to kitty), so there is no real way to do this without using home-manager to configure it in general.
I don’t like this either; This, and some other limitations of stylix, means that I’ve just gone back to doing it by hand everywhere again.
That won’t help (and is the default setting), because as I said, stylix needs you to inspect the home-manager module’s enable option to even know you’re using a specific application.
You need to explicitly add what @eblechschmidt suggests, and even then it may or may not be good enough depending on the application. If you want to use home-manager to configure themes, you’ll have to actually use home-manager to configure your applications.
Then move your home-manager configuration into home.nix:
# home.nix
{ pkgs, ... }: {
home = {
# Remember not to touch this, no
# it's not for updating, no it should
# not be changed when updating
stateVersion = "25.11";
packages = [
pkgs.kitty
pkgs.neovim
pkgs.fish
pkgs.bat
pkgs.yazi
pkgs.neovide
];
};
stylix.targets.neovim.enable = true;
# Any other config here
}
I applied the changes but I don’t know why the colorscheme doesn’t show up in nvim. I have a feel there’s something I’m overlooking and maybe obvious but don’t know.
I suspect that neovim when enabled on system level will create the config in a different location than Stylix and hence the Stylix config will not be used. Have you tried enabling it in hm?
Forcing it for neovim likely won’t do anything without home-manager’s further intervention, since its config is rather complex and likely involves multiple files that depend on each other. You won’t make headway here without reading the source and understanding how to weave it into how your configuration works.
It might work for other applications, but stylix isn’t magic, you still have to understand what you’re doing.
What should I do then? I have a whole neovim configuration, I moved it out ~/.config and rebuilt my flake but it still shows the default colorscheme after reopening it.