summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAylur <[email protected]>2024-09-12 01:18:50 +0200
committerAylur <[email protected]>2024-09-12 01:18:50 +0200
commit56aa40a8765fc3d2da61cda3775e894d8dd0c7d9 (patch)
tree2dfc0ab5599b300ef75ca79f9c7ed12c74f4bc8e
parent865675a0122faae76db3196c5cba96e012f9e2e7 (diff)
fixes and touchups
-rw-r--r--core/src/widget/stack.vala2
-rw-r--r--docs/getting-started/nix.md8
-rw-r--r--examples/lua/simple-bar/init.lua (renamed from examples/lua/simple-bar/app.lua)0
-rw-r--r--nix/lua.nix24
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}
+ )
+ '';
}