Regenerated

This commit is contained in:
2026-03-19 15:53:31 +00:00
parent c84511f28d
commit 3440697fc9
32 changed files with 66 additions and 1720 deletions
+38 -86
View File
@@ -476,17 +476,11 @@ let
moduleName = "stylix";
username = config.defaultUser or "henrov";
# Assets directory
assetPath =
if builtins.pathExists ../../../assets/system/theming/${moduleName}
then ../../../assets/system/theming/${moduleName}
else null;
# Assets directory for Stylix config
assetPath = ../../../assets/system/conf/${moduleName};
# Read all files if assets exist
programFiles =
if assetPath != null
then builtins.readDir assetPath
else {};
# Read all config files
programFiles = builtins.readDir assetPath;
files = lib.genAttrs (builtins.attrNames programFiles) (name: {
src = "${assetPath}/${name}";
@@ -495,95 +489,53 @@ let
# Top-level toggle for this module
enableProgram = config.enableStylix or false;
# Stylix self-contained configuration
stylixCfg = {
enable = true;
# Read the main stylix.conf
stylixConfFile = "${assetPath}/stylix.conf";
stylixConf = if builtins.pathExists stylixConfFile
then builtins.readFile stylixConfFile
else "";
base16Scheme = ../../../assets/system/theming/stylix/catppuccin-mocha.yaml;
image = ../../../assets/hyprland/wallpaperstuff/pictures/wall1.jpg;
polarity = "dark";
cursor = {
package = "phinger-cursors"; # symbolic reference
name = "phinger-cursors-light";
size = 24;
};
fonts = {
monospace = {
package = "nerd-fonts-fira-code";
name = "Fira Code Nerd Font";
};
sansSerif = {
package = "lato";
name = "Lato";
};
};
icons = {
enable = true;
package = "papirus-icon-theme";
dark = "Papirus-Dark";
light = "Papirus-Light";
};
};
in
{
# --- Top-level toggle option ---
# --- Top-level toggle ---
options.enableStylix = lib.mkEnableOption "Enable Stylix system theming";
# --- Only apply configuration if enabled ---
config = lib.mkIf enableProgram {
# --- Stylix dendritic app definition ---
stylixModule = {
enable = true;
assetsDir = assetPath;
files = files;
user = username;
theme = "catppuccin-mocha";
polarity = "dark";
};
# Deploy Stylix configuration files to user's XDG config
home-manager.users.${username}.xdg.configFile =
lib.mapAttrs' (name: value: {
name = "${moduleName}/${name}";
value.source = value.src;
}) files;
# --- Stylix theming config ---
stylix = stylixCfg;
# --- Optional wallpaper helper (dendritic) ---
wallpaperHelper = {
enable = true;
packages = [ "feh" "st" ]; # symbolic package names
};
# --- Cursor environment variables ---
# Provide stylix.conf content as an environment variable (or for further init scripts)
home-manager.users.${username}.home.sessionVariables = {
XCURSOR_THEME = stylixCfg.cursor.name;
XCURSOR_SIZE = toString stylixCfg.cursor.size;
HYPRCURSOR_THEME = stylixCfg.cursor.name;
HYPRCURSOR_SIZE = toString stylixCfg.cursor.size;
STYLIX_CONF = stylixConf;
};
# --- Optional systemd service to sync assets ---
systemd.services."${moduleName}-sync" = {
description = "Sync ${moduleName} configuration assets";
wantedBy = [ "multi-user.target" ];
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
# Optional wallpaper helper packages (symbolic, install manually or via packages)
environment.systemPackages = [
# symbolic references, actual pkgs mapping done elsewhere
"feh"
"st"
];
serviceConfig = {
Type = "oneshot";
ExecStart = ''
set -euo pipefail
if [ -d "${assetPath}" ]; then
for f in ${lib.concatStringsSep " " (builtins.attrNames files)}; do
cp -u "${assetPath}/$f" "/home/${username}/.config/${moduleName}/$f"
done
fi
'';
};
restartTriggers = [ assetPath ];
path = [];
};
# Cursor environment variables (read from stylix.conf if needed)
# Minimal example using defaults from your stylix.conf
home-manager.users.${username}.home.sessionVariables = lib.mkForce (
let
# Default cursor values if stylix.conf parsing not implemented
cursorName = "phinger-cursors-light";
cursorSize = 24;
in {
XCURSOR_THEME = cursorName;
XCURSOR_SIZE = toString cursorSize;
HYPRCURSOR_THEME = cursorName;
HYPRCURSOR_SIZE = toString cursorSize;
}
);
};
}
#+END_SRC