diff --git a/systemd/.config/systemd/user/node@.service b/systemd/.config/systemd/user/node@.service new file mode 100644 index 0000000..db9b37c --- /dev/null +++ b/systemd/.config/systemd/user/node@.service @@ -0,0 +1,18 @@ +[Unit] +Description=Node.js dev server for %I +After=network-online.target +Wants=network-online.target + +[Service] +Type=simple +Environment=PATH=%h/.local/bin:/home/linuxbrew/.linuxbrew/bin:/usr/local/bin:/usr/bin:/bin:/home/powellc/.asdf/shims +EnvironmentFile=%h/.local/etc/node/%i.env +ExecStartPre=/bin/bash -lc 'cd "$NODE_PATH" && if [ -f docker-compose.yml ]; then docker-compose start; fi' +ExecStart=/bin/bash -c 'cd "$NODE_PATH" && exec direnv exec "$NODE_PATH" just run' +Restart=on-failure +RestartSec=2 +StandardOutput=append:/tmp/node.log +StandardError=inherit + +[Install] +WantedBy=default.target