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"); hyprlandFiles = builtins.attrNames (builtins.readDir "${flakeRoot}/assets/hyprland/conf/hypr");
# Filter out hyprland.conf from the list of files to symlink # Filter out hyprland.conf from the list of files to symlink
otherHyprlandFiles = lib.filter (name: name != "hyprland.conf") hyprlandFiles; 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 in
{ {
programs.hyprland = { programs.hyprland = {
@@ -27,19 +32,13 @@ in
enable = true; enable = true;
}; };
# Symlink all files except hyprland.conf # Merge all xdg.configFile definitions
xdg.configFile = lib.genAttrs otherHyprlandFiles (name: { xdg.configFile = otherConfigs // {
target = "hypr/${name}"; "hypr/hyprland.conf".text = ''
source = "${flakeRoot}/assets/hyprland/conf/hypr/${name}"; ${builtins.readFile "${flakeRoot}/assets/hyprland/conf/hypr/hyprland.conf"}
}); # Your manual settings will go below this line and will not be overwritten
'';
# Append the base config to hyprland.conf, preserving manual changes "hypr/.keep".text = "";
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 = "";
}; };
} }