Add newtab service to server.
This commit is contained in:
@@ -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