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 = { outputs =
self, { nixpkgs, ags, ... }:
nixpkgs, let
ags,
}: let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system}; 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} = { packages.${system} = {
default = ags.lib.bundle { default = ags.lib.bundle {
inherit pkgs; inherit pkgs;
@ -36,6 +55,9 @@
devShells.${system} = { devShells.${system} = {
default = pkgs.mkShell { default = pkgs.mkShell {
buildInputs = [ buildInputs = [
devRunScript
devStopScript
pkgs.zellij
# includes all Astal libraries # includes all Astal libraries
# ags.packages.${system}.agsFull # ags.packages.${system}.agsFull