Last active
April 29, 2018 08:10
-
-
Save Rizary/738b5f4fae272deb7ff8c1f472b69d40 to your computer and use it in GitHub Desktop.
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
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; | |
}; | |
}; | |
}; | |
} |
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
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