summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/lanparty/lancache.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2017-11-28 19:06:54 +0100
committertv <tv@krebsco.de>2017-11-28 19:06:54 +0100
commit05bc20b893ff6d441d7e8e10802134d2192e724a (patch)
tree1c34434d71eb2e3e3ced9ade09ee4b5879cc63cd /makefu/2configs/lanparty/lancache.nix
parent5163d8eba27976ccccf7703b52eb1b8f4c0295af (diff)
parent10a96c644898d9498e9f75fa543ebb395ffbca20 (diff)
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'makefu/2configs/lanparty/lancache.nix')
-rw-r--r--makefu/2configs/lanparty/lancache.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/makefu/2configs/lanparty/lancache.nix b/makefu/2configs/lanparty/lancache.nix
index 3df2e3f59..bcacf2e15 100644
--- a/makefu/2configs/lanparty/lancache.nix
+++ b/makefu/2configs/lanparty/lancache.nix
@@ -17,15 +17,21 @@ let
installPhase = ''
mkdir -p $out
cp -r * $out/
+ rm $out/caches-enabled/*
sed -i -e 's/^\(user\).*/\1 ${cfg.user} ${cfg.group};/' \
-e '1 idaemon off;' \
+ -e 's#/var/lancache#${cfg.statedir}#g' \
$out/nginx.conf
+ sed -i -e 's#/var/lancache#${cfg.statedir}#g' \
+ $out/*/*.conf
+ ln -s $out/caches-available/* $out/caches-enabled/
'';
};
cfg = {
+ statedir = "/data/cache";
+
group = "nginx-lancache";
user = "nginx-lancache";
- statedir = "/var/lancache";
package = pkgs.stdenv.lib.overrideDerivation pkgs.nginx (old:{
configureFlags = old.configureFlags ++ [
"--with-http_slice_module"
@@ -43,6 +49,7 @@ in {
preStart = ''
mkdir -p ${cfg.statedir} && cd ${cfg.statedir}
+ chmod 700 ${cfg.statedir}
PATH_CACHE=$PATH_BASE/cache
PATH_LOGS=$PATH_BASE/logs