{ config, pkgs, lib, user, flakeRoot, ... }: let hyprlandFiles = builtins.attrNames (builtins.readDir "${flakeRoot}/assets/hyprland/conf/hypr"); # Filter out hyprland.conf from the list of files to copy directly otherHyprlandFiles = lib.filter (name: name != "hyprland.conf") hyprlandFiles; in { programs.hyprland = { enable = true; }; home-manager.users.${user.username} = { home.stateVersion = "25.11"; home.username = user.username; home.homeDirectory = config.home-manager.users.${user.username}.homeDirectory or "/home/${user.username}"; wayland.windowManager.hyprland = { enable = true; }; # Copy all files except hyprland.conf home.file = lib.genAttrs otherHyprlandFiles (name: { target = "/.config/hypr/${name}"; source = "${flakeRoot}/assets/hyprland/conf/hypr/${name}"; }); # Append the base config to hyprland.conf, preserving manual changes xdg.configFile."hypr/hyprland.conf".text = '' ${builtins.readFile "${flakeRoot}/assets/hyprland/conf/hypr/hyprland.conf"} # Your manual settings will go below this line and will not be overwritten ''; # Create the directory structure xdg.configFile = { "hypr/.keep" = { text = ""; }; }; }; }