Compare commits
2 commits
main
...
for-nixpkg
Author | SHA1 | Date | |
---|---|---|---|
|
bafed69246 | ||
|
4b6302a613 |
2 changed files with 18 additions and 11 deletions
|
@ -2,16 +2,11 @@
|
||||||
{
|
{
|
||||||
config.docker-compose.services = {
|
config.docker-compose.services = {
|
||||||
|
|
||||||
webserver = {
|
webserver.imports = [ ./service-webserver.nix ];
|
||||||
service.useHostStore = true;
|
|
||||||
service.command = [ "sh" "-c" ''
|
# webserver = {...}: {
|
||||||
cd "$$WEB_ROOT"
|
# imports = [ ./service-webserver.nix ];
|
||||||
${pkgs.python3}/bin/python -m http.server
|
#};
|
||||||
'' ];
|
|
||||||
service.ports = [
|
|
||||||
"8000:8000" # host:container
|
|
||||||
];
|
|
||||||
service.environment.WEB_ROOT = "${pkgs.nix.doc}/share/doc/nix/manual";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
12
examples/minimal/service-webserver.nix
Normal file
12
examples/minimal/service-webserver.nix
Normal 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";
|
||||||
|
}
|
Loading…
Reference in a new issue