diff options
-rw-r--r-- | core/src/widget/stack.vala | 2 | ||||
-rw-r--r-- | docs/getting-started/nix.md | 8 | ||||
-rw-r--r-- | examples/lua/simple-bar/init.lua (renamed from examples/lua/simple-bar/app.lua) | 0 | ||||
-rw-r--r-- | nix/lua.nix | 24 |
4 files changed, 25 insertions, 9 deletions
diff --git a/core/src/widget/stack.vala b/core/src/widget/stack.vala index d1d345f..e9a2bd2 100644 --- a/core/src/widget/stack.vala +++ b/core/src/widget/stack.vala @@ -1,4 +1,4 @@ -public class Astal.Switch : Gtk.Stack { +public class Astal.Stack : Gtk.Stack { /** * whether to implicity destroy previous children when setting them */ diff --git a/docs/getting-started/nix.md b/docs/getting-started/nix.md index bfdfdc7..f09a80b 100644 --- a/docs/getting-started/nix.md +++ b/docs/getting-started/nix.md @@ -22,7 +22,13 @@ Using Astal on Nix will require you to package your project. in { packages.${system}.default = astal.lib.mkLuaPacakge { inherit pkgs; - src = ./path/to/project; # should contain app.lua + src = ./path/to/project; # should contain init.lua + + # add extra glib packages or binaries + extraPackages = [ + astal.packages.${system}.battery + pkgs.dart-sass + ]; }; }; } diff --git a/examples/lua/simple-bar/app.lua b/examples/lua/simple-bar/init.lua index aecf7a6..aecf7a6 100644 --- a/examples/lua/simple-bar/app.lua +++ b/examples/lua/simple-bar/init.lua diff --git a/nix/lua.nix b/nix/lua.nix index a790021..0986836 100644 --- a/nix/lua.nix +++ b/nix/lua.nix @@ -10,9 +10,8 @@ defaults: { (extraLuaPackages ps) ++ [ ps.lgi - (ps.luaPackages.toLuaModule (pkgs.stdenv.mkDerivation { + (ps.luaPackages.toLuaModule (pkgs.stdenvNoCC.mkDerivation { name = "astal"; - version = "0.1.0"; src = "${astal}/core/lua"; dontBuild = true; installPhase = '' @@ -20,12 +19,19 @@ defaults: { cp -r astal/* $out/share/lua/${ps.lua.luaversion}/astal ''; })) + (ps.luaPackages.toLuaModule (pkgs.stdenvNoCC.mkDerivation { + inherit src name; + dontBuild = true; + installPhase = '' + mkdir -p $out/share/lua/${ps.lua.luaversion} + cp -r * $out/share/lua/${ps.lua.luaversion} + ''; + })) ]); script = '' #!${lua}/bin/lua - package.path = package.path .. ";${src}/?.lua" - require "app" + require "init" ''; in pkgs.stdenvNoCC.mkDerivation { @@ -45,14 +51,18 @@ in installPhase = '' runHook preInstall + mkdir -p $out/bin cp -r * $out/bin echo '${script}' > astal-lua install -m 755 astal-lua $out/bin/${name} + runHook postInstall ''; - gappsWrapperArgs = [ - "--prefix PATH : ${pkgs.lib.makeBinPath extraPackages}" - ]; + preFixup = '' + gappsWrapperArgs+=( + --prefix PATH : ${pkgs.lib.makeBinPath extraPackages} + ) + ''; } |