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

51 lines
1.3 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");
hyprlandConfs = lib.genAttrs files (name: {
text = builtins.readFile "${flakeRoot}/assets/hyprland/conf/hypr/${name}";
});
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;
};
# Ensure the Hyprland config directory exists and include all files
xdg.configFile = {
"hypr/.keep" = {
text = "";
};
}
// hyprlandConfs;
};
# Ensure Home Manager is enabled and configured
systemd.user.services.home-manager-henrov = {
description = "Home Manager for henrov";
wantedBy = [ "default.target" ];
serviceConfig.Type = "oneshot";
serviceConfig.ExecStart = "${pkgs.home-manager}/bin/home-manager generate";
};
}