refactor(ags): clean up girName handling
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
7fd5ab5bc3
commit
8157d3ef2d
2 changed files with 16 additions and 18 deletions
BIN
flake.lock
BIN
flake.lock
Binary file not shown.
|
@ -3,8 +3,8 @@
|
||||||
self,
|
self,
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) readFile fromJSON;
|
inherit (builtins) readFile fromJSON;
|
||||||
inherit (self.lib) capitalise mkVersion;
|
inherit (self.lib) mkVersion;
|
||||||
inherit (pkgs.lib) concatMapStrings elemAt length map optionalString splitString toLower;
|
inherit (pkgs.lib) elemAt hasAttr length map optionalString toLower;
|
||||||
in {
|
in {
|
||||||
buildPlugin = pname: src:
|
buildPlugin = pname: src:
|
||||||
pkgs.vimUtils.buildVimPlugin {
|
pkgs.vimUtils.buildVimPlugin {
|
||||||
|
@ -33,25 +33,23 @@ in {
|
||||||
pname,
|
pname,
|
||||||
delete ? [],
|
delete ? [],
|
||||||
}: let
|
}: let
|
||||||
|
girNameTable = {
|
||||||
|
gtk4 = "Gtk-4.0";
|
||||||
|
gtk-session-lock = "GtkSessionLock-0.1";
|
||||||
|
libadwaita = "Adw-1";
|
||||||
|
};
|
||||||
|
|
||||||
withGirNames =
|
withGirNames =
|
||||||
map (package: {
|
map (package: let
|
||||||
|
in {
|
||||||
inherit package;
|
inherit package;
|
||||||
girName =
|
girName =
|
||||||
if package.pname == "astal-wireplumber"
|
package.girName
|
||||||
then "AstalWp-0.1"
|
or (
|
||||||
else if package.pname == "astal"
|
if hasAttr package.pname girNameTable
|
||||||
then "AstalIO-0.1"
|
then girNameTable.${package.pname}
|
||||||
else if package.pname == "astal3"
|
else throw "girName of ${package.name} couldn't be found"
|
||||||
then "Astal-3.0"
|
);
|
||||||
else if package.pname == "astal4"
|
|
||||||
then "Astal-4.0"
|
|
||||||
else if package.pname == "astal-powerprofiles"
|
|
||||||
then "AstalPowerProfiles-0.1"
|
|
||||||
else if package.pname == "gtk4"
|
|
||||||
then "Gtk-4.0"
|
|
||||||
else if package.pname == "libadwaita"
|
|
||||||
then "Adw-1"
|
|
||||||
else (concatMapStrings capitalise (splitString "-" package.pname)) + "-0.1";
|
|
||||||
})
|
})
|
||||||
packages;
|
packages;
|
||||||
in {
|
in {
|
||||||
|
|
Loading…
Reference in a new issue