Files
nixos/Droidnix/generated/modules/traveldroid/desktop/stylix.nix
T
2026-03-25 17:06:20 +00:00

86 lines
2.0 KiB
Nix

{ lib, config, pkgs, flakeRoot, stylix, ... }:
let
username = config.defaultUser or "henrov";
moduleName = "stylix";
assetPath = "${flakeRoot}/assets/traveldroid/conf/${moduleName}";
assetFiles = builtins.attrNames (builtins.readDir assetPath);
# Same pattern as hyprland
stylixFiles = lib.genAttrs assetFiles (f: {
name = ".config/${moduleName}/${f}";
value = { source = "${assetPath}/${f}"; };
});
stylixConfFile = "${assetPath}/stylix.conf";
stylixConf =
if builtins.pathExists stylixConfFile
then builtins.readFile stylixConfFile
else "";
cursorName = "phinger-cursors-light";
cursorSize = 24;
in
{
#################################
# Enable Stylix module
#################################
imports = [
stylix.nixosModules.stylix
];
#################################
# System packages
#################################
environment.systemPackages = [
pkgs.feh
pkgs.st
];
#################################
# Stylix system config
#################################
stylix = {
enable = true;
base16Scheme = "${flakeRoot}/assets/traveldroid/theming/stylix/catppuccin-mocha.yaml";
polarity = "dark";
targets = {
gtk.enable = true;
qt.enable = true;
};
cursor = {
name = cursorName;
size = cursorSize;
};
};
#################################
# Home Manager (safe merge)
#################################
_module.args.hmUsers = {
"${username}" = {
home.file = lib.mkMerge [
stylixFiles
{
"${moduleName}/stylix.conf".text = stylixConf;
}
];
home.sessionVariables = {
STYLIX_CONF = "$HOME/.config/stylix/stylix.conf";
XCURSOR_THEME = cursorName;
XCURSOR_SIZE = toString cursorSize;
HYPRCURSOR_THEME = cursorName;
HYPRCURSOR_SIZE = toString cursorSize;
};
# Prevent GTK conflicts with your gtk.nix
gtk.theme.name = lib.mkDefault "adw-gtk3";
};
};
}