Working on hyprland config

This commit is contained in:
2026-03-15 17:52:00 +00:00
parent 2e00573769
commit 0195bfc00f
+13 -14
View File
@@ -11,6 +11,11 @@ let
hyprlandFiles = builtins.attrNames (builtins.readDir "${flakeRoot}/assets/hyprland/conf/hypr");
# Filter out hyprland.conf from the list of files to symlink
otherHyprlandFiles = lib.filter (name: name != "hyprland.conf") hyprlandFiles;
# Generate xdg.configFile entries for all files except hyprland.conf
otherConfigs = lib.genAttrs otherHyprlandFiles (name: {
target = "hypr/${name}";
source = "${flakeRoot}/assets/hyprland/conf/hypr/${name}";
});
in
{
programs.hyprland = {
@@ -27,19 +32,13 @@ in
enable = true;
};
# Symlink all files except hyprland.conf
xdg.configFile = lib.genAttrs otherHyprlandFiles (name: {
target = "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 (optional, if not already created)
xdg.configFile."hypr/.keep".text = "";
# Merge all xdg.configFile definitions
xdg.configFile = otherConfigs // {
"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
'';
"hypr/.keep".text = "";
};
};
}