From 0f742d6e44d1a2b48e1b28132043efec3428ca25 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Wed, 16 Jul 2025 21:16:37 +0200 Subject: nix --- Makefile | 6 ++++-- flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 18 ++++++++++++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/Makefile b/Makefile index 85cf69b..7daa1aa 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ stage-4.txt: stage-3.txt stage-4.awk awk -f $(filter %.awk,$^) $< > $@.tmp @mv $@.tmp $@ -stage-5.md: stage-4.txt Makefile +stage-5.md: stage-4.txt @echo '#' $@ @pandoc --from markdown -o $@.tmp.md $< @mv $@.tmp.md $@ @@ -80,7 +80,9 @@ constance-ring.pdf: header.md cover.jpg frontmatter.md stage-5.md spellcheck-wor .PHONY: clean clean: + @rm -f stage-*.txt constance-ring.epub constance-ring.pdf + +clean-ocr: clean if [ -r page-index.txt ]; then cat page-index.txt | xargs rm; rm page-index.txt; fi - @rm -f stage-*.txt $(V).SILENT: diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..1d795a2 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1752436162, + "narHash": "sha256-Kt1UIPi7kZqkSc5HVj6UY5YLHHEzPBkgpNUByuyxtlw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "dfcd5b901dbab46c9c6e80b265648481aafb01f8", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..5b83fd0 --- /dev/null +++ b/flake.nix @@ -0,0 +1,18 @@ +{ + inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; + + outputs = { self, nixpkgs, ... }: + let pkgs = import nixpkgs { system = "x86_64-linux"; }; + in + { + devShells."x86_64-linux".ci = with pkgs; mkShell { + buildInputs = [ + pandoc + hunspell + (diffoscope.override { enableBloat = false; }) + ]; + + LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive"; + }; + }; +} -- cgit v1.2.3