feat: migrate to ags v3

This commit is contained in:
tux
2025-09-24 16:39:34 +05:30
parent 6437cad620
commit 9649ab0b6e
26 changed files with 330 additions and 451 deletions

View File

@@ -1,11 +1,9 @@
{
description = "tux's widgets for wayland";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
astal = {
url = "github:aylur/astal";
inputs.nixpkgs.follows = "nixpkgs";
};
ags = {
url = "github:aylur/ags";
inputs.nixpkgs.follows = "nixpkgs";
@@ -15,29 +13,54 @@
outputs = {
self,
nixpkgs,
astal,
ags,
}: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
pname = "tpanel";
entry = "app.ts";
agsPackages = with ags.packages.${system}; [
io
astal4
hyprland
apps
battery
tray
network
notifd
];
extraPackages =
agsPackages
++ [
pkgs.libadwaita
];
in {
packages.${system} = {
default = let
tpanel = ags.lib.bundle {
inherit pkgs;
tpanel = pkgs.stdenv.mkDerivation {
name = pname;
src = ./.;
name = "tpanel";
entry = "app.ts";
gtk4 = true;
extraPackages = with ags.packages.${system}; [
hyprland
apps
battery
tray
network
notifd
nativeBuildInputs = with pkgs; [
wrapGAppsHook
gobject-introspection
ags.packages.${system}.default
];
buildInputs = extraPackages ++ [pkgs.gjs];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
mkdir -p $out/share
cp -r * $out/share
ags bundle ${entry} $out/bin/${pname} -d "SRC='$out/share'"
runHook postInstall
'';
};
in
pkgs.runCommand "tpanel" {
@@ -67,7 +90,7 @@
'';
astal = astal.packages.${system};
ags = ags.packages.${system};
};
apps.default = {
@@ -77,20 +100,9 @@
devShells.${system} = {
default = pkgs.mkShell {
nativeBuildInputs = [
astal.packages.${system}.default
];
buildInputs = [
# includes astal3 astal4 astal-io by default
(ags.packages.${system}.default.override {
extraPackages = with ags.packages.${system}; [
hyprland
apps
battery
tray
network
notifd
];
inherit extraPackages;
})
];
};