From 1e8e3742f6433bc2799ff711d35a42a997ba2ba2 Mon Sep 17 00:00:00 2001 From: Joshua Yuen Date: Sat, 12 Sep 2026 00:38:11 -0400 Subject: [PATCH] more stuff --- flake.lock | 43 ++++++++++++++ flake.nix | 5 ++ modules/{homes => home}/ags/.gitignore | 0 modules/{homes => home}/ags/app.ts | 0 modules/home/ags/default.nix | 57 +++++++++++++++++++ modules/{homes => home}/ags/env.d.ts | 0 modules/{homes => home}/ags/flake.lock | 0 modules/{homes => home}/ags/flake.nix | 0 modules/{homes => home}/ags/package.json | 0 modules/{homes => home}/ags/style.scss | 0 modules/{homes => home}/ags/tsconfig.json | 0 modules/{homes => home}/ags/widget/Bar.tsx | 25 +++----- .../{homes => home}/ags/widget/Battery.tsx | 2 +- modules/home/default.nix | 1 + modules/options/ags.nix | 13 +++++ modules/options/default.nix | 1 + profiles/desktop/default.nix | 2 + 17 files changed, 130 insertions(+), 19 deletions(-) rename modules/{homes => home}/ags/.gitignore (100%) rename modules/{homes => home}/ags/app.ts (100%) create mode 100644 modules/home/ags/default.nix rename modules/{homes => home}/ags/env.d.ts (100%) rename modules/{homes => home}/ags/flake.lock (100%) rename modules/{homes => home}/ags/flake.nix (100%) rename modules/{homes => home}/ags/package.json (100%) rename modules/{homes => home}/ags/style.scss (100%) rename modules/{homes => home}/ags/tsconfig.json (100%) rename modules/{homes => home}/ags/widget/Bar.tsx (54%) rename modules/{homes => home}/ags/widget/Battery.tsx (95%) create mode 100644 modules/options/ags.nix diff --git a/flake.lock b/flake.lock index e198b55..d5475ac 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,47 @@ { "nodes": { + "ags": { + "inputs": { + "astal": "astal", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1775689345, + "narHash": "sha256-tM3s7CX+tgxlYW0Sk3nzVThg2MHn08foIuMxABupxIs=", + "owner": "aylur", + "repo": "ags", + "rev": "bbee2f18939f1ec7ff720e717cf305e73635628f", + "type": "github" + }, + "original": { + "owner": "aylur", + "repo": "ags", + "type": "github" + } + }, + "astal": { + "inputs": { + "nixpkgs": [ + "ags", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1773914523, + "narHash": "sha256-GOL+bR30FPImAzy4NNsTMY1gpoINMsLTXR0WJBRSq30=", + "owner": "aylur", + "repo": "astal", + "rev": "41b50290c6a1cdce7b482897c22fe49286912b9a", + "type": "github" + }, + "original": { + "owner": "aylur", + "repo": "astal", + "type": "github" + } + }, "base16": { "inputs": { "fromYaml": "fromYaml" @@ -260,6 +302,7 @@ }, "root": { "inputs": { + "ags": "ags", "elephant": "elephant", "home-manager": "home-manager", "install-system": "install-system", diff --git a/flake.nix b/flake.nix index cf035bb..f1b059e 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + ags = { + url = "github:aylur/ags"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + elephant = { url = "github:abenz1267/elephant/master"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/modules/homes/ags/.gitignore b/modules/home/ags/.gitignore similarity index 100% rename from modules/homes/ags/.gitignore rename to modules/home/ags/.gitignore diff --git a/modules/homes/ags/app.ts b/modules/home/ags/app.ts similarity index 100% rename from modules/homes/ags/app.ts rename to modules/home/ags/app.ts diff --git a/modules/home/ags/default.nix b/modules/home/ags/default.nix new file mode 100644 index 0000000..4ef7273 --- /dev/null +++ b/modules/home/ags/default.nix @@ -0,0 +1,57 @@ +{ + 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" + ]; + }; +} diff --git a/modules/homes/ags/env.d.ts b/modules/home/ags/env.d.ts similarity index 100% rename from modules/homes/ags/env.d.ts rename to modules/home/ags/env.d.ts diff --git a/modules/homes/ags/flake.lock b/modules/home/ags/flake.lock similarity index 100% rename from modules/homes/ags/flake.lock rename to modules/home/ags/flake.lock diff --git a/modules/homes/ags/flake.nix b/modules/home/ags/flake.nix similarity index 100% rename from modules/homes/ags/flake.nix rename to modules/home/ags/flake.nix diff --git a/modules/homes/ags/package.json b/modules/home/ags/package.json similarity index 100% rename from modules/homes/ags/package.json rename to modules/home/ags/package.json diff --git a/modules/homes/ags/style.scss b/modules/home/ags/style.scss similarity index 100% rename from modules/homes/ags/style.scss rename to modules/home/ags/style.scss diff --git a/modules/homes/ags/tsconfig.json b/modules/home/ags/tsconfig.json similarity index 100% rename from modules/homes/ags/tsconfig.json rename to modules/home/ags/tsconfig.json diff --git a/modules/homes/ags/widget/Bar.tsx b/modules/home/ags/widget/Bar.tsx similarity index 54% rename from modules/homes/ags/widget/Bar.tsx rename to modules/home/ags/widget/Bar.tsx index 7bb2007..65cb855 100644 --- a/modules/homes/ags/widget/Bar.tsx +++ b/modules/home/ags/widget/Bar.tsx @@ -1,6 +1,5 @@ import app from "ags/gtk4/app" import { Astal, Gtk, Gdk } from "ags/gtk4" -import { execAsync } from "ags/process" import { createPoll } from "ags/time" import BatteryWidget from "./Battery"; @@ -19,24 +18,14 @@ export default function Bar(gdkmonitor: Gdk.Monitor) { application={app} > - - - - - + + - + diff --git a/modules/homes/ags/widget/Battery.tsx b/modules/home/ags/widget/Battery.tsx similarity index 95% rename from modules/homes/ags/widget/Battery.tsx rename to modules/home/ags/widget/Battery.tsx index 6557f2b..142dbcf 100644 --- a/modules/homes/ags/widget/Battery.tsx +++ b/modules/home/ags/widget/Battery.tsx @@ -4,7 +4,7 @@ import { createBinding } from "ags"; import { Gtk } from "ags/gtk4"; export default function BatteryWidget() { -const battery = AstalBattery.get_default() + const battery = AstalBattery.get_default() const powerprofiles = AstalPowerProfiles.get_default() const percent = createBinding( diff --git a/modules/home/default.nix b/modules/home/default.nix index 1c84110..25039f4 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -3,6 +3,7 @@ }: { imports = [ + ./ags ./direnv.nix ./discord.nix ./firefox.nix diff --git a/modules/options/ags.nix b/modules/options/ags.nix new file mode 100644 index 0000000..042f5c0 --- /dev/null +++ b/modules/options/ags.nix @@ -0,0 +1,13 @@ +{ + lib, + ... +}: +with lib; +{ + options.modules.ags = { + enable = mkEnableOption { + default = false; + description = "Enable the AGS shell"; + }; + }; +} diff --git a/modules/options/default.nix b/modules/options/default.nix index 34f71db..eaf9103 100644 --- a/modules/options/default.nix +++ b/modules/options/default.nix @@ -3,6 +3,7 @@ }: { imports = [ + ./ags.nix ./discord.nix ./display.nix ./gnomeBoxes.nix diff --git a/profiles/desktop/default.nix b/profiles/desktop/default.nix index fbdaad2..c4d2740 100644 --- a/profiles/desktop/default.nix +++ b/profiles/desktop/default.nix @@ -15,6 +15,8 @@ modules.localsend.enable = true; + modules.ags.enable = true; + modules.zsh.enable = true; modules.shell.defaultShell = "zsh";