aboutsummaryrefslogtreecommitdiff
path: root/modules/services/nixos/btopweb.nix
diff options
context:
space:
mode:
authorCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2026-02-26 11:48:44 -0600
committerCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2026-02-26 11:48:44 -0600
commit07c023cb185e7c49a04246a686dd2a560bb0d55f (patch)
tree7566eda3dc43cbb3ec8c97ed996cc75b436fec82 /modules/services/nixos/btopweb.nix
parentaf9357c2652605185214fb52a09c9472498d2a74 (diff)
btopweb
Diffstat (limited to 'modules/services/nixos/btopweb.nix')
-rw-r--r--modules/services/nixos/btopweb.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/modules/services/nixos/btopweb.nix b/modules/services/nixos/btopweb.nix
new file mode 100644
index 0000000..1975c5d
--- /dev/null
+++ b/modules/services/nixos/btopweb.nix
@@ -0,0 +1,35 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}: let
+ cfg = config.collinux.services.btopweb;
+in {
+ imports = [
+ (import ./mkCaddyCfg.nix cfg)
+ ];
+
+ config = lib.mkIf cfg.enable {
+ users.groups."btopweb" = {};
+ users.users."btopweb" = {
+ isSystemUser = true;
+ group = "btopweb";
+ };
+
+ systemd.services."btopweb" = {
+ description = "Host btop on a website";
+ restartIfChanged = true;
+ wants = ["network-online.target"];
+ after = ["network-online.target"];
+ wantedBy = ["multi-user.target"];
+
+ serviceConfig = {
+ User = "btopweb";
+ Type = "simple";
+
+ ExecStart = "${pkgs.gotty}/bin/gotty --reconnect --port ${toString cfg.port} ${pkgs.btop}/bin/btop";
+ };
+ };
+ };
+}