diff --git a/flake.nix b/flake.nix index f433d46..21f31c9 100644 --- a/flake.nix +++ b/flake.nix @@ -10,43 +10,65 @@ }; }; - outputs = { - self, - nixpkgs, - ags, - }: let - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; - in { - packages.${system} = { - default = ags.lib.bundle { - inherit pkgs; - src = ./.; - name = "my-shell"; - entry = "app.ts"; + outputs = + { nixpkgs, ags, ... }: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + 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; + src = ./.; + name = "my-shell"; + entry = "app.ts"; - # additional libraries and executables to add to gjs' runtime - extraPackages = [ - # ags.packages.${system}.battery - # pkgs.fzf - ]; + # additional libraries and executables to add to gjs' runtime + extraPackages = [ + # ags.packages.${system}.battery + # pkgs.fzf + ]; + }; + }; + + devShells.${system} = { + default = pkgs.mkShell { + buildInputs = [ + devRunScript + devStopScript + pkgs.zellij + # includes all Astal libraries + # ags.packages.${system}.agsFull + + # includes astal3 astal4 astal-io by default + (ags.packages.${system}.default.override { + extraPackages = [ + # cherry pick packages + ]; + }) + ]; + }; }; }; - - devShells.${system} = { - default = pkgs.mkShell { - buildInputs = [ - # includes all Astal libraries - # ags.packages.${system}.agsFull - - # includes astal3 astal4 astal-io by default - (ags.packages.${system}.default.override { - extraPackages = [ - # cherry pick packages - ]; - }) - ]; - }; - }; - }; }