Skip to content

Instantly share code, notes, and snippets.

@Denommus
Last active July 25, 2018 17:37
Show Gist options
  • Save Denommus/3e88cce1ebeb7dcb8a0cc65401c8c8ca to your computer and use it in GitHub Desktop.
Save Denommus/3e88cce1ebeb7dcb8a0cc65401c8c8ca to your computer and use it in GitHub Desktop.
{
webserver = { config, pkgs, ... }: {
deployment = {
targetEnv = "virtualbox";
virtualbox.memorySize = 1024;
virtualbox.vcpu = 2;
};
};
}
{
network.description = "Web Server";
webserver = { config, pkgs, ... }: {
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts."example.com" = let drv = pkgs.stdenv.mkDerivation {
name = "website";
src = ./src;
buildPhase = "";
installPhase = ''
mkdir -p $out/src
cp -r src/* $out/src/
'';
}; in {
root = "${drv}/src";
};
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment