summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.gitignore2
-rw-r--r--crates.nix6
-rw-r--r--default.nix21
-rw-r--r--isabat.nix8
4 files changed, 24 insertions, 13 deletions
diff --git a/.gitignore b/.gitignore
index 9237e10..471097d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,2 @@
target/*
-result
+result*
diff --git a/crates.nix b/crates.nix
new file mode 100644
index 0000000..2f69268
--- /dev/null
+++ b/crates.nix
@@ -0,0 +1,6 @@
+{pkgs, naersk}:
+
+naersk.buildPackage {
+ name = "isabelle-unicode";
+ src = ./.;
+}
diff --git a/default.nix b/default.nix
index 964a95a..f807fa6 100644
--- a/default.nix
+++ b/default.nix
@@ -1,8 +1,17 @@
let
- sources = import ./nix/sources.nix;
- pkgs = import sources.nixpkgs {};
- naersk = pkgs.callPackage sources.naersk {};
-in naersk.buildPackage {
- name = "isabelle-unicode";
- src = ./.;
+ sources = import ./nix/sources.nix;
+in
+
+{ pkgs ? import sources.nixpkgs {}
+, naersk ? pkgs.callPackage sources.naersk {}
+, ... }:
+
+rec {
+ isabelle-rust-utils = import ./crates.nix {
+ inherit pkgs naersk;
+ };
+
+ isabat = import ./isabat.nix {
+ inherit pkgs isabelle-rust-utils;
+ };
}
diff --git a/isabat.nix b/isabat.nix
index 8d00447..711c8c3 100644
--- a/isabat.nix
+++ b/isabat.nix
@@ -1,8 +1,4 @@
-let
- sources = import ./nix/sources.nix;
- pkgs = import sources.nixpkgs {};
- isabelle-unicode = import ./default.nix;
-in
+{pkgs, isabelle-rust-utils}:
with pkgs;
stdenv.mkDerivation {
@@ -16,7 +12,7 @@ stdenv.mkDerivation {
buildPhase = ''
cp $src isabat
substituteInPlace isabat \
- --replace isabelle2unicode "${isabelle-unicode}/bin/isabelle2unicode"
+ --replace isabelle2unicode "${isabelle-rust-utils}/bin/isabelle2unicode"
substituteInPlace isabat \
--replace " bat " " ${pkgs.bat}/bin/bat "
mkdir -p $out/bin