diff --git a/modules/ags/config/.gitignore b/modules/ags/config/.gitignore index be93e7dc..8dfae95e 100644 --- a/modules/ags/config/.gitignore +++ b/modules/ags/config/.gitignore @@ -1,3 +1,2 @@ @girs node_modules -tsconfig.json diff --git a/modules/ags/config/default.nix b/modules/ags/config/default.nix index 21a9ca87..d41bb99a 100644 --- a/modules/ags/config/default.nix +++ b/modules/ags/config/default.nix @@ -1,3 +1,3 @@ { - npmDepsHash = "sha256-qn1+dIo7p1+PYlR2qAmnCrR8xE93mYbwNCjDYISgnqU="; + npmDepsHash = "sha256-8LRFd8CYdO7LM0pLuRmoUPam75aWj5GybqXgZVBTdVg="; } diff --git a/modules/ags/config/package-lock.json b/modules/ags/config/package-lock.json index db2e211a..a53a6c68 100644 Binary files a/modules/ags/config/package-lock.json and b/modules/ags/config/package-lock.json differ diff --git a/modules/ags/config/package.json b/modules/ags/config/package.json index f5950673..3f9cd94b 100644 --- a/modules/ags/config/package.json +++ b/modules/ags/config/package.json @@ -3,6 +3,7 @@ "version": "0.0.0", "main": "app.ts", "dependencies": { + "astal": "https://gitpkg.vercel.app/Aylur/astal/lang/gjs/src?main", "@eslint/js": "9.17.0", "@stylistic/eslint-plugin": "2.12.1", "eslint": "9.17.0", diff --git a/modules/ags/config/tsconfig.json b/modules/ags/config/tsconfig.json new file mode 100644 index 00000000..8959489a --- /dev/null +++ b/modules/ags/config/tsconfig.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "compilerOptions": { + "experimentalDecorators": true, + "jsx": "react-jsx", + "jsxImportSource": "astal/gtk3", + "lib": [ + "ES2022" + ], + "module": "ES2022", + "moduleResolution": "Bundler", + "noEmit": true, + "strict": true, + "target": "ES2022" + } +} diff --git a/modules/ags/gtk4/.gitignore b/modules/ags/gtk4/.gitignore index be93e7dc..8dfae95e 100644 --- a/modules/ags/gtk4/.gitignore +++ b/modules/ags/gtk4/.gitignore @@ -1,3 +1,2 @@ @girs node_modules -tsconfig.json diff --git a/modules/ags/gtk4/tsconfig.json b/modules/ags/gtk4/tsconfig.json new file mode 100644 index 00000000..c1ea8a05 --- /dev/null +++ b/modules/ags/gtk4/tsconfig.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "compilerOptions": { + "experimentalDecorators": true, + "jsx": "react-jsx", + "jsxImportSource": "astal/gtk4", + "lib": [ + "ES2022" + ], + "module": "ES2022", + "moduleResolution": "Bundler", + "noEmit": true, + "strict": true, + "target": "ES2022" + } +} diff --git a/modules/ags/gtk4/widget/subclasses/astalify.ts b/modules/ags/gtk4/widget/subclasses/astalify.ts index 0aa5a92e..25b0cb7b 100644 --- a/modules/ags/gtk4/widget/subclasses/astalify.ts +++ b/modules/ags/gtk4/widget/subclasses/astalify.ts @@ -10,7 +10,7 @@ import { noImplicitDestroy, setChildren, construct, -} from 'astal/_astal'; +} from '../../node_modules/astal/_astal'; export type BindableChild = Gtk.Widget | Binding; diff --git a/modules/ags/packages.nix b/modules/ags/packages.nix index b91672f2..d2e88c24 100644 --- a/modules/ags/packages.nix +++ b/modules/ags/packages.nix @@ -117,28 +117,6 @@ in { buildNodeModules buildGirTypes ; - - mkTsConf = gtkVer: let - inherit (astal.packages.${pkgs.system}) gjs; - in - pkgs.writers.writeJSON "tsconfig.json" { - "$schema" = "https://json.schemastore.org/tsconfig"; - "compilerOptions" = { - "experimentalDecorators" = true; - "strict" = true; - "target" = "ES2022"; - "module" = "ES2022"; - "lib" = ["ES2022"]; - "moduleResolution" = "Bundler"; - "noEmit" = true; - "jsx" = "react-jsx"; - "jsxImportSource" = "${gjs}/share/astal/gjs/gtk${toString gtkVer}"; - "paths" = { - "astal" = ["${gjs}/share/astal/gjs"]; - "astal/*" = ["${gjs}/share/astal/gjs/*"]; - }; - }; - }; in ( (buildGirTypes { pname = "ags"; @@ -166,10 +144,6 @@ in { source = buildNodeModules ./config (import ./config).npmDepsHash; }; - "${cfg.configDir}/tsconfig.json".source = mkTsConf 3; - - "${gtk4ConfigDir}/tsconfig.json".source = mkTsConf 4; - "${cfg.configDir}/widgets/lockscreen/vars.ts".text = # javascript '' diff --git a/modules/desktop/manager/ags.nix b/modules/desktop/manager/ags.nix index 1ed498be..a65537f2 100644 --- a/modules/desktop/manager/ags.nix +++ b/modules/desktop/manager/ags.nix @@ -14,11 +14,9 @@ self: { homeFiles = config.home-manager.users.${cfg.user}.home.file; nodeModules = homeFiles."${agsCfg.configDir}/node_modules".source; - tsconfig = homeFiles."${agsCfg.configDir}/tsconfig.json".source; varsTs = homeFiles."${agsCfg.configDir}/widgets/lockscreen/vars.ts".source; in pkgs.runCommandLocal "agsConfig" {} '' - cp -ar ${tsconfig} ./tsconfig.json cp -ar ${../../ags/config}/* ./. chmod +w -R ./. cp -ar ${varsTs} ./widgets/lockscreen/vars.ts