Regenerated
This commit is contained in:
+71
-50
@@ -469,100 +469,121 @@ This sets the XDG implementation
|
||||
** =generated/modules/desktop/stylix.nix=
|
||||
This sets the stylix implementation
|
||||
#+BEGIN_SRC nix :tangle generated/modules/desktop/stylix.nix :noweb tangle :mkdirp yes :eval never-html
|
||||
{ lib, config, pkgs, flakeRoot, ... }:
|
||||
{ lib, config, ... }:
|
||||
|
||||
let
|
||||
# --- Program definition ---
|
||||
programName = "stylix";
|
||||
# --- Module variables ---
|
||||
moduleName = "stylix";
|
||||
username = config.defaultUser or "henrov";
|
||||
|
||||
# Assets (theme + wallpaper)
|
||||
programAssets = "${flakeRoot}/assets/system/theming/${programName}";
|
||||
# Assets directory
|
||||
assetPath =
|
||||
if builtins.pathExists ../../../assets/system/theming/${moduleName}
|
||||
then ../../../assets/system/theming/${moduleName}
|
||||
else null;
|
||||
|
||||
# Read all files if assets exist
|
||||
programFiles =
|
||||
if builtins.pathExists programAssets
|
||||
then builtins.readDir programAssets
|
||||
if assetPath != null
|
||||
then builtins.readDir assetPath
|
||||
else {};
|
||||
|
||||
files = lib.genAttrs (builtins.attrNames programFiles) (name: {
|
||||
src = "${programAssets}/${name}";
|
||||
src = "${assetPath}/${name}";
|
||||
});
|
||||
|
||||
# Enable toggle (must match option)
|
||||
enableProgram = config.enableStylix or true;
|
||||
# Top-level toggle for this module
|
||||
enableProgram = config.enableStylix or false;
|
||||
|
||||
# Resolve user safely (outside mkIf)
|
||||
user = config.defaultUser or "henrov";
|
||||
|
||||
# --- Stylix configuration (self-contained) ---
|
||||
# Stylix self-contained configuration
|
||||
stylixCfg = {
|
||||
enable = true;
|
||||
|
||||
base16Scheme =
|
||||
"${flakeRoot}/assets/system/theming/stylix/catppuccin-mocha.yaml";
|
||||
|
||||
image =
|
||||
"${flakeRoot}/assets/hyprland/wallpaperstuff/pictures/wall1.jpg";
|
||||
|
||||
polarity = "dark";
|
||||
base16Scheme = ../../../assets/system/theming/stylix/catppuccin-mocha.yaml;
|
||||
image = ../../../assets/hyprland/wallpaperstuff/pictures/wall1.jpg;
|
||||
polarity = "dark";
|
||||
|
||||
cursor = {
|
||||
package = pkgs.phinger-cursors;
|
||||
name = "phinger-cursors-light";
|
||||
size = 24;
|
||||
package = "phinger-cursors"; # symbolic reference
|
||||
name = "phinger-cursors-light";
|
||||
size = 24;
|
||||
};
|
||||
|
||||
fonts = {
|
||||
monospace = {
|
||||
package = pkgs.nerd-fonts.fira-code;
|
||||
name = "Fira Code Nerd Font";
|
||||
package = "nerd-fonts-fira-code";
|
||||
name = "Fira Code Nerd Font";
|
||||
};
|
||||
sansSerif = {
|
||||
package = pkgs.lato;
|
||||
name = "Lato";
|
||||
package = "lato";
|
||||
name = "Lato";
|
||||
};
|
||||
};
|
||||
|
||||
icons = {
|
||||
enable = true;
|
||||
package = pkgs.papirus-icon-theme;
|
||||
dark = "Papirus-Dark";
|
||||
light = "Papirus-Light";
|
||||
package = "papirus-icon-theme";
|
||||
dark = "Papirus-Dark";
|
||||
light = "Papirus-Light";
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
# --- Option ---
|
||||
options.enableStylix =
|
||||
lib.mkEnableOption "Enable Stylix system theming";
|
||||
# --- Top-level toggle option ---
|
||||
options.enableStylix = lib.mkEnableOption "Enable Stylix system theming";
|
||||
|
||||
# --- Config ---
|
||||
# --- Only apply configuration if enabled ---
|
||||
config = lib.mkIf enableProgram {
|
||||
|
||||
# --- Dendritic app definition ---
|
||||
mySystem.${programName} = {
|
||||
enable = true;
|
||||
assetsDir = programAssets;
|
||||
files = files;
|
||||
inherit user;
|
||||
|
||||
theme = "catppuccin-mocha";
|
||||
polarity = "dark";
|
||||
# --- Stylix dendritic app definition ---
|
||||
stylixModule = {
|
||||
enable = true;
|
||||
assetsDir = assetPath;
|
||||
files = files;
|
||||
user = username;
|
||||
theme = "catppuccin-mocha";
|
||||
polarity = "dark";
|
||||
};
|
||||
|
||||
# --- Stylix theming ---
|
||||
# --- Stylix theming config ---
|
||||
stylix = stylixCfg;
|
||||
|
||||
# --- Optional: wallpaper helper (kept dendritic) ---
|
||||
mySystem.wallpaper = {
|
||||
enable = true;
|
||||
packages = [ "feh" "st" ];
|
||||
# --- Optional wallpaper helper (dendritic) ---
|
||||
wallpaperHelper = {
|
||||
enable = true;
|
||||
packages = [ "feh" "st" ]; # symbolic package names
|
||||
};
|
||||
|
||||
# --- Cursor environment variables ---
|
||||
home-manager.users.${user}.home.sessionVariables = {
|
||||
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;
|
||||
};
|
||||
|
||||
# --- 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" ];
|
||||
|
||||
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 = [];
|
||||
};
|
||||
};
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
Reference in New Issue
Block a user