Working on bindings
This commit is contained in:
@@ -1,26 +1,35 @@
|
|||||||
{ config, pkgs, lib, user, flakeRoot, ... }:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
user,
|
||||||
|
flakeRoot,
|
||||||
|
...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
hyprlandConfigDir = "${config.home-manager.users.${user.username}.xdg.configHome}/hypr";
|
hyprlandConfigDir = "${config.home-manager.users.${user.username}.xdg.configHome}/hypr";
|
||||||
# Get a list of all files in the conf directory
|
# Dynamically read all files in assets/hyprland/conf/
|
||||||
hyprlandConfs = lib.genAttrs (builtins.attrNames (builtins.readDir "${flakeRoot}/assets/hyprland/conf")) (name: {
|
hyprlandConfs =
|
||||||
text = builtins.readFile "${flakeRoot}/assets/hyprland/conf/${name}";
|
lib.genAttrs (builtins.attrNames (builtins.readDir "${flakeRoot}/assets/hyprland/conf"))
|
||||||
});
|
(
|
||||||
|
name: "hypr/${name}" # Prepend "hypr/" to deploy files to ~/.config/hypr/
|
||||||
|
);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
# NixOS: Enable Hyprland (optional, if you want to set it as the default session)
|
||||||
|
programs.hyprland = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
# Hyprland-specific Home Manager configurations
|
# Home Manager: Deploy Hyprland configs
|
||||||
home-manager.users.${user.username} = {
|
home-manager.users.${user.username} = {
|
||||||
home.stateVersion = userConfig.stateVersion;
|
|
||||||
home.username = userConfig.username;
|
|
||||||
home.homeDirectory = userConfig.homeDirectory;
|
|
||||||
xdg.configFile."hypr/hyprland.conf".text = hyprlandConf;
|
|
||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
# Dynamically deploy all files in assets/hyprland/conf/
|
# Dynamically deploy all Hyprland config files
|
||||||
xdg.configFile = hyprlandConfs // {
|
xdg.configFile = lib.genAttrs hyprlandConfs (path: {
|
||||||
inherit hyprlandConfigDir;
|
text = builtins.readFile "${flakeRoot}/assets/hyprland/conf/${lib.stringReplace "hypr/" "" path}";
|
||||||
};
|
});
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user