From a62010ee4fd25c620df726970b070f63aa9f45cc Mon Sep 17 00:00:00 2001 From: Jake Stanger Date: Sat, 30 Mar 2024 23:43:30 +0000 Subject: [PATCH] build(nix): add luajit and lgi support --- flake.nix | 6 ++++++ nix/default.nix | 29 ++++++++++++++++++++++++++--- shell.nix | 2 ++ 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index ce371ff..db4cacc 100644 --- a/flake.nix +++ b/flake.nix @@ -106,9 +106,11 @@ program = "${pkgs.ironbar}/bin/ironbar"; }; }); + devShells = genSystems (system: let pkgs = pkgsFor system; rust = mkRustToolchain pkgs; + in { default = pkgs.mkShell { packages = with pkgs; [ @@ -128,11 +130,15 @@ gsettings-desktop-schemas libxkbcommon libpulseaudio + luajit + luajitPackages.lgi ]; RUST_SRC_PATH = "${rust}/lib/rustlib/src/rust/library"; }; + }); + homeManagerModules.default = { config, lib, diff --git a/nix/default.nix b/nix/default.nix index 142bc6f..f013470 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -14,6 +14,8 @@ libxkbcommon, libpulseaudio, openssl, + luajit, + luajitPackages, pkg-config, hicolor-icon-theme, rustPlatform, @@ -30,11 +32,28 @@ name = "ironbar"; path = lib.cleanSource ../.; }; - nativeBuildInputs = [pkg-config wrapGAppsHook gobject-introspection]; - buildInputs = [gtk3 gdk-pixbuf glib gtk-layer-shell glib-networking shared-mime-info gnome.adwaita-icon-theme hicolor-icon-theme gsettings-desktop-schemas libxkbcommon libpulseaudio openssl]; - propagatedBuildInputs = [ + nativeBuildInputs = [ pkg-config wrapGAppsHook gobject-introspection ]; + + buildInputs = [ gtk3 + gdk-pixbuf + glib + gtk-layer-shell + glib-networking + shared-mime-info + gnome.adwaita-icon-theme + hicolor-icon-theme + gsettings-desktop-schemas + libxkbcommon + libpulseaudio + openssl + luajit ]; + + propagatedBuildInputs = [ gtk3 ]; + + lgi = luajitPackages.lgi; + preFixup = '' gappsWrapperArgs+=( # Thumbnailers @@ -45,6 +64,10 @@ # gtk-launch --suffix PATH : "${lib.makeBinPath [ gtk3 ]}" + + # cairo + --prefix LUA_PATH : "./?.lua;${lgi}/share/lua/5.1/?.lua;${lgi}/share/lua/5.1/?/init.lua;${luajit}/share/lua/5.1/\?.lua;${luajit}/share/lua/5.1/?/init.lua" + --prefix LUA_CPATH : "./?.so;${lgi}/lib/lua/5.1/?.so;${luajit}/lib/lua/5.1/?.so;${luajit}/lib/lua/5.1/loadall.so" ) ''; passthru = { diff --git a/shell.nix b/shell.nix index 66f6b9d..b15e8e9 100644 --- a/shell.nix +++ b/shell.nix @@ -10,6 +10,8 @@ pkgs.mkShell { gcc openssl libpulseaudio + luajit + luajitPackages.lgi ]; nativeBuildInputs = with pkgs; [