Skip to content
\n

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):

\n
      home-manager.users.myUsername =\n        { config, ... }:\n        {\n          home = {\n            stateVersion = \"25.11\";\n            packages = [\n              pkgs.neovim\n              pkgs.fish\n              pkgs.yazi\n            ];\n          };\n        };
\n

My flake.nix:

\n
        {\n          inputs = {\n            home-manager = {\n              url = \"github:nix-community/home-manager\";\n              inputs.nixpkgs.follows = \"nixpkgs\";\n            };\n            stylix = {\n              url = \"github:danth/stylix\";\n              inputs.nixpkgs.follows = \"nixpkgs\";\n            };\n            nixpkgs.url = \"github:NixOS/nixpkgs/nixos-unstable\";\n          };\n        \n          outputs =\n            { self, nixpkgs, ... }@inputs:\n            {\n              nixosConfigurations.NixOS-MBP = nixpkgs.lib.nixosSystem {\n                specialArgs.flake-inputs = inputs;\n                modules = [\n                  {\n                    home-manager.useGlobalPkgs = true;\n                    home-manager.useUserPackages = true;\n                  }\n                  inputs.home-manager.nixosModules.home-manager\n                  inputs.stylix.nixosModules.stylix\n                  ./configuration.nix\n                  ./hardware-configuration.nix\n                ];\n              };\n            };\n        }
","upvoteCount":1,"answerCount":2,"acceptedAnswer":{"@type":"Answer","text":"

After lots of back and forth here, this seems to work:

\n

configuration.nix:

\n
# configuration.nix\n{ pkgs, flake-inputs, ... }: {\n  imports = [\n    ./hardware-configuration.nix\n    flake-inputs.home-manager.nixosModules.home-manager\n    flake-inputs.stylix.nixosModules.stylix\n  ];\n\n  stylix = {\n    base16Scheme = \"${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml\";\n    autoEnable = true;\n    enable = true;\n  };\n\n  home-manager = {\n    useGlobalPkgs = true;\n    useUserPackages = true;\n    # See next snippet\n    users.myUsername = import ./home.nix;\n  };\n\n  # Any other config here\n}\n
\n

home.nix:

\n
# home.nix\n{ pkgs, ... }: {\n  home = {\n    # Remember not to touch this, no\n    # it's not for updating, no it should\n    # not be changed when updating\n    stateVersion = \"25.11\";\n  };\n\n  stylix.targets.neovim.enable = true;\n  programs.neovim.enable = true;\n\n  # Any other config here\n}\n
\n

flake.nix:

\n
# somewhere in flake.nix\nnixosConfigurations.DeviceNameHere = nixpkgs.lib.nixosSystem {\n  specialArgs.flake-inputs = inputs;\n  modules = [\n    ./configuration.nix\n  ];\n}\n
","upvoteCount":1,"url":"https://github.com/nix-community/stylix/discussions/1757#discussioncomment-15018363"}}}
Discussion options

You must be logged in to vote

After lots of back and forth here, this seems to work:

configuration.nix:

# configuration.nix
{ pkgs, flake-inputs, ... }: {
  imports = [
    ./hardware-configuration.nix
    flake-inputs.home-manager.nixosModules.home-manager
    flake-inputs.stylix.nixosModules.stylix
  ];

  stylix = {
    base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml";
    autoEnable = true;
    enable = true;
  };

  home-manager = {
    useGlobalPkgs = true;
    useUserPackages = true;
    # See next snippet
    users.myUsername = import ./home.nix;
  };

  # Any other config here
}

home.nix:

# home.nix
{ pkgs, ... }: {
  home = {
    # Remember not to touch this, no
    # it's not for …

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
6 replies
@trueNAHO
Comment options

@MoltenMonster
Comment options

@trueNAHO
Comment options

@MoltenMonster
Comment options

@danth
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by MoltenMonster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants