Add infinsweeper module.
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
infinsweeper = "${config.users.users."me".home}/main/infinsweeper";
|
||||
ruby = pkgs.ruby.withPackages (
|
||||
p: with p; [
|
||||
sqlite3
|
||||
sequel
|
||||
rackup
|
||||
puma
|
||||
sinatra
|
||||
]
|
||||
);
|
||||
in
|
||||
{
|
||||
systemd.services.infinsweeper = {
|
||||
description = "InfinSweeper";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
StateDirectory = "infinsweeper";
|
||||
WorkingDirectory = infinsweeper;
|
||||
|
||||
ExecStart = "${ruby}/bin/ruby ${infinsweeper}/main.rb";
|
||||
|
||||
User = "me";
|
||||
Restart = "always";
|
||||
RestartSec = 3;
|
||||
|
||||
Environment = [
|
||||
"ENV=prod"
|
||||
#"RACK_ENV=production"
|
||||
"PORT=5161"
|
||||
"INFINSWEEPER_DB=/var/lib/infinsweeper/infinsweeper.db"
|
||||
];
|
||||
|
||||
EnvironmentFile = "/run/secrets.env";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user