62 lines
1.5 KiB
Nix
62 lines
1.5 KiB
Nix
{ lib, config, pkgs, flakeRoot, ... }:
|
|
|
|
let
|
|
# Determine the default username from host config
|
|
username = config.defaultUser or "henrov";
|
|
|
|
moduleName = "stylix";
|
|
assetPath = "${flakeRoot}/assets/system/conf/${moduleName}";
|
|
|
|
# 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 = [
|
|
pkgs.feh
|
|
pkgs.st
|
|
];
|
|
|
|
############################
|
|
# Home Manager user config
|
|
############################
|
|
_module.args.hmUsers = {
|
|
${username} = {
|
|
|
|
# Map all config files into ~/.config/stylix/
|
|
xdg.configFile =
|
|
lib.mapAttrs' (name: value: {
|
|
name = "${moduleName}/${name}";
|
|
value = { inherit (value) source; };
|
|
}) files;
|
|
|
|
# Environment variables for the session
|
|
home.sessionVariables = {
|
|
STYLIX_CONF = "$HOME/.config/stylix/stylix.conf";
|
|
|
|
XCURSOR_THEME = cursorName;
|
|
XCURSOR_SIZE = toString cursorSize;
|
|
HYPRCURSOR_THEME = cursorName;
|
|
HYPRCURSOR_SIZE = toString cursorSize;
|
|
};
|
|
};
|
|
};
|
|
}
|