Unverified Commit 098d23f2 authored by Masum Reza's avatar Masum Reza Committed by GitHub
Browse files

ags: 1.8.2 -> 2.2.1 (#373562)

* astal.io: revise description

* ags: rename to ags_1

* ags: init at 2.2.1
parents fde28252 7bd40e30
Loading
Loading
Loading
Loading
+39 −0
Original line number Diff line number Diff line
# Astal {#astal}

Astal is a collection of building blocks for creating custom desktop shells.

## Bundling {#astal-bundling}

Bundling Astal application is done using `ags` tool, you can use it like this:

```nix
ags.bundle {
  pname = "hyprpanel";
  version = "1.0.0";

  src = fetchFromGitHub { ... };

  # change your entry file (default is `app.ts`)
  entry = "app.ts";

  dependencies = [
    # list here astal modules, that your package depends on
    # `astal3`, `astal4` and `astal.io` are automatically included
    astal.apps
    astal.battery
    astal.bluetooth

    # you can also list here other runtime dependencies
    hypridle
    hyprpicker
    hyprsunset
  ];

  # GTK 4 support is opt-in
  enableGtk4 = true;

  meta = { ... };
}
```

You can also pass all other arguments that are supported by `stdenv.mkDerivation`.
+1 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ Each supported language or software ecosystem has its own package set named `<la
```{=include=} sections
agda.section.md
android.section.md
astal.section.md
beam.section.md
bower.section.md
chicken.section.md
+6 −0
Original line number Diff line number Diff line
@@ -2349,6 +2349,12 @@
  "using-predefined-android-package-compositions": [
    "index.html#using-predefined-android-package-compositions"
  ],
  "astal": [
    "index.html#astal"
  ],
  "astal-bundling": [
    "index.html#astal-bundling"
  ],
  "spawning-emulator-instances": [
    "index.html#spawning-emulator-instances"
  ],
+7 −0
Original line number Diff line number Diff line
@@ -277,6 +277,13 @@
  [v1.7.0](https://github.com/jtroo/kanata/releases/tag/v1.7.0)
  for more information.

- `ags` was updated to v2, which is just a CLI for Astal now. Components are available as a different package set `astal.*`.
  If you want to use v1, it is available as `ags_1` package.

  See the release notes of
  [v2.0.0](https://github.com/Aylur/ags/releases/tag/v2.0.0)
  for more information.

- `nodePackages.expo-cli` has been removed, as it was deprecated by upstream. The suggested replacement is the `npx expo` command.

- DokuWiki with the Caddy webserver (`services.dokuwiki.webserver = "caddy"`) now sets up sites with Caddy's automatic HTTPS instead of HTTP-only.
+86 −0
Original line number Diff line number Diff line
{
  lib,
  ags,
  astal,
  dart-sass,
  fzf,
  gjs,
  gnused,
  gobject-introspection,
  gtk3,
  gtk4-layer-shell,
  stdenvNoCC,
  wrapGAppsHook3,
  wrapGAppsHook4,
}:
{
  entry ? "app.ts",
  dependencies ? [ ],
  enableGtk4 ? false,
  ...
}@attrs:
stdenvNoCC.mkDerivation (
  finalAttrs:
  attrs
  // {
    nativeBuildInputs = (attrs.nativeBuildInputs or [ ]) ++ [
      (ags.override { extraPackages = dependencies; })
      gnused
      gobject-introspection
      (if enableGtk4 then wrapGAppsHook4 else wrapGAppsHook3)
    ];

    buildInputs =
      (attrs.buildInputs or [ ])
      ++ dependencies
      ++ [
        gjs
        astal.astal4
        astal.astal3
        astal.io
      ];

    preFixup =
      ''
        gappsWrapperArgs+=(
          --prefix PATH : ${
            lib.makeBinPath (
              dependencies
              ++ [
                dart-sass
                fzf
                gtk3
              ]
            )
          }
        )
      ''
      + lib.optionalString enableGtk4 ''
        gappsWrapperArgs+=(
          --set LD_PRELOAD "${gtk4-layer-shell}/lib/libgtk4-layer-shell.so"
        )
      ''
      + (attrs.preFixup or "");

    installPhase =
      let
        outBin = "$out/bin/${finalAttrs.pname}";
      in
      # bash
      ''
        runHook preInstall

        mkdir -p "$out/bin" "$out/share"
        cp -r ./* "$out/share"
        ags bundle "${entry}" "${outBin}" -d "SRC='$out/share'"

        chmod +x "${outBin}"

        if ! head -n 1 "${outBin}" | grep -q "^#!"; then
          sed -i '1i #!${gjs}/bin/gjs -m' "${outBin}"
        fi

        runHook postInstall
      '';
  }
)
Loading