fixes and touchups

This commit is contained in:
Aylur
2024-09-12 01:18:50 +02:00
parent 865675a012
commit 56aa40a876
4 changed files with 25 additions and 9 deletions
+1 -1
View File
@@ -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
*/
+7 -1
View File
@@ -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
];
};
};
}
+17 -7
View File
@@ -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}
)
'';
}