bins/tstart: remove infavor of smug

This commit is contained in:
Aaron Bieber 2024-02-11 17:29:31 -07:00
parent 10ff6879cd
commit 29962e5e74
No known key found for this signature in database
4 changed files with 88 additions and 44 deletions

View File

@ -13,8 +13,6 @@ let
xinStatus = xinStatus =
pkgs.writeScriptBin "xin-status" pkgs.writeScriptBin "xin-status"
(import ./xin-status.nix { inherit (pkgs) perl perlPackages; }); (import ./xin-status.nix { inherit (pkgs) perl perlPackages; });
tstart =
pkgs.writeScriptBin "tstart" (import ./tstart.nix { inherit (pkgs) tmux; });
sfetch = pkgs.writeScriptBin "sfetch" (import ./sfetch.nix { sfetch = pkgs.writeScriptBin "sfetch" (import ./sfetch.nix {
inherit gosignify; inherit gosignify;
inherit (pkgs) curl; inherit (pkgs) curl;
@ -31,7 +29,6 @@ in
genPatches genPatches
ix ix
sfetch sfetch
tstart
xclip xclip
xinStatus xinStatus
] ++ (if config.services.postgresql.enable then ] ++ (if config.services.postgresql.enable then

View File

@ -1,41 +0,0 @@
{ tmux }:
let
tmuxBin = "${tmux}/bin/tmux";
in
''
#!/usr/bin/env sh
set -e
SNAME="Main"
SSES="-s $SNAME"
IDX=1
if ${tmuxBin} ls | grep -q "^''${SNAME}:"; then
${tmuxBin} -u2 at -t "$SNAME"
else
${tmuxBin} -2 new-session -d $SSES
if [ -e ~/.tmux.windows ]; then
count=$IDX
for n in $(cat ~/.tmux.windows); do
if [ $n == "_" ]; then
${tmuxBin} new-window
else
if [ $count -eq $IDX ]; then
${tmuxBin} rename-window "$n"
else
${tmuxBin} new-window -n "$n"
fi
fi
((count=count+1))
done
else
${tmuxBin} rename-window "IRC"
${tmuxBin} new-window -n "Mail"
${tmuxBin} new-window -n "Misc"
${tmuxBin} new-window
fi
${tmuxBin} select-window -t$IDX
${tmuxBin} -2 attach-session -t $SNAME
fi
''

View File

@ -3,6 +3,7 @@
./alacritty.nix ./alacritty.nix
./ca.nix ./ca.nix
./ci.nix ./ci.nix
./smug.nix
./colemak.nix ./colemak.nix
./dns.nix ./dns.nix
./doas.nix ./doas.nix

87
configs/smug.nix Normal file
View File

@ -0,0 +1,87 @@
{ config
, pkgs
, ...
}:
let
tmuxFormat = pkgs.formats.yaml { };
in
{
config = {
programs.zsh.promptInit = ''
alias tstart='smug -f /etc/smug/main.yml start';
alias cistart='smug -f /etc/smug/ci.yml start';
'';
environment = {
systemPackages = with pkgs; [
smug
];
etc."smug/ci.yml".text = builtins.readFile (tmuxFormat.generate "ci.yml" {
session = "CI";
root = "~/";
windows = [
{
name = "CI Status";
commands = [
"journalctl -xef -u xin-ci-update.service"
];
panes = [
{
commands = [ "journalctl -xef -u xin-ci.service" ];
}
];
}
{
commands = [
"btop"
];
}
];
});
etc."smug/main.yml".text = builtins.readFile (tmuxFormat.generate "main.yml" {
session = "Main";
root = "~/";
windows = [
{
name = "Status";
commands = [
"while true; do ssh -4 anonicb@slackers.openbsd.org; sleep 300; done"
];
panes = [
{
commands = [ "mosh pwntie" ];
}
];
}
{
name = "Barrier";
commands = [
"barriers -a 127.0.0.1 -f --disable-crypto"
];
panes = [
{
commands = [ "ssh stan" ];
}
];
}
{
name = "Xin";
root = "src/xin";
}
{
name = "Lab";
root = "src/biltong";
}
{
name = "NixPkgs";
root = "src/nixpkgs";
}
{
name = "NomadNet";
root = "reticulum";
}
];
});
};
};
}