Add newtab service to server.
This commit is contained in:
@@ -53,6 +53,9 @@
|
|||||||
virtualHosts."infinsweeper.syedm.dev".extraConfig = ''
|
virtualHosts."infinsweeper.syedm.dev".extraConfig = ''
|
||||||
reverse_proxy localhost:5161
|
reverse_proxy localhost:5161
|
||||||
'';
|
'';
|
||||||
|
virtualHosts."newtab.syedm.dev".extraConfig = ''
|
||||||
|
reverse_proxy localhost:5162
|
||||||
|
'';
|
||||||
virtualHosts."acs.syedm.dev".extraConfig = ''
|
virtualHosts."acs.syedm.dev".extraConfig = ''
|
||||||
reverse_proxy localhost:3709
|
reverse_proxy localhost:3709
|
||||||
'';
|
'';
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
newtab = "${config.users.users."me".home}/main/newtab";
|
||||||
|
ruby = pkgs.ruby.withPackages (
|
||||||
|
p: with p; [
|
||||||
|
rackup
|
||||||
|
puma
|
||||||
|
sinatra
|
||||||
|
]
|
||||||
|
);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
systemd.services.newtab = {
|
||||||
|
description = "Newtab";
|
||||||
|
after = [ "network.target" ];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
StateDirectory = "newtab";
|
||||||
|
WorkingDirectory = newtab;
|
||||||
|
|
||||||
|
ExecStart = "${ruby}/bin/ruby ${newtab}/main.rb";
|
||||||
|
|
||||||
|
User = "me";
|
||||||
|
Restart = "always";
|
||||||
|
RestartSec = 3;
|
||||||
|
|
||||||
|
Environment = [
|
||||||
|
"ENV=prod"
|
||||||
|
"RACK_ENV=production"
|
||||||
|
"PORT=5162"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user