Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stylix only applies to NixOS modules, not home-manager #617

Open
dazzy25 opened this issue Nov 10, 2024 · 3 comments
Open

Stylix only applies to NixOS modules, not home-manager #617

dazzy25 opened this issue Nov 10, 2024 · 3 comments
Labels
bug Something isn't working properly

Comments

@dazzy25
Copy link

dazzy25 commented Nov 10, 2024

I've been facing this issue for a couple of days that stylix only themes my system packages but not the ones installed by home-manager. For example, gnome-shell is themed but not the gnome programs that use gtk, the linux terminal is also themed but not my kitty terminal.
I've tried playing around with the configs, reading the installation docs.
At this point I don't know what is wrong with it, from the docs it was supposed to be almost plug and play
The relevant parts of my config:

  • flake.nix
inputs = {
    stylix = {
      url = "github:danth/stylix";
      inputs = {
        nixpkgs.follows = "nixpkgs";
        home-manager.follows = "home-manager";
      };
    };
    ...
};

outputs = inputs @ {
    self,
    nixpkgs,
    home-manager,
    ...
  }:
  ...
  in {
    nixosConfigurations.system = nixpkgs.lib.nixosSystem {
      inherit system;
      specialArgs = {
        inherit inputs outputs user hostname;
      };
      modules = [
        ./system/configuration.nix
        inputs.stylix.nixosModules.stylix
      ];
    };

    homeConfigurations.${user} = home-manager.lib.homeManagerConfiguration {
      pkgs = nixpkgs.legacyPackages.${system};
      extraSpecialArgs = {
        inherit inputs outputs user hostname;
      };
      modules = [
        ./user/home.nix
	   inputs.nixvim.homeManagerModules.nixvim
      ];
    };
  };

  • configuration.nix
...
imports = [
    ./hardware-configuration.nix
    ./stylix.nix
  ];
...
  • stylix.nix
{ pkgs, inputs, ... }:
{
    stylix.enable = true;
    stylix.targets.gtk.enable = true;
    stylix.targets.nixvim.enable = true;

    stylix.image = ../assets/walls_dots.png;

    stylix.fonts = {
        monospace = {
            package = pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];};
            name = "JetBrainsMono Nerd Font Mono";
        };
    };

    stylix.base16Scheme = {
    ...
    };
}
@trueNAHO
Copy link
Collaborator

Does #302 help?

@rvveber
Copy link

rvveber commented Nov 14, 2024

I had this issue too, i think because some programs can only be configured on user side.
I looked for it in the wiki but couldn't find it.
So maybe i'm hallucinating the exact reason, but this did fix it for me:

In addition to:

stylix.enable = true;

you need:

home-manager.sharedModules = [
  stylix.enable = true;
];

(sharedModules does it for all users)
You can check my config to see how it is implemented

@danth danth added the bug Something isn't working properly label Dec 10, 2024
@danth
Copy link
Owner

danth commented Dec 10, 2024

Because your flake has separate nixosConfigurations and homeConfigurations, you need to import Stylix and your stylix.nix into each of them individually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working properly
Projects
None yet
Development

No branches or pull requests

4 participants