Add static serve back to dev-shell
This commit is contained in:
parent
e24dd6d630
commit
af08122a25
@ -8,4 +8,7 @@
|
|||||||
mlPublicURL = "http://localhost:4000";
|
mlPublicURL = "http://localhost:4000";
|
||||||
listenProto = "tcp";
|
listenProto = "tcp";
|
||||||
listenAddr = ":4000";
|
listenAddr = ":4000";
|
||||||
|
|
||||||
|
# If empty then a derived static directory is used
|
||||||
|
staticProxyURL = "http://127.0.0.1:4002";
|
||||||
}
|
}
|
||||||
|
17
default.nix
17
default.nix
@ -7,7 +7,7 @@
|
|||||||
}) {},
|
}) {},
|
||||||
|
|
||||||
baseConfig ? import ./config.nix,
|
baseConfig ? import ./config.nix,
|
||||||
skipServices ? [],
|
baseSkipServices ? [],
|
||||||
|
|
||||||
}: rec {
|
}: rec {
|
||||||
|
|
||||||
@ -17,6 +17,12 @@
|
|||||||
redisListenPath = "${config.runDir}/redis";
|
redisListenPath = "${config.runDir}/redis";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
skipServices = baseSkipServices ++ (
|
||||||
|
if baseConfig.staticProxyURL == ""
|
||||||
|
then [ "static" ]
|
||||||
|
else []
|
||||||
|
);
|
||||||
|
|
||||||
static = (import ./static) { inherit pkgs; };
|
static = (import ./static) { inherit pkgs; };
|
||||||
|
|
||||||
srv = pkgs.callPackage (import ./srv) {
|
srv = pkgs.callPackage (import ./srv) {
|
||||||
@ -53,6 +59,13 @@
|
|||||||
numprocesses = 1
|
numprocesses = 1
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
staticCircusCfg = ''
|
||||||
|
[watcher:static]
|
||||||
|
cmd = ${static.serve}/bin/static-serve
|
||||||
|
numprocesses = 1
|
||||||
|
working_dir = ./static
|
||||||
|
'';
|
||||||
|
|
||||||
circusCfg = pkgs.writeText "mediocre-blog-circusCfg" ''
|
circusCfg = pkgs.writeText "mediocre-blog-circusCfg" ''
|
||||||
[circus]
|
[circus]
|
||||||
endpoint = tcp://127.0.0.1:0
|
endpoint = tcp://127.0.0.1:0
|
||||||
@ -61,6 +74,8 @@
|
|||||||
${if (!builtins.elem "srv" skipServices) then srvCircusCfg else ""}
|
${if (!builtins.elem "srv" skipServices) then srvCircusCfg else ""}
|
||||||
|
|
||||||
${if (!builtins.elem "redis" skipServices) then redisCircusCfg else ""}
|
${if (!builtins.elem "redis" skipServices) then redisCircusCfg else ""}
|
||||||
|
|
||||||
|
${if (!builtins.elem "static" skipServices) then staticCircusCfg else ""}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
entrypoint = pkgs.writeScript "mediocre-blog-entrypoint" ''
|
entrypoint = pkgs.writeScript "mediocre-blog-entrypoint" ''
|
||||||
|
@ -11,7 +11,7 @@ test_cfg="(import ./config.nix) // {
|
|||||||
|
|
||||||
entrypoint=$(nix-build --no-out-link -A entrypoint \
|
entrypoint=$(nix-build --no-out-link -A entrypoint \
|
||||||
--arg baseConfig "$test_cfg" \
|
--arg baseConfig "$test_cfg" \
|
||||||
--arg skipServices '["srv"]')
|
--arg baseSkipServices '["srv"]')
|
||||||
|
|
||||||
$entrypoint &
|
$entrypoint &
|
||||||
trap "kill $!; wait; rm -rf $test_dir" EXIT
|
trap "kill $!; wait; rm -rf $test_dir" EXIT
|
||||||
|
Loading…
Reference in New Issue
Block a user