-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
72 lines (66 loc) · 2.04 KB
/
flake.nix
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
64
65
66
67
68
69
70
71
72
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
orgRepo = {
url = "github:FixPlanet/org?rev=9fcdb024ba0cb11aec3b1f8469ec64658c19e2ca";
flake = false;
};
};
outputs = inputs:
with inputs; let
supportedSystems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
nixpkgsFor = forAllSystems (system:
import nixpkgs {
inherit system;
overlays = [];
});
in {
devShell = forAllSystems (system:
nixpkgsFor.${system}.mkShell {
packages = with nixpkgsFor.${system}; [
imagemagick
rsync
(ghc.withPackages (ps: with ps; [
MissingH
aeson
blaze-html
clay
hakyll
pkgs.cabal-install
tagsoup
time-locale-compat
]))
];
shellHook =
let path = "project-selection-committee";
in ''
echo "Copying things from the org repo ..."
# Committee-member markdown files
rm -rf src/${path}
mkdir src/${path}
cp ${inputs.orgRepo.outPath}/${path}/*.md src/${path}
# Committee-member mmages
rm -rf src/images/${path}
mkdir src/images/${path}
cp ${inputs.orgRepo.outPath}/${path}/*.webp src/images/${path}
# "Misc" org docs
#
# Note: Because of the way Hakyll works, we use pandoc (the tool) to
# convert these to HTML so that we can include them in the website using
# the $partial(...)$ directive.
rm -rf src/org-docs
mkdir src/org-docs
# The "essential criteria" part of the document.
pandoc ${inputs.orgRepo.outPath}/constitution/essential-criteria.md -o src/org-docs/essential-criteria.html
echo "Done."
'';
}
);
};
}