{ config, pkgs, lib, user, flakeRoot, ... }: let hyprlandConfigDir = "${config.home-manager.users.${user.username}.xdg.configHome}/hypr"; hyprlandConfs = lib.genAttrs (builtins.attrNames (builtins.readDir "${flakeRoot}/assets/hyprland/conf/hypr")) (name: { text = builtins.readFile "${flakeRoot}/assets/hyprland/conf/hypr/${name}"; }); in { # NixOS: Enable Hyprland (optional) programs.hyprland = { enable = true; }; # Home Manager: Hyprland-specific configurations home-manager.users.${user.username} = rec { home.stateVersion = "25.11"; home.username = user.username; home.homeDirectory = user.homeDirectory; wayland.windowManager.hyprland = { enable = true; }; # Ensure the Hyprland config directory exists and has the correct permissions xdg.configFile = { "hypr/.keep" = { text = ""; }; } // hyprlandConfs; # Ensure the home directory and .config directory have the correct permissions home.file.".config".source = pkgs.writeDashScriptBin "mkdir-config" '' mkdir -p $HOME/.config chown -R ${user.username}:users $HOME/.config chmod -R 755 $HOME/.config ''; }; }