Files
nixos/Droidnix/generated/modules/traveldroid/desktop/stylix.nix
T
2026-03-31 11:31:22 +00:00

86 lines
2.1 KiB
Nix

{ lib, config, pkgs, flakeRoot, stylix, ... }:
let
username = config.defaultUser or "henrov";
moduleName = "stylix";
assetPath = "${flakeRoot}/generated/.config/stylix";
assetFiles = builtins.attrNames (builtins.readDir assetPath);
stylixFiles = lib.genAttrs assetFiles (f: {
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;
};
# Define FULL cursor set OR remove entirely
cursor = {
name = cursorName;
package = pkgs.phinger-cursors;
size = cursorSize;
};
};
#################################
# Home Manager
#################################
home-manager.users = {
"${username}" = {
home.file = lib.mkMerge [
(lib.mapAttrs' (name: value: {
name = ".config/stylix/stylix.conf";
value = value;
}) stylixFiles)
{
".config/${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;
};
gtk.theme.name = lib.mkForce "Catppuccin-Mocha-Standard-Blue-Dark";
};
};
}