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,43 +10,65 @@
}; };
}; };
outputs = { outputs =
self, { nixpkgs, ags, ... }:
nixpkgs, let
ags, system = "x86_64-linux";
}: let pkgs = nixpkgs.legacyPackages.${system};
system = "x86_64-linux"; layout =
pkgs = nixpkgs.legacyPackages.${system}; pkgs.writeText "layout.kdl"
in { # kdl
packages.${system} = { ''
default = ags.lib.bundle { layout {
inherit pkgs; pane {
src = ./.; pane name="command"
name = "my-shell"; pane command="bash" {
entry = "app.ts"; 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 # additional libraries and executables to add to gjs' runtime
extraPackages = [ extraPackages = [
# ags.packages.${system}.battery # ags.packages.${system}.battery
# pkgs.fzf # 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
];
})
];
};
};
};
} }