go back to old way of running through flake

This commit is contained in:
Gabriel Fontes
2022-06-18 11:01:09 -03:00
parent c72a802304
commit 5a9bbe1eb3
+21 -19
View File
@@ -24,38 +24,40 @@
default = misterio-me;
};
# Serve website
apps = rec {
serve = {
type = "app";
program = "${pkgs.writeShellScriptBin "serve" ''
echo "Serving on: http://localhost:8080 and gemini://localhost:1965"
${pkgs.webfs}/bin/webfsd -f index.html -d -F -p 4000 -r ${packages.default}/public & \
${pkgs.agate}/bin/agate --content ${packages.default}/public --hostname localhost --certs /tmp/agate-certs & \
jobs=$(jobs -p)
trap 'kill $jobs' EXIT
wait
''}/bin/serve";
};
default = serve;
};
devShells.default = pkgs.mkShell {
inputsFrom = [ packages.misterio-me ];
buildInputs = with pkgs; [ yq openring ];
shellHook = ''
cleanup() {
rm _main/_includes/scheme-datalist.html 2> /dev/null
rm _main/{assets,_sass}/themes/* 2> /dev/null
rm -r _site 2> /dev/null
}
while [ ! -f flake.nix ]; do
echo "Looking for flake.nix, going one directory up"
cd ..
done
cleanup
rm _main/_includes/scheme-datalist.html 2> /dev/null
rm _main/{assets,_sass}/themes/* 2> /dev/null
rm -r _site 2> /dev/null
mkdir _main/{assets,_sass}/themes -p
ln -s ${packages.css-themes}/list.html -T _main/_includes/scheme-datalist.html
ln -s ${packages.css-themes}/partials/*.scss -t _main/_sass/themes/
ln -s ${packages.css-themes}/themes/*.scss -t _main/assets/themes/
jekyll build &> /dev/null
jekyll serve --port 8080 --watch --incremental --trace & \
${pkgs.agate}/bin/agate --content _site --hostname localhost --certs /tmp/agate-certs & \
jobs=$(jobs -p)
trap 'kill $jobs && cleanup' EXIT
wait
cleanup
exit
'';
};
}