aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay <[email protected]>2020-10-07 05:50:39 +0100
committerAkshay <[email protected]>2020-10-07 05:50:39 +0100
commit67a5885d54fed9580b6ceee321f4077e7ac431fb (patch)
tree44e1fe5b6bc6428a5c08bd78b0e789bb29f71c01
parentdfefca5d9bf49b08e1ac24c8820922e0bd89f9d6 (diff)
add nix build instructions
-rw-r--r--.gitignore2
-rw-r--r--default.nix23
-rw-r--r--shell.nix6
3 files changed, 31 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 908d06d..9d44be5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,5 @@ build/
8 8
9# ttf converter binary 9# ttf converter binary
10BitsNPicas.jar 10BitsNPicas.jar
11.envrc
12result
diff --git a/default.nix b/default.nix
new file mode 100644
index 0000000..e9cf4fe
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,23 @@
1let
2 pkgs = import <nixpkgs> {};
3in
4 with pkgs;
5 stdenv.mkDerivation rec {
6 name = "scientifica";
7 version = "v0.1.0";
8 src = ./src;
9 buildInputs = [ fontforge python3 xorg.mkfontdir ];
10
11 buildPhase = ''
12 for i in ./*; do
13 fontforge -c 'open(argv[1]).generate(argv[2])' $i $i.otb
14 done
15 '';
16 installPhase = ''
17 fontDir="$out/share/fonts/misc"
18 install -m 644 -D *.otb out/* -t "$fontDir"
19 mkfontdir "$fontDir"
20 '';
21 }
22
23
diff --git a/shell.nix b/shell.nix
new file mode 100644
index 0000000..850aa8d
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1,6 @@
1{ pkgs ? import <nixpkgs> {} }:
2
3with pkgs;
4mkShell {
5 buildInputs = [ fontforge python3 xorg.mkfontdir ];
6}