Files
nixos/Droidnix/generated/hyprland/hyprland.nix
T
2026-03-15 12:21:49 +00:00

58 lines
1.5 KiB
Nix

{
config,
pkgs,
lib,
user,
flakeRoot,
...
}:
let
hyprlandConfigDir = "${config.home-manager.users.${user.username}.xdg.configHome}/hypr";
files = builtins.attrNames (builtins.readDir "${flakeRoot}/assets/hyprland/conf/hypr");
hyprlandFileSymlinks = lib.genAttrs files (name: {
target = "${flakeRoot}/assets/hyprland/conf/hypr/${name}";
isExecutable = name == "exec-once.conf"; # Mark exec-once.conf as executable if needed
});
in
{
# NixOS: Enable Hyprland
programs.hyprland = {
enable = true;
};
# Home Manager: Hyprland-specific configurations
home-manager.users.${user.username} = {
home.stateVersion = config.home-manager.users.${user.username}.stateVersion or "25.11";
home.username = user.username;
home.homeDirectory =
config.home-manager.users.${user.username}.homeDirectory or "/home/${user.username}";
wayland.windowManager.hyprland = {
enable = true;
};
# Create symlinks for each file in assets/hyprland/conf/hypr
home.file = {
".config/hypr/.keep" = {
text = "";
};
}
// lib.genAttrs files (name: {
".config/hypr/${name}" = {
source = "${flakeRoot}/assets/hyprland/conf/hypr/${name}";
executable = name == "exec-once.conf"; # Mark exec-once.conf as executable if needed
};
});
# Debug statements
home.file.".config/hypr/hyprland-debug.txt" = {
text = ''
hyprlandConfigDir: ${hyprlandConfigDir}
flakeRoot: ${flakeRoot}
files: ${toString files}
'';
};
};
}