feat(flake): zellij check-in and auto-attach in devenv

Signed-off-by: s0me1newithhand7s <git+me@hand7s.org>
This commit is contained in:
s0me1newithhand7s 2026-05-22 22:59:12 +03:00
parent cc380d9fdb
commit 54b8caa274

View file

@ -633,8 +633,27 @@
perSystem = { perSystem = {
config, config,
pkgs, pkgs,
lib,
... ...
}: { }: {
packages = {
"zide" = pkgs.writeShellApplication {
name = "zellij-ide";
runtimeInputs = with pkgs; [
uutils-coreutils-noprefix
zellij
];
text = ''
if [ -z "''${ZELLIJ:-}" ]; then
SESSION_NAME=$(basename "''${PWD}")
${lib.getExe pkgs.zellij} attach "''${SESSION_NAME}" || ${lib.getExe pkgs.zellij} --layout zide --session "''${SESSION_NAME}"
fi
'';
};
};
# agenix-rekey # agenix-rekey
agenix-rekey = { agenix-rekey = {
agePackage = pkgs.ragenix; agePackage = pkgs.ragenix;
@ -737,7 +756,7 @@
devenv = { devenv = {
shells = { shells = {
"default" = { "default" = {
enterShell = config.pre-commit.shellHook; enterShell = "${lib.getExe config.packages."zide"} && ${config.pre-commit.shellHook}";
devenv = { devenv = {
root = toString /home/hand7s/Projects/flake; root = toString /home/hand7s/Projects/flake;