flake: added zellij to run dev scripts

This commit is contained in:
Tigor Hutasuhut 2024-11-21 20:53:50 +07:00
parent 637013b9ac
commit e878cd7021

View file

@ -10,14 +10,33 @@
};
};
outputs = {
self,
nixpkgs,
ags,
}: let
outputs =
{ nixpkgs, ags, ... }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
layout =
pkgs.writeText "layout.kdl"
# kdl
''
layout {
pane {
pane name="command"
pane command="bash" {
name "ags"
args "-c" "ags run ./app.ts"
}
}
}
'';
devRunScript = pkgs.writeShellScriptBin "dev-run" ''
zellij --layout ${layout} attach --create ags
'';
devStopScript = pkgs.writeShellScriptBin "dev-stop" ''
zellij delete-session --force ags || true
'';
in
{
packages.${system} = {
default = ags.lib.bundle {
inherit pkgs;
@ -36,6 +55,9 @@
devShells.${system} = {
default = pkgs.mkShell {
buildInputs = [
devRunScript
devStopScript
pkgs.zellij
# includes all Astal libraries
# ags.packages.${system}.agsFull