Skip to content

Instantly share code, notes, and snippets.

@bsima
Last active December 8, 2019 22:41
Show Gist options
  • Save bsima/b79d1beae8efc53a99146f7eceb1f5ec to your computer and use it in GitHub Desktop.
Save bsima/b79d1beae8efc53a99146f7eceb1f5ec to your computer and use it in GitHub Desktop.
production.nix
{
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";
};
};
};
}
@hhefesto
Copy link

hhefesto commented Jun 8, 2019

Would you be willing to show how you got this to work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment