From f3e06554e4f98a8f92c7679d7f0928bf6c091945 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Wed, 13 Nov 2024 19:39:01 -0500 Subject: [PATCH] feat(ags): update to official agsV2 --- README.md | 4 +- devices/README.md | 2 +- devices/binto/default.nix | 2 +- devices/wim/default.nix | 2 +- flake.lock | Bin 57081 -> 57054 bytes flake.nix | Bin 11280 -> 11260 bytes inputs.nix | 15 +- legacyPackages/README.md | 2 +- nixosModules/ags-v2/default.nix | 38 ----- nixosModules/ags-v2/packages.nix | 150 ------------------ nixosModules/ags-v2/v1/README.md | 1 - nixosModules/{ags-v2 => ags}/config/.envrc | 0 .../{ags-v2 => ags}/config/.gitignore | 0 nixosModules/{ags-v2 => ags}/config/app.ts | 0 .../config/configurations/binto.ts | 0 .../config/configurations/greeter.ts | 0 .../config/configurations/lock.ts | 0 .../config/configurations/wim.ts | 0 nixosModules/{ags-v2 => ags}/config/env.d.ts | 0 .../{ags-v2 => ags}/config/eslint.config.ts | 0 nixosModules/{ags-v2 => ags}/config/lib.ts | 8 +- .../{ags-v2 => ags}/config/package-lock.json | Bin 74570 -> 74564 bytes .../{ags-v2 => ags}/config/package.json | 4 +- .../config/services/brightness.ts | 0 .../config/services/gpu-screen-recorder.ts | 0 .../config/services/monitor-clicks.ts | 0 .../{ags-v2 => ags}/config/style/colors.scss | 0 .../{ags-v2 => ags}/config/style/common.scss | 0 .../{ags-v2 => ags}/config/style/greeter.scss | 0 .../{ags-v2 => ags}/config/style/lock.scss | 0 .../{ags-v2 => ags}/config/style/main.scss | 0 .../config/widgets/applauncher/_index.scss | 0 .../config/widgets/applauncher/app-item.tsx | 0 .../config/widgets/applauncher/launch.ts | 0 .../config/widgets/applauncher/main.tsx | 0 .../config/widgets/bar/_index.scss | 0 .../config/widgets/bar/binto.tsx | 0 .../config/widgets/bar/fullscreen.tsx | 0 .../config/widgets/bar/items/audio.tsx | 0 .../config/widgets/bar/items/battery.tsx | 0 .../config/widgets/bar/items/brightness.tsx | 0 .../config/widgets/bar/items/clock.tsx | 0 .../widgets/bar/items/current-client.tsx | 0 .../config/widgets/bar/items/network.tsx | 0 .../config/widgets/bar/items/notif-button.tsx | 0 .../config/widgets/bar/items/tray.tsx | 0 .../config/widgets/bar/items/workspaces.tsx | 0 .../config/widgets/bar/wim.tsx | 0 .../config/widgets/bg-fade/main.tsx | 0 .../config/widgets/clipboard/_index.scss | 0 .../config/widgets/clipboard/clip-item.tsx | 0 .../config/widgets/clipboard/cliphist.sh | 0 .../config/widgets/clipboard/main.tsx | 0 .../config/widgets/corners/main.tsx | 0 .../config/widgets/corners/screen-corners.tsx | 0 .../config/widgets/date/_index.scss | 0 .../config/widgets/date/binto.tsx | 0 .../config/widgets/date/main.tsx | 0 .../config/widgets/date/wim.tsx | 0 .../config/widgets/greeter/main.tsx | 0 .../config/widgets/icon-browser/_index.scss | 0 .../config/widgets/icon-browser/main.tsx | 0 .../config/widgets/lockscreen/_index.scss | 0 .../config/widgets/lockscreen/main.tsx | 0 .../config/widgets/misc/_index.scss | 0 .../config/widgets/misc/popup-window.tsx | 13 +- .../config/widgets/misc/separator.tsx | 0 .../config/widgets/misc/smooth-progress.tsx | 0 .../config/widgets/misc/sorted-list.tsx | 0 .../config/widgets/notifs/_index.scss | 0 .../config/widgets/notifs/binto.tsx | 0 .../config/widgets/notifs/center.tsx | 0 .../config/widgets/notifs/gesture.tsx | 0 .../config/widgets/notifs/notification.tsx | 0 .../config/widgets/notifs/popups.tsx | 0 .../config/widgets/notifs/wim.tsx | 0 .../config/widgets/osd/_index.scss | 0 .../config/widgets/osd/main.tsx | 0 .../config/widgets/powermenu/_index.scss | 0 .../config/widgets/powermenu/main.tsx | 0 .../config/widgets/screenshot/_index.scss | 0 .../config/widgets/screenshot/main.tsx | 0 nixosModules/ags/default.nix | 62 ++++++++ nixosModules/{ags-v2 => ags}/hyprland.nix | 0 nixosModules/ags/packages.nix | 137 ++++++++++++++++ .../v1/config/global-types.d.ts | 0 .../{ags-v2 => ags}/v1/config/scss/osk.scss | 0 .../v1/config/scss/player.scss | 0 .../v1/config/scss/quick-settings.scss | 0 .../v1/config/services/tablet.ts | 0 .../{ags-v2 => ags}/v1/config/ts/bar/heart.ts | 0 .../v1/config/ts/bar/keyboard-layout.ts | 0 .../v1/config/ts/media-player/gesture.ts | 0 .../v1/config/ts/media-player/mpris.ts | 0 .../v1/config/ts/media-player/player.ts | 0 .../config/ts/on-screen-keyboard/gesture.ts | 0 .../ts/on-screen-keyboard/keyboard-layouts.ts | 0 .../config/ts/on-screen-keyboard/keyboard.ts | 0 .../v1/config/ts/on-screen-keyboard/keys.ts | 0 .../v1/config/ts/on-screen-keyboard/main.ts | 0 nixosModules/{ags-v2 => ags}/v1/icons.nix | 0 nixosModules/desktop/default.nix | 4 +- nixosModules/desktop/environment/default.nix | 2 +- .../desktop/environment/modules/security.nix | 4 +- nixosModules/desktop/manager/ags.nix | 23 ++- 105 files changed, 233 insertions(+), 240 deletions(-) delete mode 100644 nixosModules/ags-v2/default.nix delete mode 100644 nixosModules/ags-v2/packages.nix delete mode 100644 nixosModules/ags-v2/v1/README.md rename nixosModules/{ags-v2 => ags}/config/.envrc (100%) rename nixosModules/{ags-v2 => ags}/config/.gitignore (100%) rename nixosModules/{ags-v2 => ags}/config/app.ts (100%) rename nixosModules/{ags-v2 => ags}/config/configurations/binto.ts (100%) rename nixosModules/{ags-v2 => ags}/config/configurations/greeter.ts (100%) rename nixosModules/{ags-v2 => ags}/config/configurations/lock.ts (100%) rename nixosModules/{ags-v2 => ags}/config/configurations/wim.ts (100%) rename nixosModules/{ags-v2 => ags}/config/env.d.ts (100%) rename nixosModules/{ags-v2 => ags}/config/eslint.config.ts (100%) rename nixosModules/{ags-v2 => ags}/config/lib.ts (90%) rename nixosModules/{ags-v2 => ags}/config/package-lock.json (99%) rename nixosModules/{ags-v2 => ags}/config/package.json (82%) rename nixosModules/{ags-v2 => ags}/config/services/brightness.ts (100%) rename nixosModules/{ags-v2 => ags}/config/services/gpu-screen-recorder.ts (100%) rename nixosModules/{ags-v2 => ags}/config/services/monitor-clicks.ts (100%) rename nixosModules/{ags-v2 => ags}/config/style/colors.scss (100%) rename nixosModules/{ags-v2 => ags}/config/style/common.scss (100%) rename nixosModules/{ags-v2 => ags}/config/style/greeter.scss (100%) rename nixosModules/{ags-v2 => ags}/config/style/lock.scss (100%) rename nixosModules/{ags-v2 => ags}/config/style/main.scss (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/applauncher/_index.scss (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/applauncher/app-item.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/applauncher/launch.ts (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/applauncher/main.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/bar/_index.scss (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/bar/binto.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/bar/fullscreen.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/bar/items/audio.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/bar/items/battery.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/bar/items/brightness.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/bar/items/clock.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/bar/items/current-client.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/bar/items/network.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/bar/items/notif-button.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/bar/items/tray.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/bar/items/workspaces.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/bar/wim.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/bg-fade/main.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/clipboard/_index.scss (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/clipboard/clip-item.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/clipboard/cliphist.sh (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/clipboard/main.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/corners/main.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/corners/screen-corners.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/date/_index.scss (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/date/binto.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/date/main.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/date/wim.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/greeter/main.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/icon-browser/_index.scss (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/icon-browser/main.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/lockscreen/_index.scss (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/lockscreen/main.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/misc/_index.scss (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/misc/popup-window.tsx (83%) rename nixosModules/{ags-v2 => ags}/config/widgets/misc/separator.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/misc/smooth-progress.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/misc/sorted-list.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/notifs/_index.scss (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/notifs/binto.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/notifs/center.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/notifs/gesture.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/notifs/notification.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/notifs/popups.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/notifs/wim.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/osd/_index.scss (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/osd/main.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/powermenu/_index.scss (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/powermenu/main.tsx (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/screenshot/_index.scss (100%) rename nixosModules/{ags-v2 => ags}/config/widgets/screenshot/main.tsx (100%) create mode 100644 nixosModules/ags/default.nix rename nixosModules/{ags-v2 => ags}/hyprland.nix (100%) create mode 100644 nixosModules/ags/packages.nix rename nixosModules/{ags-v2 => ags}/v1/config/global-types.d.ts (100%) rename nixosModules/{ags-v2 => ags}/v1/config/scss/osk.scss (100%) rename nixosModules/{ags-v2 => ags}/v1/config/scss/player.scss (100%) rename nixosModules/{ags-v2 => ags}/v1/config/scss/quick-settings.scss (100%) rename nixosModules/{ags-v2 => ags}/v1/config/services/tablet.ts (100%) rename nixosModules/{ags-v2 => ags}/v1/config/ts/bar/heart.ts (100%) rename nixosModules/{ags-v2 => ags}/v1/config/ts/bar/keyboard-layout.ts (100%) rename nixosModules/{ags-v2 => ags}/v1/config/ts/media-player/gesture.ts (100%) rename nixosModules/{ags-v2 => ags}/v1/config/ts/media-player/mpris.ts (100%) rename nixosModules/{ags-v2 => ags}/v1/config/ts/media-player/player.ts (100%) rename nixosModules/{ags-v2 => ags}/v1/config/ts/on-screen-keyboard/gesture.ts (100%) rename nixosModules/{ags-v2 => ags}/v1/config/ts/on-screen-keyboard/keyboard-layouts.ts (100%) rename nixosModules/{ags-v2 => ags}/v1/config/ts/on-screen-keyboard/keyboard.ts (100%) rename nixosModules/{ags-v2 => ags}/v1/config/ts/on-screen-keyboard/keys.ts (100%) rename nixosModules/{ags-v2 => ags}/v1/config/ts/on-screen-keyboard/main.ts (100%) rename nixosModules/{ags-v2 => ags}/v1/icons.nix (100%) diff --git a/README.md b/README.md index 246ffd0b..06bc3b6d 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ You might find it weird that most of my config is written in TypeScript. That's because all my desktops run -[AGSv2](https://github.com/Aylur/ags/tree/v2) +[AGS](https://github.com/Aylur/ags) for UI. Click on -[this](https://git.nelim.org/matt1432/nixos-configs/src/branch/master/nixosModules/ags-v2) +[this](https://git.nelim.org/matt1432/nixos-configs/src/branch/master/nixosModules/ags) to see my configuration. I'm also a victim of Stockholm syndrome at this point and make my scripts diff --git a/devices/README.md b/devices/README.md index d61f513d..2b958784 100644 --- a/devices/README.md +++ b/devices/README.md @@ -17,7 +17,7 @@ This directory encompasses every device's main configuration file. ## Global Vars -In every device's `default.nix`, you'll find these [settings](https://git.nelim.org/matt1432/nixos-configs/src/branch/master/common/vars.nix) +In every device's `default.nix`, you'll find these [settings](https://git.nelim.org/matt1432/nixos-configs/src/branch/master/common/vars/default.nix) ```nix # $FLAKE/devices//default.nix diff --git a/devices/binto/default.nix b/devices/binto/default.nix index 935ee21a..2428ae57 100644 --- a/devices/binto/default.nix +++ b/devices/binto/default.nix @@ -61,7 +61,7 @@ in { roles.desktop = { user = mainUser; - ags-v2.enable = true; + ags.enable = true; mainMonitor = "desc:GIGA-BYTE TECHNOLOGY CO. LTD. G27QC 0x00000B1D"; displayManager.duplicateScreen = false; diff --git a/devices/wim/default.nix b/devices/wim/default.nix index 1dad5b0e..d9499171 100644 --- a/devices/wim/default.nix +++ b/devices/wim/default.nix @@ -71,7 +71,7 @@ in { roles.desktop = { user = mainUser; - ags-v2.enable = true; + ags.enable = true; mainMonitor = "eDP-1"; isLaptop = true; isTouchscreen = true; diff --git a/flake.lock b/flake.lock index d720934c42777e7a98a11ff8a1ec575a3b91fb17..ead9658177480859b23626b9d3a7f0946c64d61a 100644 GIT binary patch delta 155 zcmeylm-*ga<_+f=CvS37nEa7(605P9nTg@#jY6{8c`n61KAy=HPUgOTZi&Si9!@EV zrQTI0A(pO&&PL7^?ykA!#(C)`MIn)s6-C7+UtpJ-#4M_Ao@`)}Vwh;0Xr5}3WM*QJ zl4xL@YHDa=W|?AUY-VX;Zj@${XlOEdVvr9+3*Y2*0VraW|Ed< zXr5x0m}X&|VrXubWMOPN^xm@Q4oNf_ diff --git a/flake.nix b/flake.nix index 8a96fd16b6a0c197ffcc9a5853a352a05f70c268..f92f63a14da57de22834cd54e408ecac2cfa0314 100644 GIT binary patch delta 13 UcmbOb@h5zO{Y1x>jn^%;0WP)%O#lD@ delta 24 fcmewpJ|SX)JyV#`MEe%@GzD7)r81+9J6yB@auW!3 diff --git a/inputs.nix b/inputs.nix index 87b0ec35..e3ad31f0 100644 --- a/inputs.nix +++ b/inputs.nix @@ -160,19 +160,18 @@ let }; agsInputs = { - agsV2 = mkDep { - owner = "Aylur"; - repo = "ags"; - ref = "v2"; - - inputs.astal.follows = "astal"; - }; - astal = mkDep { owner = "Aylur"; repo = "astal"; }; + ags = mkDep { + owner = "Aylur"; + repo = "ags"; + + inputs.astal.follows = "astal"; + }; + gtk-session-lock = mkDep { owner = "Cu3PO42"; repo = "gtk-session-lock"; diff --git a/legacyPackages/README.md b/legacyPackages/README.md index 9b1b3777..49013200 100644 --- a/legacyPackages/README.md +++ b/legacyPackages/README.md @@ -8,4 +8,4 @@ This directory encompasses every derivation scopes for packages exposed by my fl | --------------- | ----------- | | `dracula` | Themes for many apps from the [Dracula GitHub Org](https://github.com/dracula) | | `firefoxAddons` | Firefox extensions updated with [mozilla-addons-to-nix](https://git.sr.ht/~rycee/mozilla-addons-to-nix) | -| `mpvScripts` | MPV scripts that I use that are not in nixpkgs | +| `mpvScripts` | MPV scripts I use that are not in nixpkgs | diff --git a/nixosModules/ags-v2/default.nix b/nixosModules/ags-v2/default.nix deleted file mode 100644 index 9bf5abc2..00000000 --- a/nixosModules/ags-v2/default.nix +++ /dev/null @@ -1,38 +0,0 @@ -self: { - config, - lib, - ... -}: { - config = let - inherit (lib) hasPrefix mkIf removePrefix; - - # Configs - cfgDesktop = config.roles.desktop; - flakeDir = config.environment.variables.FLAKE; - - agsConfigDir = "${removePrefix "/home/${cfgDesktop.user}/" flakeDir}/nixosModules/ags-v2/config"; - in - mkIf cfgDesktop.ags-v2.enable { - assertions = [ - { - assertion = hasPrefix "/home/${cfgDesktop.user}/" flakeDir; - message = '' - Your $FLAKE environment variable needs to point to a directory in - the main users' home to use the AGS module. - ''; - } - ]; - - # Machine config - security.pam.services.astal-auth = {}; - services.upower.enable = true; - - home-manager.users.${cfgDesktop.user}.imports = [ - (import ./packages.nix {inherit self agsConfigDir;}) - ./hyprland.nix - ]; - }; - - # For accurate stack trace - _file = ./default.nix; -} diff --git a/nixosModules/ags-v2/packages.nix b/nixosModules/ags-v2/packages.nix deleted file mode 100644 index d7943ffa..00000000 --- a/nixosModules/ags-v2/packages.nix +++ /dev/null @@ -1,150 +0,0 @@ -{ - self, - agsConfigDir, -}: { - lib, - osConfig, - pkgs, - ... -}: let - # Inputs - inherit (self.inputs) agsV2 gtk-session-lock; - - # Libs - inherit (lib) attrValues boolToString optionals removeAttrs; - - # Cfg info - inherit (osConfig.networking) hostName; - cfgDesktop = osConfig.roles.desktop; - fullConfPath = "/home/${cfgDesktop.user}/${agsConfigDir}"; - - # Astal libraries - gtkSessionLock = gtk-session-lock.packages.${pkgs.system}.default; - agsV2Packages = agsV2.packages.${pkgs.system}; - astalLibs = attrValues (removeAttrs agsV2.inputs.astal.packages.${pkgs.system} ["docs" "gjs"]) ++ [gtkSessionLock]; - - # Final ags package - agsFull = agsV2Packages.ags.override {extraPackages = astalLibs;}; -in { - options.programs.ags-v2 = { - package = lib.mkOption { - type = with lib.types; nullOr package; - default = null; - }; - lockPkg = lib.mkOption { - type = with lib.types; nullOr package; - default = null; - }; - }; - - config = { - # Make these accessible outside these files - programs.ags-v2 = { - package = agsFull; - - lockPkg = pkgs.writeShellApplication { - name = "lock"; - runtimeInputs = [agsFull]; - text = '' - export CONF="lock" - - if [ "$#" == 0 ]; then - exec ags run ${fullConfPath} - else - exec ags "$@" -i lock - fi - ''; - }; - }; - - home = { - packages = - [ - (pkgs.writeShellApplication { - name = "ags"; - runtimeInputs = [agsFull]; - text = '' - export CONF="${hostName}" - - if [ "$#" == 0 ]; then - exec ags run ${fullConfPath} - else - exec ags "$@" - fi - ''; - }) - (pkgs.writeShellApplication { - name = "agsConf"; - runtimeInputs = [agsFull]; - text = '' - export CONF="$1" - exec ${agsFull}/bin/ags run ${fullConfPath} - ''; - }) - ] - ++ (builtins.attrValues { - inherit - (pkgs) - playerctl - pavucontrol # TODO: replace with ags widget - ; - }) - ++ (optionals cfgDesktop.isTouchscreen (builtins.attrValues { - inherit - (pkgs) - ydotool - ; - })); - - file = let - inherit - (import "${self}/lib" {inherit pkgs self;}) - buildNodeModules - buildGirTypes - ; - in ( - (buildGirTypes { - pname = "agsV2"; - configPath = "${agsConfigDir}/@girs"; - packages = astalLibs; - }) - // { - "${agsConfigDir}/node_modules".source = - buildNodeModules ./config "sha256-cyVdjRV1o/UvAPzXigNzXATq1mRmsXhDqnG4wnBzSXE="; - - "${agsConfigDir}/tsconfig.json".source = pkgs.writers.writeJSON "tsconfig.json" { - "$schema" = "https://json.schemastore.org/tsconfig"; - "compilerOptions" = { - "experimentalDecorators" = true; - "strict" = true; - "target" = "ES2023"; - "moduleResolution" = "Bundler"; - "jsx" = "react-jsx"; - "jsxImportSource" = "${agsV2Packages.gjs}/share/astal/gjs/gtk3"; - "paths" = { - "astal" = ["${agsV2Packages.gjs}/share/astal/gjs"]; - "astal/*" = ["${agsV2Packages.gjs}/share/astal/gjs/*"]; - }; - "skipLibCheck" = true; - "module" = "ES2022"; - "lib" = ["ES2023"]; - }; - }; - - "${agsConfigDir}/widgets/lockscreen/vars.ts".text = - # javascript - '' - export default { - mainMonitor: '${cfgDesktop.mainMonitor}', - dupeLockscreen: ${boolToString cfgDesktop.displayManager.duplicateScreen}, - hasFprintd: ${boolToString (hostName == "wim")}, - }; - ''; - } - ); - }; - }; - - # For accurate stack trace - _file = ./default.nix; -} diff --git a/nixosModules/ags-v2/v1/README.md b/nixosModules/ags-v2/v1/README.md deleted file mode 100644 index 2c909dc4..00000000 --- a/nixosModules/ags-v2/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -# Moving to [AGSv2](https://github.com/Aylur/ags/tree/v2) diff --git a/nixosModules/ags-v2/config/.envrc b/nixosModules/ags/config/.envrc similarity index 100% rename from nixosModules/ags-v2/config/.envrc rename to nixosModules/ags/config/.envrc diff --git a/nixosModules/ags-v2/config/.gitignore b/nixosModules/ags/config/.gitignore similarity index 100% rename from nixosModules/ags-v2/config/.gitignore rename to nixosModules/ags/config/.gitignore diff --git a/nixosModules/ags-v2/config/app.ts b/nixosModules/ags/config/app.ts similarity index 100% rename from nixosModules/ags-v2/config/app.ts rename to nixosModules/ags/config/app.ts diff --git a/nixosModules/ags-v2/config/configurations/binto.ts b/nixosModules/ags/config/configurations/binto.ts similarity index 100% rename from nixosModules/ags-v2/config/configurations/binto.ts rename to nixosModules/ags/config/configurations/binto.ts diff --git a/nixosModules/ags-v2/config/configurations/greeter.ts b/nixosModules/ags/config/configurations/greeter.ts similarity index 100% rename from nixosModules/ags-v2/config/configurations/greeter.ts rename to nixosModules/ags/config/configurations/greeter.ts diff --git a/nixosModules/ags-v2/config/configurations/lock.ts b/nixosModules/ags/config/configurations/lock.ts similarity index 100% rename from nixosModules/ags-v2/config/configurations/lock.ts rename to nixosModules/ags/config/configurations/lock.ts diff --git a/nixosModules/ags-v2/config/configurations/wim.ts b/nixosModules/ags/config/configurations/wim.ts similarity index 100% rename from nixosModules/ags-v2/config/configurations/wim.ts rename to nixosModules/ags/config/configurations/wim.ts diff --git a/nixosModules/ags-v2/config/env.d.ts b/nixosModules/ags/config/env.d.ts similarity index 100% rename from nixosModules/ags-v2/config/env.d.ts rename to nixosModules/ags/config/env.d.ts diff --git a/nixosModules/ags-v2/config/eslint.config.ts b/nixosModules/ags/config/eslint.config.ts similarity index 100% rename from nixosModules/ags-v2/config/eslint.config.ts rename to nixosModules/ags/config/eslint.config.ts diff --git a/nixosModules/ags-v2/config/lib.ts b/nixosModules/ags/config/lib.ts similarity index 90% rename from nixosModules/ags-v2/config/lib.ts rename to nixosModules/ags/config/lib.ts index 62589f8f..789dec67 100644 --- a/nixosModules/ags-v2/config/lib.ts +++ b/nixosModules/ags/config/lib.ts @@ -80,13 +80,11 @@ export const hyprMessage = (message: string) => new Promise(( } }); -export const centerCursor = async(): Promise => { +export const centerCursor = (): void => { let x: number; let y: number; - const monitor = (JSON.parse(await hyprMessage('j/monitors')) as AstalHyprland.Monitor[]) - .find((m) => m.focused) as AstalHyprland.Monitor; + const monitor = Hyprland.get_monitors().find((m) => m.focused) as AstalHyprland.Monitor; - // @ts-expect-error this should be good switch (monitor.transform) { case 1: x = monitor.x - (monitor.height / 2); @@ -109,7 +107,7 @@ export const centerCursor = async(): Promise => { break; } - await hyprMessage(`dispatch movecursor ${x} ${y}`); + hyprMessage(`dispatch movecursor ${x} ${y}`); }; export const closeAll = () => { diff --git a/nixosModules/ags-v2/config/package-lock.json b/nixosModules/ags/config/package-lock.json similarity index 99% rename from nixosModules/ags-v2/config/package-lock.json rename to nixosModules/ags/config/package-lock.json index ae011ea8df0843b60ad94ba81f289b23f072fa28..7d11397eb04824115b96fc83fcc041b74c16e742 100644 GIT binary patch delta 181 zcmX?gjOEBN7NKe`1t3t$OUzAGvQkh=OfQ}&+RUV+Gg&ZAa-s&$WS#At(>HK4Do+-u zXPYeApfp*GaSo&DWWh4A%_kYFT0u;A%gMFvx m.description?.startsWith(start))?.transform; + const transform = get_hyprland_monitor(monitor)?.transform; let width: number; diff --git a/nixosModules/ags-v2/config/widgets/misc/separator.tsx b/nixosModules/ags/config/widgets/misc/separator.tsx similarity index 100% rename from nixosModules/ags-v2/config/widgets/misc/separator.tsx rename to nixosModules/ags/config/widgets/misc/separator.tsx diff --git a/nixosModules/ags-v2/config/widgets/misc/smooth-progress.tsx b/nixosModules/ags/config/widgets/misc/smooth-progress.tsx similarity index 100% rename from nixosModules/ags-v2/config/widgets/misc/smooth-progress.tsx rename to nixosModules/ags/config/widgets/misc/smooth-progress.tsx diff --git a/nixosModules/ags-v2/config/widgets/misc/sorted-list.tsx b/nixosModules/ags/config/widgets/misc/sorted-list.tsx similarity index 100% rename from nixosModules/ags-v2/config/widgets/misc/sorted-list.tsx rename to nixosModules/ags/config/widgets/misc/sorted-list.tsx diff --git a/nixosModules/ags-v2/config/widgets/notifs/_index.scss b/nixosModules/ags/config/widgets/notifs/_index.scss similarity index 100% rename from nixosModules/ags-v2/config/widgets/notifs/_index.scss rename to nixosModules/ags/config/widgets/notifs/_index.scss diff --git a/nixosModules/ags-v2/config/widgets/notifs/binto.tsx b/nixosModules/ags/config/widgets/notifs/binto.tsx similarity index 100% rename from nixosModules/ags-v2/config/widgets/notifs/binto.tsx rename to nixosModules/ags/config/widgets/notifs/binto.tsx diff --git a/nixosModules/ags-v2/config/widgets/notifs/center.tsx b/nixosModules/ags/config/widgets/notifs/center.tsx similarity index 100% rename from nixosModules/ags-v2/config/widgets/notifs/center.tsx rename to nixosModules/ags/config/widgets/notifs/center.tsx diff --git a/nixosModules/ags-v2/config/widgets/notifs/gesture.tsx b/nixosModules/ags/config/widgets/notifs/gesture.tsx similarity index 100% rename from nixosModules/ags-v2/config/widgets/notifs/gesture.tsx rename to nixosModules/ags/config/widgets/notifs/gesture.tsx diff --git a/nixosModules/ags-v2/config/widgets/notifs/notification.tsx b/nixosModules/ags/config/widgets/notifs/notification.tsx similarity index 100% rename from nixosModules/ags-v2/config/widgets/notifs/notification.tsx rename to nixosModules/ags/config/widgets/notifs/notification.tsx diff --git a/nixosModules/ags-v2/config/widgets/notifs/popups.tsx b/nixosModules/ags/config/widgets/notifs/popups.tsx similarity index 100% rename from nixosModules/ags-v2/config/widgets/notifs/popups.tsx rename to nixosModules/ags/config/widgets/notifs/popups.tsx diff --git a/nixosModules/ags-v2/config/widgets/notifs/wim.tsx b/nixosModules/ags/config/widgets/notifs/wim.tsx similarity index 100% rename from nixosModules/ags-v2/config/widgets/notifs/wim.tsx rename to nixosModules/ags/config/widgets/notifs/wim.tsx diff --git a/nixosModules/ags-v2/config/widgets/osd/_index.scss b/nixosModules/ags/config/widgets/osd/_index.scss similarity index 100% rename from nixosModules/ags-v2/config/widgets/osd/_index.scss rename to nixosModules/ags/config/widgets/osd/_index.scss diff --git a/nixosModules/ags-v2/config/widgets/osd/main.tsx b/nixosModules/ags/config/widgets/osd/main.tsx similarity index 100% rename from nixosModules/ags-v2/config/widgets/osd/main.tsx rename to nixosModules/ags/config/widgets/osd/main.tsx diff --git a/nixosModules/ags-v2/config/widgets/powermenu/_index.scss b/nixosModules/ags/config/widgets/powermenu/_index.scss similarity index 100% rename from nixosModules/ags-v2/config/widgets/powermenu/_index.scss rename to nixosModules/ags/config/widgets/powermenu/_index.scss diff --git a/nixosModules/ags-v2/config/widgets/powermenu/main.tsx b/nixosModules/ags/config/widgets/powermenu/main.tsx similarity index 100% rename from nixosModules/ags-v2/config/widgets/powermenu/main.tsx rename to nixosModules/ags/config/widgets/powermenu/main.tsx diff --git a/nixosModules/ags-v2/config/widgets/screenshot/_index.scss b/nixosModules/ags/config/widgets/screenshot/_index.scss similarity index 100% rename from nixosModules/ags-v2/config/widgets/screenshot/_index.scss rename to nixosModules/ags/config/widgets/screenshot/_index.scss diff --git a/nixosModules/ags-v2/config/widgets/screenshot/main.tsx b/nixosModules/ags/config/widgets/screenshot/main.tsx similarity index 100% rename from nixosModules/ags-v2/config/widgets/screenshot/main.tsx rename to nixosModules/ags/config/widgets/screenshot/main.tsx diff --git a/nixosModules/ags/default.nix b/nixosModules/ags/default.nix new file mode 100644 index 00000000..617fd262 --- /dev/null +++ b/nixosModules/ags/default.nix @@ -0,0 +1,62 @@ +self: { + config, + lib, + ... +}: let + inherit (lib) hasPrefix mkIf removePrefix; + + # Configs + cfgDesktop = config.roles.desktop; + flakeDir = config.environment.variables.FLAKE; + + agsConfigDir = "${removePrefix "/home/${cfgDesktop.user}/" flakeDir}/nixosModules/ags/config"; + + hmOpts = {lib, ...}: { + options.programs.ags = { + package = lib.mkOption { + type = with lib.types; nullOr package; + default = null; + }; + + astalLibs = lib.mkOption { + type = with lib.types; nullOr (listOf package); + default = null; + }; + + lockPkg = lib.mkOption { + type = with lib.types; nullOr package; + default = null; + }; + + configDir = lib.mkOption { + type = lib.types.str; + default = agsConfigDir; + }; + }; + }; +in { + config = mkIf cfgDesktop.ags.enable { + assertions = [ + { + assertion = hasPrefix "/home/${cfgDesktop.user}/" flakeDir; + message = '' + Your $FLAKE environment variable needs to point to a directory in + the main users' home to use the AGS module. + ''; + } + ]; + + # Machine config + security.pam.services.astal-auth = {}; + services.upower.enable = true; + + home-manager.users.${cfgDesktop.user}.imports = [ + hmOpts + (import ./packages.nix self) + ./hyprland.nix + ]; + }; + + # For accurate stack trace + _file = ./default.nix; +} diff --git a/nixosModules/ags-v2/hyprland.nix b/nixosModules/ags/hyprland.nix similarity index 100% rename from nixosModules/ags-v2/hyprland.nix rename to nixosModules/ags/hyprland.nix diff --git a/nixosModules/ags/packages.nix b/nixosModules/ags/packages.nix new file mode 100644 index 00000000..b856e052 --- /dev/null +++ b/nixosModules/ags/packages.nix @@ -0,0 +1,137 @@ +self: { + config, + lib, + osConfig, + pkgs, + ... +}: let + inherit (self.inputs) ags gtk-session-lock; + + inherit (lib) attrValues boolToString optionals removeAttrs; + + inherit (osConfig.networking) hostName; + + cfg = config.programs.ags; + cfgDesktop = osConfig.roles.desktop; +in { + config = { + # Make these accessible outside these files + programs.ags = { + package = ags.packages.${pkgs.system}.ags.override { + extraPackages = cfg.astalLibs; + }; + astalLibs = + attrValues ( + removeAttrs ags.inputs.astal.packages.${pkgs.system} ["docs" "gjs"] + ) + ++ [gtk-session-lock.packages.${pkgs.system}.default]; + + lockPkg = pkgs.writeShellApplication { + name = "lock"; + runtimeInputs = [cfg.package]; + text = '' + export CONF="lock" + + if [ "$#" == 0 ]; then + exec ags run ~/${cfg.configDir} + else + exec ags "$@" -i lock + fi + ''; + }; + }; + + home = { + packages = + [ + (pkgs.writeShellApplication { + name = "ags"; + runtimeInputs = [cfg.package]; + text = '' + export CONF="${hostName}" + + if [ "$#" == 0 ]; then + exec ags run ~/${cfg.configDir} + else + exec ags "$@" + fi + ''; + }) + (pkgs.writeShellApplication { + name = "agsConf"; + runtimeInputs = [cfg.package]; + text = '' + export CONF="$1" + exec ${cfg.package}/bin/ags run ~/${cfg.configDir} + ''; + }) + ] + ++ (builtins.attrValues { + inherit + (pkgs) + playerctl + pavucontrol # TODO: replace with ags widget + ; + }) + ++ (optionals cfgDesktop.isTouchscreen (builtins.attrValues { + inherit + (pkgs) + ydotool + ; + })); + + file = let + inherit + (import "${self}/lib" {inherit pkgs self;}) + buildNodeModules + buildGirTypes + ; + in ( + (buildGirTypes { + pname = "ags"; + configPath = "${cfg.configDir}/@girs"; + packages = cfg.astalLibs; + }) + // { + "${cfg.configDir}/node_modules".source = + buildNodeModules ./config "sha256-DtrSplIOSudRgBCfKsDAtok0/21xzHiTJNrKLYy4mfY="; + + "${cfg.configDir}/tsconfig.json".source = let + inherit (ags.packages.${pkgs.system}) gjs; + in + pkgs.writers.writeJSON "tsconfig.json" { + "$schema" = "https://json.schemastore.org/tsconfig"; + "compilerOptions" = { + "experimentalDecorators" = true; + "strict" = true; + "target" = "ES2023"; + "moduleResolution" = "Bundler"; + "jsx" = "react-jsx"; + "jsxImportSource" = "${gjs}/share/astal/gjs/gtk3"; + "paths" = { + "astal" = ["${gjs}/share/astal/gjs"]; + "astal/*" = ["${gjs}/share/astal/gjs/*"]; + }; + "skipLibCheck" = true; + "module" = "ES2022"; + "lib" = ["ES2023"]; + }; + }; + + "${cfg.configDir}/widgets/lockscreen/vars.ts".text = + # javascript + '' + export default { + mainMonitor: '${cfgDesktop.mainMonitor}', + dupeLockscreen: ${boolToString cfgDesktop.displayManager.duplicateScreen}, + hasFprintd: ${boolToString (hostName == "wim")}, + }; + ''; + } + ); + }; + }; + + # For accurate stack trace + _file = ./default.nix; +} diff --git a/nixosModules/ags-v2/v1/config/global-types.d.ts b/nixosModules/ags/v1/config/global-types.d.ts similarity index 100% rename from nixosModules/ags-v2/v1/config/global-types.d.ts rename to nixosModules/ags/v1/config/global-types.d.ts diff --git a/nixosModules/ags-v2/v1/config/scss/osk.scss b/nixosModules/ags/v1/config/scss/osk.scss similarity index 100% rename from nixosModules/ags-v2/v1/config/scss/osk.scss rename to nixosModules/ags/v1/config/scss/osk.scss diff --git a/nixosModules/ags-v2/v1/config/scss/player.scss b/nixosModules/ags/v1/config/scss/player.scss similarity index 100% rename from nixosModules/ags-v2/v1/config/scss/player.scss rename to nixosModules/ags/v1/config/scss/player.scss diff --git a/nixosModules/ags-v2/v1/config/scss/quick-settings.scss b/nixosModules/ags/v1/config/scss/quick-settings.scss similarity index 100% rename from nixosModules/ags-v2/v1/config/scss/quick-settings.scss rename to nixosModules/ags/v1/config/scss/quick-settings.scss diff --git a/nixosModules/ags-v2/v1/config/services/tablet.ts b/nixosModules/ags/v1/config/services/tablet.ts similarity index 100% rename from nixosModules/ags-v2/v1/config/services/tablet.ts rename to nixosModules/ags/v1/config/services/tablet.ts diff --git a/nixosModules/ags-v2/v1/config/ts/bar/heart.ts b/nixosModules/ags/v1/config/ts/bar/heart.ts similarity index 100% rename from nixosModules/ags-v2/v1/config/ts/bar/heart.ts rename to nixosModules/ags/v1/config/ts/bar/heart.ts diff --git a/nixosModules/ags-v2/v1/config/ts/bar/keyboard-layout.ts b/nixosModules/ags/v1/config/ts/bar/keyboard-layout.ts similarity index 100% rename from nixosModules/ags-v2/v1/config/ts/bar/keyboard-layout.ts rename to nixosModules/ags/v1/config/ts/bar/keyboard-layout.ts diff --git a/nixosModules/ags-v2/v1/config/ts/media-player/gesture.ts b/nixosModules/ags/v1/config/ts/media-player/gesture.ts similarity index 100% rename from nixosModules/ags-v2/v1/config/ts/media-player/gesture.ts rename to nixosModules/ags/v1/config/ts/media-player/gesture.ts diff --git a/nixosModules/ags-v2/v1/config/ts/media-player/mpris.ts b/nixosModules/ags/v1/config/ts/media-player/mpris.ts similarity index 100% rename from nixosModules/ags-v2/v1/config/ts/media-player/mpris.ts rename to nixosModules/ags/v1/config/ts/media-player/mpris.ts diff --git a/nixosModules/ags-v2/v1/config/ts/media-player/player.ts b/nixosModules/ags/v1/config/ts/media-player/player.ts similarity index 100% rename from nixosModules/ags-v2/v1/config/ts/media-player/player.ts rename to nixosModules/ags/v1/config/ts/media-player/player.ts diff --git a/nixosModules/ags-v2/v1/config/ts/on-screen-keyboard/gesture.ts b/nixosModules/ags/v1/config/ts/on-screen-keyboard/gesture.ts similarity index 100% rename from nixosModules/ags-v2/v1/config/ts/on-screen-keyboard/gesture.ts rename to nixosModules/ags/v1/config/ts/on-screen-keyboard/gesture.ts diff --git a/nixosModules/ags-v2/v1/config/ts/on-screen-keyboard/keyboard-layouts.ts b/nixosModules/ags/v1/config/ts/on-screen-keyboard/keyboard-layouts.ts similarity index 100% rename from nixosModules/ags-v2/v1/config/ts/on-screen-keyboard/keyboard-layouts.ts rename to nixosModules/ags/v1/config/ts/on-screen-keyboard/keyboard-layouts.ts diff --git a/nixosModules/ags-v2/v1/config/ts/on-screen-keyboard/keyboard.ts b/nixosModules/ags/v1/config/ts/on-screen-keyboard/keyboard.ts similarity index 100% rename from nixosModules/ags-v2/v1/config/ts/on-screen-keyboard/keyboard.ts rename to nixosModules/ags/v1/config/ts/on-screen-keyboard/keyboard.ts diff --git a/nixosModules/ags-v2/v1/config/ts/on-screen-keyboard/keys.ts b/nixosModules/ags/v1/config/ts/on-screen-keyboard/keys.ts similarity index 100% rename from nixosModules/ags-v2/v1/config/ts/on-screen-keyboard/keys.ts rename to nixosModules/ags/v1/config/ts/on-screen-keyboard/keys.ts diff --git a/nixosModules/ags-v2/v1/config/ts/on-screen-keyboard/main.ts b/nixosModules/ags/v1/config/ts/on-screen-keyboard/main.ts similarity index 100% rename from nixosModules/ags-v2/v1/config/ts/on-screen-keyboard/main.ts rename to nixosModules/ags/v1/config/ts/on-screen-keyboard/main.ts diff --git a/nixosModules/ags-v2/v1/icons.nix b/nixosModules/ags/v1/icons.nix similarity index 100% rename from nixosModules/ags-v2/v1/icons.nix rename to nixosModules/ags/v1/icons.nix diff --git a/nixosModules/desktop/default.nix b/nixosModules/desktop/default.nix index 6390f949..baf0f949 100644 --- a/nixosModules/desktop/default.nix +++ b/nixosModules/desktop/default.nix @@ -36,11 +36,11 @@ in { ''; }; - ags-v2.enable = mkOption { + ags.enable = mkOption { type = types.bool; default = false; description = '' - Whether we want to enable AGSv2 for the DE shell. + Whether we want to enable AGS for the DE shell. ''; }; diff --git a/nixosModules/desktop/environment/default.nix b/nixosModules/desktop/environment/default.nix index 44005e92..b232ef0c 100644 --- a/nixosModules/desktop/environment/default.nix +++ b/nixosModules/desktop/environment/default.nix @@ -7,7 +7,7 @@ self: { inherit (self.inputs) hyprgrass hyprland hyprland-plugins; in { imports = [ - (import ../../ags-v2 self) + (import ../../ags self) ./modules/dconf.nix ./modules/printer.nix diff --git a/nixosModules/desktop/environment/modules/security.nix b/nixosModules/desktop/environment/modules/security.nix index c157e384..9f2ebd03 100644 --- a/nixosModules/desktop/environment/modules/security.nix +++ b/nixosModules/desktop/environment/modules/security.nix @@ -12,8 +12,8 @@ hmCfg = config.home-manager.users.${cfg.user}; hyprPkg = hmCfg.wayland.windowManager.hyprland.finalPackage; - # See nixosModules/ags-v2/packages.nix - lockPkg = hmCfg.programs.ags-v2.lockPkg; + # See nixosModules/ags/packages.nix + lockPkg = hmCfg.programs.ags.lockPkg; runInDesktop = pkgs.writeShellApplication { name = "runInDesktop"; diff --git a/nixosModules/desktop/manager/ags.nix b/nixosModules/desktop/manager/ags.nix index 7eb6c298..482d3c5e 100644 --- a/nixosModules/desktop/manager/ags.nix +++ b/nixosModules/desktop/manager/ags.nix @@ -1,41 +1,36 @@ self: { config, - lib, pkgs, ... }: { config = let - # Libs - inherit (lib) removePrefix; - cfg = config.roles.desktop; + agsCfg = hmCfg.programs.ags; hmCfg = config.home-manager.users.${cfg.user}; - ags = hmCfg.programs.ags-v2.package; hyprland = hmCfg.wayland.windowManager.hyprland.finalPackage; agsConfig = let homeFiles = config.home-manager.users.${cfg.user}.home.file; - agsDir = "${removePrefix "/home/${cfg.user}/" config.environment.variables.FLAKE}/nixosModules/ags-v2/config"; - nodeModules = homeFiles."${agsDir}/node_modules".source; - tsconfig = homeFiles."${agsDir}/tsconfig.json".source; - varsTs = homeFiles."${agsDir}/widgets/lockscreen/vars.ts".source; + 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-v2/config}/* ./. + cp -ar ${../../ags/config}/* ./. chmod +w -R ./. cp -ar ${varsTs} ./widgets/lockscreen/vars.ts cp -ar ${nodeModules} ./node_modules - ${ags}/bin/ags bundle ./app.ts $out + ${agsCfg.package}/bin/ags bundle ./app.ts $out ''; in { assertions = [ { - assertion = cfg.ags-v2.enable; + assertion = cfg.ags.enable; message = '' - The Display Manager requires AGSv2 to be enabled. + The Display Manager requires AGS to be enabled. ''; } ]; @@ -54,7 +49,7 @@ self: { name = "agsGreeter"; runtimeInputs = [ - ags + agsCfg.package hyprland ];