{ lib, config, pkgs, flakeRoot, ... }: let # Default username username = config.defaultUser or "henrov"; moduleName = "stylix"; assetPath = "${flakeRoot}/assets/traveldroid/conf/"; # Read all files in the asset directory programFiles = builtins.readDir assetPath; files = lib.genAttrs (builtins.attrNames programFiles) (name: { source = "${assetPath}/${name}"; }); # Optional stylix.conf stylixConfFile = "${assetPath}/stylix.conf"; stylixConf = if builtins.pathExists stylixConfFile then builtins.readFile stylixConfFile else ""; # Cursor defaults cursorName = "phinger-cursors-light"; cursorSize = 24; in { ############################ # System-level packages ############################ environment.systemPackages = with pkgs; [ feh st stylix ]; ############################ # Home Manager user config ############################ home-manager.users."${username}" = { # Map all configuration files into ~/.config/stylix/ home.file = lib.genAttrs (builtins.attrNames files) (name: { path = "${moduleName}/${name}"; source = files.${name}.source; }); # Optionally write stylix.conf if it exists home.file."${moduleName}/stylix.conf".text = stylixConf; # GTK target (enabled via config file) # No need to define a `stylix` attribute directly home.sessionVariables = { STYLIX_CONF = "$HOME/.config/stylix/stylix.conf"; XCURSOR_THEME = cursorName; XCURSOR_SIZE = toString cursorSize; HYPRCURSOR_THEME = cursorName; HYPRCURSOR_SIZE = toString cursorSize; }; }; }