xin/configs/smug.nix

129 lines
2.7 KiB
Nix
Raw Normal View History

{ lib, pkgs, ... }:
2024-02-11 17:29:31 -07:00
let
inherit (lib) mkMerge;
2024-02-11 17:29:31 -07:00
tmuxFormat = pkgs.formats.yaml { };
mkSmugEntry = name: cfg:
{
environment =
let
yamlFile = tmuxFormat.generate "${name}.yml" cfg;
startScript = pkgs.writeScriptBin name ''
${pkgs.smug}/bin/smug -f ${yamlFile} start
'';
in
{
systemPackages = [
startScript
];
};
};
2024-02-11 17:29:31 -07:00
in
{
config = mkMerge [
2024-04-24 08:45:06 -06:00
(mkSmugEntry "work"
{
session = "Work";
root = "~/";
before_start = [
"ssh-add"
];
windows = [
{
name = "VM";
layout = "even-vertical";
commands = [
"ssh vm"
];
}
{
name = "aef100";
root = "~/aef100";
}
];
})
(mkSmugEntry "cistart"
{
2024-02-11 17:29:31 -07:00
session = "CI";
root = "~/";
windows = [
{
name = "Status";
2024-02-11 21:50:31 -07:00
layout = "even-vertical";
2024-02-11 17:29:31 -07:00
commands = [
"journalctl -xef -u xin-ci-update.service"
];
panes = [
{
2024-02-11 21:50:31 -07:00
type = "even-vertical";
2024-02-11 17:29:31 -07:00
commands = [ "journalctl -xef -u xin-ci.service" ];
}
];
}
{
2024-02-11 21:50:31 -07:00
name = "btop";
2024-02-11 17:29:31 -07:00
commands = [
"btop"
];
}
{
name = "nix-binary-cache";
commands = [
"journalctl -xef -u nix-binary-cache.service"
];
}
2024-03-06 05:52:05 -07:00
{
name = "admin";
}
2024-02-11 17:29:31 -07:00
];
})
(mkSmugEntry "tstart"
{
2024-02-11 17:29:31 -07:00
session = "Main";
root = "~/";
before_start = [
"ssh-add"
];
2024-02-11 17:29:31 -07:00
windows = [
{
name = "Status";
commands = [
"while true; do ssh -4 anonicb@slackers.openbsd.org; sleep 300; done"
];
panes = [
{
commands = [ "mosh pwntie cistart" ];
2024-02-11 17:29:31 -07:00
}
];
}
{
2024-02-28 09:48:35 -07:00
name = "KVM";
2024-02-11 17:29:31 -07:00
commands = [
2024-02-28 11:08:31 -07:00
"journalctl -xef -u rkvm-server"
2024-02-11 17:29:31 -07:00
];
panes = [
{
commands = [ "ssh stan-kvm" ];
2024-02-11 17:29:31 -07:00
}
];
}
{
name = "Xin";
root = "src/xin";
}
{
name = "Lab";
root = "src/biltong";
}
{
name = "NixPkgs";
root = "src/nixpkgs";
}
{
name = "NomadNet";
root = "reticulum";
}
];
})
];
2024-02-11 17:29:31 -07:00
}