Skip to content

Instantly share code, notes, and snippets.

@bobvanderlinden
Created January 16, 2017 15:56
Show Gist options
  • Save bobvanderlinden/939cd64a8290a7388cce2cf4303b0995 to your computer and use it in GitHub Desktop.
Save bobvanderlinden/939cd64a8290a7388cce2cf4303b0995 to your computer and use it in GitHub Desktop.
VM definition to test nginx virtualHost.<name>.serverName
{ nixpkgs ? ./default.nix,
nixos ? ./nixos/release.nix,
system ? "x86_64-linux"
}:
{
vm = (import ./nixos/lib/eval-config.nix {
inherit system;
modules = [
{
services.nginx = {
enable = true;
virtualHosts = {
"example_http" = {
serverName = "example.org";
root = ./wwwroot;
};
"example_https" = {
serverName = "example.org";
enableSSL = true;
enableACME = true;
root = ./wwwroot;
};
};
};
}
./nixos/modules/virtualisation/qemu-vm.nix
{
# Set root password to 'root'
users.users.root.initialHashedPassword = "$6$4U4VJBBGt$FPB2jVV5FtCzpuzwePILcKMN1MQ5n8714jLrkkxD50UIOlfNjjcGx1ywYGrx41w569UDYmNC1MO9tD8j.Nzoy.";
}
];
}).config.system.build.vm;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment