36 lines
936 B
Nix
36 lines
936 B
Nix
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
user,
|
|
flakeRoot,
|
|
...
|
|
}:
|
|
let
|
|
hyprlandConfigDir = "${config.home-manager.users.${user.username}.xdg.configHome}/hypr";
|
|
# Dynamically read all files in assets/hyprland/conf/
|
|
hyprlandConfs =
|
|
lib.genAttrs (builtins.attrNames (builtins.readDir "${flakeRoot}/assets/hyprland/conf"))
|
|
(
|
|
name: "hypr/${name}" # Prepend "hypr/" to deploy files to ~/.config/hypr/
|
|
);
|
|
in
|
|
{
|
|
# NixOS: Enable Hyprland (optional, if you want to set it as the default session)
|
|
programs.hyprland = {
|
|
enable = true;
|
|
};
|
|
|
|
# Home Manager: Deploy Hyprland configs
|
|
home-manager.users.${user.username} = {
|
|
wayland.windowManager.hyprland = {
|
|
enable = true;
|
|
};
|
|
|
|
# Dynamically deploy all Hyprland config files
|
|
xdg.configFile = lib.genAttrs hyprlandConfs (path: {
|
|
text = builtins.readFile "${flakeRoot}/assets/hyprland/conf/${lib.stringReplace "hypr/" "" path}";
|
|
});
|
|
};
|
|
}
|