Files
nixos/Droidnix/generated/modules/traveldroid/desktop/stylix.nix
T
2026-03-25 16:53:18 +00:00

86 lines
2.1 KiB
Nix

{ lib, config, pkgs, flakeRoot, stylix, ... }:
let
username = config.defaultUser or "henrov";
moduleName = "stylix";
# Path to stylix assets
assetPath = "${flakeRoot}/assets/traveldroid/conf/${moduleName}";
# Read all files in the asset directory
assetFiles = builtins.attrNames (builtins.readDir assetPath);
# Convert files to Home Manager entries (same pattern as hyprland)
stylixFiles = lib.genAttrs assetFiles (f: {
name = ".config/${moduleName}/${f}";
value = { source = "${assetPath}/${f}"; };
});
# Optional stylix.conf
stylixConfFile = "${assetPath}/stylix.conf";
stylixConf =
if builtins.pathExists stylixConfFile
then builtins.readFile stylixConfFile
else "";
cursorName = "phinger-cursors-light";
cursorSize = 24;
in
{
#################################
# IMPORTANT: Enable Stylix module
#################################
imports = [
stylix.nixosModules.stylix
];
#################################
# System packages
#################################
environment.systemPackages = [
pkgs.feh
pkgs.st
];
#################################
# Stylix system configuration
#################################
stylix = {
enable = true;
base16Scheme = "${flakeRoot}/assets/traveldroid/system/theming/stylix/catppuccin-mocha.yaml";
polarity = "dark";
targets = {
gtk.enable = true;
qt.enable = true; # optional but recommended
};
cursor = {
name = cursorName;
size = cursorSize;
};
};
#################################
# Home Manager user-level config
#################################
_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;
};
};
};
}