xin/configs/smug.nix

99 lines
2.1 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 = {
systemPackages = [
(pkgs.writeScriptBin name ''
${pkgs.smug}/bin/smug -f /etc/smug/${name}.yml start
'')
];
etc."smug/${name}.yml".text = builtins.readFile
(tmuxFormat.generate "${name}.yml" cfg);
};
};
2024-02-11 17:29:31 -07:00
in
{
config = mkMerge [
(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"
];
}
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" ];
}
];
}
{
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
}