Working on hyprland config
This commit is contained in:
@@ -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 = "";
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user