{ config, lib, inputs, pkgs, ... }: let cfg = config.programs.illogical-impulse; in { imports = [ ../options.nix ]; config = lib.mkIf cfg.enable { wayland.windowManager.hyprland = { # enable = true; package = inputs.hyprland.packages.${pkgs.system}.default; xwayland.enable = true; systemd.enable = true; settings = lib.mkIf cfg.settings.hyprland.useNixForConf ( lib.mkMerge [ # These imports must be functions that return an attribute set. (import ./hyprland/hypr/keybinds.nix) (import ./hyprland/hypr/general.nix) (import ./hyprland/hypr/exec.nix) (import ./hyprland/hypr/rules.nix) (import ./hyprland/hypr/env.nix) # (import ./hyprland/hypr/colours.nix) ] ); }; home.file = lib.mkMerge [ # The home.file configuration is now split into two mutually exclusive blocks. (lib.mkIf cfg.settings.hyprland.useNixForConf ( let scriptDir = ../../.config/hypr/hyprland/scripts; # List only the files that need to be executable scripts = [ "fuzzel-emoji.sh" "launch_first_available.sh" "record.sh" "start_geoclue_agent.sh" "workspace_action.sh" "zoom.sh" ]; in # 1. Map the individual scripts with executable = true ( lib.genAttrs (map (name: ".config/hypr/hyprland/scripts/${name}") scripts) (path: { source = "${scriptDir}/${builtins.baseNameOf path}"; executable = true; }) ) # 2. Add the 'ai' directory separately (cannot use executable=true on dirs) // { ".config/hypr/hyprland/scripts/ai".source = "${scriptDir}/ai"; } )) (lib.mkIf (!cfg.settings.hyprland.useNixForConf) { ".config/hypr" = { source = builtins.path { path = ../../.config/hypr; }; }; ".config/quickshell".source = builtins.path {path = ../../.config/quickshell;}; ".config/kitty".source = builtins.path {path = ../../.config/kitty;}; ".config/foot".source = builtins.path {path = ../../.config/foot;}; ".config/matugen".source = builtins.path {path = ../../.config/matugen;}; ".config/qt5ct".source = builtins.path {path = ../../.config/qt5ct;}; ".config/qt6ct".source = builtins.path {path = ../../.config/qt6ct;}; ".config/wlogout".source = builtins.path {path = ../../.config/wlogout;}; ".config/Kvantum".source = builtins.path {path = ../../.config/Kvantum;}; ".config/xdg-desktop-portal".source = builtins.path {path = ../../.config/xdg-desktop-portal;}; }) ]; home.packages = import ../packages.nix {inherit pkgs;} ++ [ inputs.illogical-impulse.packages.${pkgs.system}.default inputs.matugen.packages.${pkgs.system}.default ]; }; }