Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
63 lines (53 loc) · 1.64 KB
/
Copy pathflake.nix
File metadata and controls
63 lines (53 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
description = "jekyll environment for inbucket.org";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{ nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
scripts.serve = pkgs.writeShellScriptBin "serve" ''
cd "$(git rev-parse --show-toplevel)"
jekyll serve --host 0.0.0.0 --watch
'';
# TODO Replace with Jekyll + Lustre GHA
scripts.lustre-build = pkgs.writeShellScriptBin "lustre-build" ''
set -xeo pipefail
src=lustre-configurator
target=configurator
cd "$(git rev-parse --show-toplevel)"
test -d $src || (echo "ERROR: dir $src does not exist"; exit 5)
pushd $src
gleam clean
gleam run -m lustre/dev build configurator
popd
sed -i 's|/configurator\.js|/configurator/configurator.js|' $target/index.html
'';
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
(jekyll.override { withOptionalDependencies = true; })
scripts.serve
scripts.lustre-build
# Gleam
beam27Packages.erlang
beam27Packages.rebar3
gleam
inotify-tools
];
shellHook = ''
echo
echo "Commands:"
echo " serve - runs jekyll w/ --watch"
echo " lustre-build - builds the Lustre configurator"
echo
'';
};
}
);
}