Skip to content

Instantly share code, notes, and snippets.

@Rizary
Last active April 29, 2018 08:10
Show Gist options
  • Save Rizary/738b5f4fae272deb7ff8c1f472b69d40 to your computer and use it in GitHub Desktop.
Save Rizary/738b5f4fae272deb7ff8c1f472b69d40 to your computer and use it in GitHub Desktop.
let
nginxCfg = {
enable = true;
config = ''
events {
worker_connections 1024;
}
http {
server {
listen 0.0.0.0:80;
server_name qoeifs;
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}
'';
};
in {
network.description = "Qoeifs network";
network.enableRollback = true;
qoeifs =
{ config, pkgs, ... }:
let
nodemon = pkgs.nodePackages.nodemon;
in
{
environment.systemPackages = [ nodemon ];
service = {
nginx = nginxCfg;
mongodb = {
enable = true;
};
};
};
}
let
region = "ap-southeast-1";
accessKeyId = "dev";
ec2 =
{ resources, ... }:
{ deployment.targetEnv = "ec2";
deployment.ec2.accessKeyId = accessKeyId;
deployment.ec2.region = region;
deployment.ec2.instanceType = "t2.micro";
deployment.ec2.keyPair = resources.ec2KeyPairs.my-key-pair;
#deployment.ec2.privateKey = "/home/rizilab/Downloads/app.pem";
};
in
{
qoeifs = ec2;
resources.ec2KeyPairs.my-key-pair =
{ inherit region accessKeyId; };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment