{ config, lib, pkgs, inputs, ... }: with lib; let cfg = config.modules.ags; hyprlandCfg = config.modules.hyprland; astalPackages = with inputs.ags.packages.${pkgs.system}; [ io astal4 battery powerprofiles ]; extraPackages = astalPackages ++ [ pkgs.libadwaita pkgs.libsoup_3 ]; myShell = pkgs.stdenv.mkDerivation { name = "my-shell"; src = ./.; nativeBuildInputs = with pkgs; [ wrapGAppsHook3 gobject-introspection inputs.ags.packages.${pkgs.system}.default ]; buildInputs = extraPackages ++ [ pkgs.gjs ]; installPhase = '' runHook preInstall mkdir -p $out/bin mkdir -p $out/share cp -r * $out/share ags bundle app.ts $out/bin/my-shell -d "SRC='$out/share'" runHook postInstall ''; }; in { config = mkIf cfg.enable { home.packages = [ myShell ]; wayland.windowManager.hyprland.settings.exec-once = mkIf hyprlandCfg.enable [ "my-shell" ]; }; }