diff --git a/flake.lock b/flake.lock index d53db00..cac40e0 100644 --- a/flake.lock +++ b/flake.lock @@ -374,11 +374,11 @@ "wshowkeys": "wshowkeys" }, "locked": { - "lastModified": 1787581843, - "narHash": "sha256-cqdct8W+Q7f1BXt9d+G0GMJP9j0wtFDMrf1z/xGU4eI=", + "lastModified": 1787681733, + "narHash": "sha256-+KuqE3sLF/rSO9QU3ByxPVYhkl3WH9rPOIvZZARK2LM=", "ref": "refs/heads/main", - "rev": "e83ab7a6f808006c62cc9d4d092def098c710bbc", - "revCount": 64, + "rev": "31e7c1ccb7b6a0cb396fa57846232ab8c5bd7e81", + "revCount": 65, "type": "git", "url": "https://git.voidarc.co.uk/voidarc/hypr" }, diff --git a/modules/features/hyprland/default.nix b/modules/features/hyprland/default.nix index 247b54d..a03f953 100644 --- a/modules/features/hyprland/default.nix +++ b/modules/features/hyprland/default.nix @@ -10,14 +10,10 @@ inputs', ... }: {config, ...}: let - modules = with self.nixosModules; - [ - audio - systemTheme - ] - ++ [ - inputs.hyprland.inputs.hyprland.nixosModules.default - ]; + modules = with self.nixosModules; [ + audio + systemTheme + ]; runtimePkgs = self'.packages.hyprland.passthru.runtimePackages; lib = pkgs.lib; @@ -38,16 +34,10 @@ }; config = { - programs.hyprland = - { - enable = true; - package = self'.packages.hyprland; - } - // lib.optionalAttrs config.hyprland.enablePlugins { - plugins = with inputs'; [ - hyprgrass.packages.default - ]; - }; + programs.hyprland = { + enable = true; + package = self'.packages.hyprland; + }; services.displayManager.defaultSession = "hyprland"; services.xserver.enable = true; @@ -65,10 +55,21 @@ runtimePkgs)} ''; - system.activationScripts.hyprConfig = lib.stringAfter ["specialfs"] '' - mkdir -p /run/hypr/config - ln -sfn ${inputs'.hyprland.packages.repo-files}/* /run/hypr/config - ''; + system.activationScripts.hyprConfig = let + pluginFile = builtins.toFile "plugins.lua" '' + hl.on("hyprland.start", function () + ${lib.optionalString config.hyprland.enablePlugins '' + hl.exec("hyprctl plugin load ${inputs'.hyprgrass.default}/lib/lib${inputs'.hyprgrass.default.pname}.so") + ''} + end) + ''; + in + lib.stringAfter ["specialfs"] '' + mkdir -p /run/hypr/config + rm -rf /run/hypr/config/* + ln -sfn ${inputs'.hyprland.packages.repo-files}/* /run/hypr/config + ln -sfn ${pluginFile} /run/hypr/config/plugins.lua + ''; }; }); perSystem = {