Last active
December 8, 2019 22:41
-
-
Save bsima/b79d1beae8efc53a99146f7eceb1f5ec to your computer and use it in GitHub Desktop.
production.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
resources.sshKeyPairs.ssh-key = {}; | |
pprjam = | |
{ config, pkgs, ... }: | |
let | |
pprjam = (import ../release.nix { inherit pkgs; }).pprjam // { | |
preInstall = '' | |
echo "=======================================================" | |
echo "=======================================================" | |
echo "=======================================================" | |
echo "=======================================================" | |
echo "=======================================================" | |
echo "=======================================================" | |
echo "copying static and config" | |
cp static $out | |
cp config $out | |
''; | |
}; | |
in { | |
deployment.targetEnv = "digitalOcean"; | |
deployment.digitalOcean.enableIpv6 = true; | |
deployment.digitalOcean.region = "SFO2"; | |
deployment.digitalOcean.size = "512mb"; | |
networking.firewall.allowedTCPPorts = [ 22 80 ]; | |
environment.systemPackages = [ pprjam ]; | |
services.openssh.enable = true; | |
services.postgresql = { | |
enable = true; | |
package = pkgs.postgresql96; | |
enableTCPIP = true; | |
}; | |
systemd.services.pprjam = { | |
description = "pprjam webapp"; | |
wantedBy = [ "multi-user.target" ]; | |
after = [ "network.target" ]; | |
serviceConfig = { | |
ExecStart = "${pprjam}/bin/pprjam"; | |
}; | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would you be willing to show how you got this to work?