Skip to content

Commit

Permalink
add nix build instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
oppiliappan committed Oct 7, 2020
1 parent dfefca5 commit 67a5885
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ build/

# ttf converter binary
BitsNPicas.jar
.envrc
result
23 changes: 23 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
let
pkgs = import <nixpkgs> {};
in
with pkgs;
stdenv.mkDerivation rec {
name = "scientifica";
version = "v0.1.0";
src = ./src;
buildInputs = [ fontforge python3 xorg.mkfontdir ];

buildPhase = ''
for i in ./*; do
fontforge -c 'open(argv[1]).generate(argv[2])' $i $i.otb
done
'';
installPhase = ''
fontDir="$out/share/fonts/misc"
install -m 644 -D *.otb out/* -t "$fontDir"
mkfontdir "$fontDir"
'';
}


6 changes: 6 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{ pkgs ? import <nixpkgs> {} }:

with pkgs;
mkShell {
buildInputs = [ fontforge python3 xorg.mkfontdir ];
}

0 comments on commit 67a5885

Please sign in to comment.