From 4f308b945d1fb06b139e6fee333788c8ef33c25d Mon Sep 17 00:00:00 2001 From: voidarc Date: Thu, 27 Aug 2026 14:22:11 +0100 Subject: [PATCH] re-added the repo-checker thingy --- modules/features/hyprland/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/features/hyprland/default.nix b/modules/features/hyprland/default.nix index eb88550..41d3efb 100644 --- a/modules/features/hyprland/default.nix +++ b/modules/features/hyprland/default.nix @@ -8,6 +8,7 @@ self', pkgs, inputs', + flakeLocation, ... }: {config, ...}: let modules = with self.nixosModules; [ @@ -65,12 +66,22 @@ ''} end) ''; + # Easy way to get nix runtime info (ie the directory the config is at) + # into hyprland to run commands and stuff + runtimeFile = pkgs.writeText "runtime.lua" '' + hl.on("hyprland.start", function () + ${lib.optionalString (flakeLocation != "") '' + hl.exec_cmd( 'curl -X POST -H "Content-Type: application/json" -d "{\"ref\":\"$(git -C ${flakeLocation} rev-parse HEAD)\", \"status\":\"$(git -C ${flakeLocation} diff --quiet && echo "clean" || echo "dirty")\"}" https://n8n.voidarc.co.uk/webhook/config-checker' ) + ''} + 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 + ln -sfn ${runtimeFile} /run/hypr/config/runtime.lua ''; }; });