Files
NixOS/config/stylix.nix
Danilo Reyes f1e6015d39 Add multi-user support for package installations across various modules
Updated multiple configuration files to include a `merge` option for user management, enhancing the ability to handle multi-user setups for applications and services. This change improves flexibility in managing user-specific package installations, ensuring a more streamlined configuration process.
2026-01-16 13:38:49 -06:00

61 lines
1.6 KiB
Nix

{
pkgs,
lib,
config,
inputs,
...
}:
let
schemesFile = import ./schemes.nix {
inherit pkgs inputs;
};
scheme = schemesFile.schemes.paul;
cfg = config.my.stylix;
gnomeEnabled = config.services.desktopManager.gnome.enable;
in
{
options.my.stylix = {
enable = lib.mkEnableOption "system-wide theming with Stylix";
users = lib.mkOption {
type = lib.types.either lib.types.str (lib.types.listOf lib.types.str);
default = config.my.toggleUsers.stylix;
merge = inputs.self.lib.mergeUsersOption lib;
description = "Users to apply Stylix theming for";
};
};
config = {
stylix = {
inherit (scheme) image polarity;
enable = true;
autoEnable = cfg.enable;
targets.qt.platform = lib.mkForce "qtct";
}
// lib.optionalAttrs (scheme ? base16Scheme) { inherit (scheme) base16Scheme; };
home-manager.users = inputs.self.lib.mkHomeManagerUsers lib config.my.stylix.users (user: {
gtk = lib.mkIf (!cfg.enable && gnomeEnabled) {
enable = true;
iconTheme = {
name = "Papirus-Light";
package = pkgs.papirus-icon-theme.override {
color = "yellow";
};
};
};
stylix = {
inherit (cfg) enable;
autoEnable = cfg.enable;
iconTheme = {
inherit (cfg) enable;
package = scheme.iconPackage;
light = "Papirus-Light";
dark = "Papirus-Dark";
};
targets.librewolf = {
firefoxGnomeTheme.enable = true;
profileNames = [ user ];
};
};
});
};
}