Extract the webservice service into file

This commit is contained in:
Robert Hensing 2019-10-07 16:22:29 +02:00
parent 9fedd0e152
commit 4b6302a613
2 changed files with 17 additions and 10 deletions

View file

@ -2,16 +2,11 @@
{
config.docker-compose.services = {
webserver = {
service.useHostStore = true;
service.command = [ "sh" "-c" ''
cd "$$WEB_ROOT"
${pkgs.python3}/bin/python -m http.server
'' ];
service.ports = [
"8000:8000" # host:container
];
service.environment.WEB_ROOT = "${pkgs.nix.doc}/share/doc/nix/manual";
# webserver.imports = [ ./service-webserver.nix ];
webserver = {...}: {
imports = [ ./service-webserver.nix ];
};
};
}

View file

@ -0,0 +1,12 @@
{ pkgs, ... }: {
service.useHostStore = true;
service.command = [ "sh" "-c"
''
cd "$$WEB_ROOT"
${pkgs.python3}/bin/python -m http.server
'' ];
service.ports = [
"8000:8000" # host:container
];
service.environment.WEB_ROOT = "${pkgs.nix.doc}/share/doc/nix/manual";
}