43 lines
1.2 KiB
Nix
43 lines
1.2 KiB
Nix
{ lib, config, pkgs, flakeRoot, home-manager, inputs, ... }:
|
|
|
|
let
|
|
username = config.defaultUser or "henrov";
|
|
assetPath = "${flakeRoot}/generated/.config/hypr";
|
|
|
|
# Recursively read directory and generate Home Manager file entries
|
|
rec readDirRecursive = dir:
|
|
let
|
|
entries = builtins.attrNames (builtins.readDir dir);
|
|
files = lib.concatMap (e:
|
|
let
|
|
path = "${dir}/${e}";
|
|
stat = builtins.pathInfo path;
|
|
in if stat.type == "directory"
|
|
then readDirRecursive path
|
|
else [{
|
|
# Destination path relative to home directory
|
|
name = builtins.replaceStrings [ "${flakeRoot}/generated/" ] [ "" ] path;
|
|
value = { source = path; };
|
|
}]
|
|
) entries;
|
|
in files;
|
|
|
|
hyprFiles = readDirRecursive assetPath;
|
|
|
|
in
|
|
{
|
|
environment.systemPackages = [ hyprlandPkg ];
|
|
|
|
# Home Manager users declaration
|
|
home-manager.users = {
|
|
${username} = {
|
|
|
|
# Merge all files (including subdirectories) into ~/.config/hypr/
|
|
home.file = lib.mkMerge hyprFiles;
|
|
|
|
# Optional: Hyprland settings
|
|
settings.general."col.active_border" = "0xff97cbcd 0xff89b4fa";
|
|
};
|
|
};
|
|
}
|