summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAylur <[email protected]>2024-10-15 11:47:26 +0000
committerAylur <[email protected]>2024-10-15 11:47:26 +0000
commitdde50e333a237efb4ddaf522398dedf1a69999d1 (patch)
treecd15cbff14d971ea7dd570520c379156c9761a6e /docs
parentede8890a08b3fbbb1f6df3b8c277ab6424d1befd (diff)
docs: update references flake
Diffstat (limited to 'docs')
-rw-r--r--docs/default.nix135
1 files changed, 80 insertions, 55 deletions
diff --git a/docs/default.nix b/docs/default.nix
index 3d91a63..5a85fc3 100644
--- a/docs/default.nix
+++ b/docs/default.nix
@@ -7,50 +7,39 @@
toTOML = (pkgs.formats.toml {}).generate;
- genRefForPkg = {
- name,
- pkg,
- version ? "0.1",
- outPath,
- metaData,
- }: let
- data = toTOML name metaData;
- output = self.packages.${pkgs.system}.${pkg}.dev;
- in ''
- mkdir -p $out/${outPath}
- cat ${urlmap} > urlmap.js
- gi-docgen generate -C ${data} ${output}/share/gir-1.0/${name}-${version}.gir
- cp -r ${name}-${version}/* $out/${outPath}
- '';
-
- genLib = name: namespace: {
- description,
+ genLib = {
+ flakepkg,
+ gir,
version,
+ description,
api-ver ? "0.1",
authors ? "Aylur",
dependencies ? {},
- out ? "libastal/${name}",
- }:
- genRefForPkg {
- name = "Astal${namespace}";
- pkg = name;
- outPath = out;
- version = api-ver;
- metaData = {
- library = {
- inherit description authors;
- version = readVer version;
- license = "LGPL-2.1";
- browse_url = "https://github.com/aylur/astal";
- repository_url = "https://github.com/aylur/aylur.git";
- website_url = "https://aylur.github.io/astal";
- dependencies = ["GObject-2.0"] ++ (builtins.attrNames dependencies);
- };
+ out ? "libastal/${flakepkg}",
+ }: let
+ name = "Astal${gir}-${api-ver}";
+ src = self.packages.${pkgs.system}.${flakepkg}.dev;
- extra.urlmap_file = "urlmap.js";
- dependencies = {inherit (dependency) "GObject-2.0";} // dependencies;
+ data = toTOML gir {
+ library = {
+ inherit description authors;
+ version = readVer version;
+ license = "LGPL-2.1";
+ browse_url = "https://github.com/aylur/astal";
+ repository_url = "https://github.com/aylur/aylur.git";
+ website_url = "https://aylur.github.io/astal";
+ dependencies = ["GObject-2.0"] ++ (builtins.attrNames dependencies);
};
+
+ extra.urlmap_file = "urlmap.js";
+ dependencies = {inherit (dependency) "GObject-2.0";} // dependencies;
};
+ in ''
+ mkdir -p $out/${out}
+ cat ${urlmap} > urlmap.js
+ gi-docgen generate -C ${data} ${src}/share/gir-1.0/${name}.gir
+ cp -r ${name}/* $out/${out}
+ '';
dependency = {
"GObject-2.0" = {
@@ -63,6 +52,11 @@
description = "The GTK toolkit";
docs_url = "https://docs.gtk.org/gtk3/";
};
+ "AstalIO-0.1" = {
+ name = "AstalIO";
+ description = "Astal Core library";
+ docs_url = "https://aylur.github.io/libastal/io";
+ };
"NM-1.0" = {
name = "NetworkManager";
description = "The standard Linux network configuration tool suite";
@@ -83,6 +77,7 @@
["Gdk" "https://docs.gtk.org/gdk3/"]
["Gtk" "https://docs.gtk.org/gtk3/"]
["GdkPixbuf" "https://docs.gtk.org/gdk-pixbuf/"]
+ ["AstalIO" "https://aylur.github.io/libastal/io"]
# FIXME: these are not gi-docgen generated, therefore links are broken
["NM" "https://networkmanager.dev/docs/libnm/latest/"]
@@ -91,7 +86,7 @@
'';
in
pkgs.stdenvNoCC.mkDerivation {
- name = "library-reference";
+ name = "reference";
src = ./.;
nativeBuildInputs = with pkgs; [
@@ -105,69 +100,99 @@ in
libdbusmenu-gtk3
wireplumber
networkmanager
+ self.packages.${system}.io
];
installPhase = ''
runHook preInstall
- ${genLib "io" "IO" {
- description = "Astal IO library";
+ ${genLib {
+ flakepkg = "io";
+ gir = "IO";
+ api-ver = "0.1";
+ description = "Astal Core library";
version = ../lib/astal/io/version;
}}
- ${genLib "astal3" "" {
+ ${genLib {
+ flakepkg = "astal3";
+ gir = "";
api-ver = "3.0";
- description = "Astal GTK3 library";
+ description = "Astal GTK3 widget library";
version = ../lib/astal/gtk3/version;
- dependencies = {inherit (dependency) "Gtk-3.0";};
+ dependencies = {inherit (dependency) "AstalIO-0.1" "Gtk-3.0";};
}}
- ${genLib "apps" "Apps" {
+ ${genLib {
+ flakepkg = "apps";
+ gir = "Apps";
description = "Application query library";
version = ../lib/apps/version;
}}
- ${genLib "auth" "Auth" {
+ ${genLib {
+ flakepkg = "auth";
+ gir = "Auth";
authors = "kotontrion";
description = "Authentication using pam";
version = ../lib/auth/version;
}}
- ${genLib "battery" "Battery" {
+ ${genLib {
+ flakepkg = "battery";
+ gir = "Battery";
description = "DBus proxy for upowerd devices";
version = ../lib/battery/version;
}}
- ${genLib "bluetooth" "Bluetooth" {
+ ${genLib {
+ flakepkg = "bluetooth";
+ gir = "Bluetooth";
description = "DBus proxy for bluez";
version = ../lib/bluetooth/version;
}}
- ${genLib "hyprland" "Hyprland" {
+ ${genLib {
+ flakepkg = "hyprland";
+ gir = "Hyprland";
description = "IPC client for Hyprland";
version = ../lib/hyprland/version;
}}
- ${genLib "mpris" "Mpris" {
+ ${genLib {
+ flakepkg = "mpris";
+ gir = "Mpris";
description = "Control mpris players";
version = ../lib/mpris/version;
}}
- ${genLib "network" "Network" {
+ ${genLib {
+ flakepkg = "network";
+ gir = "Network";
description = "NetworkManager wrapper library";
version = ../lib/network/version;
dependencies = {inherit (dependency) "NM-1.0";}; # FIXME: why does this not work?
}}
- ${genLib "notifd" "Notifd" {
+ ${genLib {
+ flakepkg = "notifd";
+ gir = "Notifd";
description = "Notification daemon library";
version = ../lib/notifd/version;
}}
- ${genLib "powerprofiles" "PowerProfiles" {
+ ${genLib {
+ flakepkg = "powerprofiles";
+ gir = "PowerProfiles";
description = "DBus proxy for upowerd profiles";
version = ../lib/powerprofiles/version;
}}
- ${genLib "river" "River" {
+ ${genLib {
+ flakepkg = "river";
+ gir = "River";
description = "IPC client for River";
version = ../lib/river/version;
authors = "kotontrion";
}}
- ${genLib "tray" "Tray" {
+ ${genLib {
+ flakepkg = "tray";
+ gir = "Tray";
description = "StatusNotifierItem implementation";
version = ../lib/tray/version;
authors = "kotontrion";
}}
- ${genLib "wireplumber" "Wp" {
+ ${genLib {
+ flakepkg = "wireplumber";
+ gir = "Wp";
description = "Wrapper library over the wireplumber API";
version = ../lib/wireplumber/version;
authors = "kotontrion";