summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tv/2configs/initrd/sshd.nix17
-rw-r--r--tv/2configs/weechat-server.nix24
2 files changed, 41 insertions, 0 deletions
diff --git a/tv/2configs/initrd/sshd.nix b/tv/2configs/initrd/sshd.nix
new file mode 100644
index 000000000..eff848074
--- /dev/null
+++ b/tv/2configs/initrd/sshd.nix
@@ -0,0 +1,17 @@
+{ config, ... }: {
+ boot.initrd.availableKernelModules = [
+ "e1000e"
+ ];
+ boot.initrd.network.enable = true;
+ boot.initrd.network.ssh = {
+ enable = true;
+ port = 11423;
+ authorizedKeys = [
+ config.krebs.users.tv.pubkey
+ ];
+ ignoreEmptyHostKeys = true;
+ };
+ boot.initrd.secrets = {
+ "/etc/ssh/ssh_host_rsa_key" = <secrets/initrd/ssh_host_rsa_key>;
+ };
+}
diff --git a/tv/2configs/weechat-server.nix b/tv/2configs/weechat-server.nix
new file mode 100644
index 000000000..41f157c35
--- /dev/null
+++ b/tv/2configs/weechat-server.nix
@@ -0,0 +1,24 @@
+{ config, pkgs, ... }: {
+ users.users.tv.packages = [
+ (pkgs.writers.writeDashBin "weechat-client" ''
+ set -efu
+ exec ${pkgs.tmux}/bin/tmux attach -t weechat
+ '')
+ ];
+ systemd.services.weechat = {
+ wantedBy = [ "multi-user.target" ];
+ environment = {
+ TERM = "rxvt-unicode-256color";
+ };
+ serviceConfig = {
+ ExecStart = "${pkgs.tmux}/bin/tmux new -d -s weechat ${pkgs.weechat}/bin/weechat";
+ OOMScoreAdjust = -1000;
+ Restart = "always";
+ RestartSec = "100ms";
+ Type = "forking";
+ StartLimitBurst = 0;
+ User = "tv";
+ WorkingDirectory = "/home/tv";
+ };
+ };
+}