This commit is contained in:
catvayor 2024-09-23 14:10:05 +02:00
parent 4a7ad6efea
commit db9b9fe879
Signed by: lbailly
GPG key ID: CE3E645251AC63F3
5 changed files with 22 additions and 15 deletions

View file

@ -25,6 +25,10 @@ let
ip = mkOption { type = types.str; }; ip = mkOption { type = types.str; };
host = mkOption { type = types.str; }; host = mkOption { type = types.str; };
vms = mkOption { type = types.attrsOf (types.submodule vm-module); }; vms = mkOption { type = types.attrsOf (types.submodule vm-module); };
port-forward = mkOption {
type = types.listOf types.ints.unsigned;
default = [ ];
};
domain-list = mkOption { domain-list = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
@ -49,9 +53,9 @@ let
vm.aliases vm.aliases
]) config.vms ]) config.vms
); );
ports = flatten ( ports =
mapAttrsToList (_: vm: vm.port-forward ++ optional (!isNull vm.ssh) vm.ssh) config.vms config.port-forward
); ++ flatten (mapAttrsToList (_: vm: vm.port-forward ++ optional (!isNull vm.ssh) vm.ssh) config.vms);
redirects = { redirects = {
stream = flatten ( stream = flatten (
mapAttrsToList ( mapAttrsToList (
@ -219,6 +223,7 @@ in
'' ''
server { server {
listen ${toString input}; listen ${toString input};
listen [::]:${toString input};
proxy_pass ${ip}:${toString out}; proxy_pass ${ip}:${toString out};
} }
'' ''

View file

@ -5,6 +5,7 @@
hypervisors."manah.katvayor.net" = { hypervisors."manah.katvayor.net" = {
host = "kat-manah"; host = "kat-manah";
ip = "100.102.49.84"; ip = "100.102.49.84";
port-forward = [ 9000 9500 ];
vms = { vms = {
"degette.katvayor.net" = { "degette.katvayor.net" = {
ssh = 22000; ssh = 22000;

View file

@ -42,7 +42,10 @@ in
}; };
config = { config = {
boot.tmp.useTmpfs = true; boot.tmp.useTmpfs = true;
networking.hostName = name; networking = {
nftables.enable = true;
hostName = name;
};
nix = { nix = {
nixPath = [ nixPath = [
"nixpkgs=${builtins.storePath pkgs.path}" "nixpkgs=${builtins.storePath pkgs.path}"

View file

@ -67,8 +67,13 @@
''; '';
}; };
services.weechat = {
enable = true;
binary = "${pkgs.weechat}/bin/weechat-headless";
};
networking.firewall = { networking.firewall = {
allowedTCPPorts = [ 22 ]; allowedTCPPorts = [ 9000 9500 53 ];
allowedUDPPorts = [ 67 ]; allowedUDPPorts = [ 67 ];
}; };
system.stateVersion = "23.11"; system.stateVersion = "23.11";

View file

@ -86,13 +86,6 @@
let let
menuCmd = "${pkgs.wofi}/bin/wofi --show drun -i | xargs swaymsg exec --"; menuCmd = "${pkgs.wofi}/bin/wofi --show drun -i | xargs swaymsg exec --";
exitMd = ''Exit Mode:| (l)Log out | (r)Reboot | (p)Poweroff''; exitMd = ''Exit Mode:| (l)Log out | (r)Reboot | (p)Poweroff'';
weechatCmd = pkgs.writeShellScript "weechat.sh" ''
nix-shell -p python3 python311Packages.dbus-python python311Packages.notify2 --run 'python ${./weenotify.py} -s' > /dev/null &
while true; do
ssh -R 5431:localhost:5431 weecat@watcher.kat -t screen -xaA -S weechat
sleep 1
done
'';
in in
rec { rec {
window.border = 1; window.border = 1;
@ -112,9 +105,9 @@
{ command = "signal-desktop --"; } { command = "signal-desktop --"; }
# { command = "${lib.getExe pkgs.element-desktop}"; } # { command = "${lib.getExe pkgs.element-desktop}"; }
{ command = ''sh -c "sleep 2 && exec keepassxc"''; } { command = ''sh -c "sleep 2 && exec keepassxc"''; }
# { {
# command = "alacritty --class weechat --title weechat --command ${pkgs.bash}/bin/bash -c ${weechatCmd}"; command = "alacritty --class weechat --title weechat --command ${pkgs.weechat}/bin/weechat";
# } }
]; ];
assigns = { assigns = {
"1" = [ { app_id = "firefox"; } ]; "1" = [ { app_id = "firefox"; } ];