Working on reshuffling

This commit is contained in:
2026-03-19 07:00:20 +00:00
parent 66f140f2dc
commit 3f950bc1f0
2 changed files with 78 additions and 58 deletions
+39 -29
View File
@@ -1,43 +1,53 @@
{
config,
pkgs,
lib,
user,
flakeRoot,
...
}:
{ lib, pkgs, flakeRoot, ... }:
let
hyprlandFiles = builtins.attrNames (builtins.readDir "${flakeRoot}/assets/hyprland/conf/hypr");
# Filter out hyprland.conf from the list of files to symlink
# --- Define user locally ---
username = "henrov";
# --- Hyprland conf directory ---
hyprConfDir = "${flakeRoot}/assets/hyprland/conf/hypr";
# --- Read files ---
hyprlandFiles = builtins.attrNames (builtins.readDir hyprConfDir);
# --- Exclude main hyprland.conf from automatic symlinks ---
otherHyprlandFiles = lib.filter (name: name != "hyprland.conf") hyprlandFiles;
# Generate xdg.configFile entries for all files except hyprland.conf
# --- Generate xdg.configFile entries for the other files ---
otherConfigs = lib.genAttrs otherHyprlandFiles (name: {
target = "hypr/${name}";
source = "${flakeRoot}/assets/hyprland/conf/hypr/${name}";
source = "${hyprConfDir}/${name}";
});
# --- Add main hyprland.conf separately ---
hyprlandConf = {
"hypr/hyprland.conf".text = builtins.readFile "${hyprConfDir}/hyprland.conf";
"hypr/.keep".text = "";
};
in
{
programs.hyprland = {
enable = true;
};
flake.nixosModules.hyprland = { config, pkgs, lib, ... }:
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}";
{
options.mySystem.desktop.hyprland.enable =
lib.mkEnableOption "Enable Hyprland Desktop";
wayland.windowManager.hyprland = {
enable = true;
settings.general."col.active_border" = lib.mkForce "0xff97cbcd 0xff89b4fa";
};
config = lib.mkIf (config.mySystem.desktop.hyprland.enable or false) {
xdg.configFile = otherConfigs // {
"hypr/hyprland.conf".text = ''
${builtins.readFile "${flakeRoot}/assets/hyprland/conf/hypr/hyprland.conf"}
'';
"hypr/.keep".text = "";
programs.hyprland.enable = true;
home-manager.users.${username} = {
home.stateVersion = "25.11";
home.username = username;
home.homeDirectory = "/home/${username}";
wayland.windowManager.hyprland = {
enable = true;
settings.general."col.active_border" = lib.mkForce "0xff97cbcd 0xff89b4fa";
};
xdg.configFile = otherConfigs // hyprlandConf;
};
};
};
}