Add infinsweeper module.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
../../modules/cloudflare-ddns
|
||||
../../modules/gitea
|
||||
../../modules/msjd
|
||||
../../modules/infinsweeper
|
||||
];
|
||||
|
||||
networking.hostName = "syedm";
|
||||
@@ -27,6 +28,9 @@
|
||||
virtualHosts."git.syedm.dev".extraConfig = ''
|
||||
reverse_proxy localhost:3000
|
||||
'';
|
||||
virtualHosts."infinsweeper.syedm.dev".extraConfig = ''
|
||||
reverse_proxy localhost:5161
|
||||
'';
|
||||
virtualHosts."acs.syedm.dev".extraConfig = ''
|
||||
reverse_proxy localhost:3709
|
||||
'';
|
||||
|
||||
@@ -17,7 +17,7 @@ IP_V6=$(@curl@/bin/curl -6 -s 'https://api6.ipify.org')
|
||||
log "Detected IPv4: ${IP_V4:-none}"
|
||||
log "Detected IPv6: ${IP_V6:-none}"
|
||||
|
||||
arr=("" "git." "www." "acs.")
|
||||
arr=("" "git." "www." "acs." "infinsweeper.")
|
||||
|
||||
if [[ -n "$IP_V4" ]]; then
|
||||
old_ip_v4=$([[ -f "$cache_v4" ]] && cat "$cache_v4" || echo "")
|
||||
|
||||
@@ -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