Skip to content

Instantly share code, notes, and snippets.

@numinit
Created July 5, 2018 07:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save numinit/974ca24775e21523078b370654584514 to your computer and use it in GitHub Desktop.
Save numinit/974ca24775e21523078b370654584514 to your computer and use it in GitHub Desktop.
{ config, pkgs, ... }:
{
imports = [ <nixpkgs/nixos/modules/virtualisation/amazon-image.nix> ];
ec2.hvm = true;
containers.df = import /root/armokweb/nix/container;
networking.hostName = "armokweb";
time.timeZone = "UTC";
environment.systemPackages = with pkgs; [
wget vim curl git subversion htop zsh tmux psmisc
ruby python27
];
# Enable the OpenSSH daemon.
services.openssh = {
enable = true;
passwordAuthentication = false;
};
services.nginx = {
enable = true;
virtualHosts."armokweb.numin.it" = {
http2 = true;
forceSSL = true;
enableACME = true;
basicAuth = {
"lobsters" = "armokweb";
};
locations."/" = {
extraConfig = ''
proxy_pass http://192.168.100.10:10000;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
'';
};
};
appendHttpConfig = ''
server {
listen 80 default_server;
server_name _;
location / {
empty_gif;
}
}
'';
};
security.hideProcessInformation = true;
networking.firewall.allowedTCPPorts = [ 22 80 443 ];
networking.firewall.enable = true;
nixpkgs.config = {
allowUnfree = true;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment