From e3a7f43364c6001d2d70c3692bc82ad7f2440d4a Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Fri, 1 Jan 2021 18:11:59 -0500 Subject: [PATCH] make this build with nix-build Signed-off-by: Christine Dodrill --- book/default.nix | 64 ++++++++++++++----------------- book/src/07_prepositions/index.md | 5 +++ default.nix | 3 ++ 3 files changed, 37 insertions(+), 35 deletions(-) create mode 100644 book/src/07_prepositions/index.md create mode 100644 default.nix diff --git a/book/default.nix b/book/default.nix index acc543b..5a2d40a 100644 --- a/book/default.nix +++ b/book/default.nix @@ -1,6 +1,6 @@ +{ pkgs ? import { } }: + let - sources = import ../nix/sources.nix; - pkgs = import sources.nixpkgs { }; nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") { inherit pkgs; @@ -8,39 +8,33 @@ let tex = pkgs.callPackage ../nix/texlive.nix { }; version = "devel"; words = import ../words; - book = pkgs.stdenv.mkDerivation { - pname = "lewa-book"; - inherit version; - src = ./.; - phases = "buildPhase installPhase"; - buildInputs = with pkgs; [ - kindlegen - mdbook - nur.repos.mic92.pandoc-bin - tex - words - ]; +in pkgs.stdenv.mkDerivation { + pname = "lewa-book"; + inherit version; + src = ./.; + phases = "buildPhase installPhase"; + buildInputs = with pkgs; [ + calibre + mdbook + nur.repos.mic92.pandoc-bin + tex + words + ]; - buildPhase = '' - cp -rf $src/src . - chmod a+w ./src - cp -rf $src/book.toml . - mkdir book - rm ./src/dictionary.md ||: - cp ${words}/dictionary.md ./src/dictionary.md - mdbook build - cd ./src && ./build.sh && cd .. - cd ./book && kindlegen lewa.epub ||: && cd .. - ''; + buildPhase = '' + cp -rf $src/src . + chmod a+w ./src + cp -rf $src/book.toml . + mkdir book + rm ./src/dictionary.md ||: + cp ${words}/dictionary.md ./src/dictionary.md + mdbook build + cd ./src && ./build.sh && cd .. + cd ./book && ebook-convert lewa.epub lewa.mobi ||: && cd .. + ''; - installPhase = '' - mkdir -p $out - cp -rf book $out/book - ''; - }; -in pkgs.dockerTools.buildLayeredImage { - name = "within/lewa-book"; - tag = version; - contents = [ nur.repos.xe.quickserv book ]; - config.Cmd = [ "/bin/quickserv" "--port=9001" "--dir=/book" ]; + installPhase = '' + mkdir -p $out + cp -rf book $out/book + ''; } diff --git a/book/src/07_prepositions/index.md b/book/src/07_prepositions/index.md new file mode 100644 index 0000000..461ec47 --- /dev/null +++ b/book/src/07_prepositions/index.md @@ -0,0 +1,5 @@ +# Prepositions + +In English, prepositions are function words such as "to", "from", "like", and +similar. This chapter will cover the L'ewa prepositions and how they are used to +add more context to sentences. diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..1f73ac5 --- /dev/null +++ b/default.nix @@ -0,0 +1,3 @@ +{ pkgs ? import { } }: + +pkgs.callPackage ./book { }