Files
nixos/Droidnix/generated/modules/traveldroid/desktop/hyprland.nix
T
2026-03-30 00:22:36 +00:00

42 lines
1.1 KiB
Nix

{ lib, config, pkgs, flakeRoot, home-manager, inputs, ... }:
let
username = config.defaultUser or "henrov";
assetPath = "${flakeRoot}/generated/.config/hypr";
hyprlandPkg =
pkgs.hyprland or
pkgs.hyprland-git or
inputs.hyprland.packages.${pkgs.system}.default;
# Recursively gather all files as Home Manager entries
gatherFiles = dir:
let
entries = builtins.attrNames (builtins.readDir dir);
in lib.concatMap (e:
let
path = "${dir}/${e}";
stat = builtins.readDir path;
in if stat != {} then gatherFiles path
else [{
name = ".config/hypr/${builtins.replaceStrings [ "${assetPath}/" ] [ "" ] path}";
value = { source = path; };
}]
) entries;
hyprFilesAttrs = lib.listToAttrs (gatherFiles assetPath);
in
{
# Install Hyprland systemwide
environment.systemPackages = [ hyprlandPkg ];
# Home Manager user configuration
home-manager.users = {
${username} = {
# Ensure all generated files end up in ~/.config/hypr
home.file = hyprFilesAttrs;
};
};
}