-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #139 from siraben/flake
Add Nix flake
- Loading branch information
Showing
6 changed files
with
138 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,4 +21,4 @@ | |
**/#*# | ||
tex/gitrev | ||
.DS_Store | ||
|
||
result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,9 @@ | ||
with import <nixpkgs> {}; | ||
|
||
stdenv.mkDerivation rec { | ||
name = "math-comp-book"; | ||
version = "master"; | ||
src = ./.; | ||
|
||
nativeBuildInputs = [ git texlive.combined.scheme-full ]; | ||
|
||
buildPhase = '' | ||
cd tex | ||
make | ||
biber main | ||
make | ||
make | ||
''; | ||
|
||
installPhase = '' | ||
mkdir -p $out/share | ||
cp book.pdf $out/share | ||
''; | ||
|
||
meta = with lib; { | ||
description = "Mathematical components book"; | ||
homepage = "https://github.com/math-comp/mcb"; | ||
license = lib.licenses.cc-by-nc-40; | ||
maintainers = with maintainers; [ siraben ]; | ||
platforms = platforms.all; | ||
}; | ||
} | ||
(import ( | ||
let | ||
lock = builtins.fromJSON (builtins.readFile ./flake.lock); | ||
in fetchTarball { | ||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; | ||
sha256 = lock.nodes.flake-compat.locked.narHash; } | ||
) { | ||
src = ./.; | ||
}).defaultNix |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
description = "Mathematical Components (the book)"; | ||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
utils.url = "github:numtide/flake-utils"; | ||
flake-compat = { | ||
url = "github:edolstra/flake-compat"; | ||
flake = false; | ||
}; | ||
}; | ||
|
||
outputs = { self, nixpkgs, utils, ... }: | ||
utils.lib.eachDefaultSystem (system: | ||
with import nixpkgs { inherit system; }; { | ||
defaultPackage = stdenv.mkDerivation { | ||
name = "math-comp-book"; | ||
version = "master"; | ||
src = ./.; | ||
|
||
nativeBuildInputs = [ git texlive.combined.scheme-full ]; | ||
|
||
buildPhase = '' | ||
cd tex | ||
make | ||
biber main | ||
make | ||
make | ||
''; | ||
|
||
installPhase = '' | ||
mkdir -p $out/share | ||
cp book.pdf $out/share | ||
''; | ||
|
||
meta = with lib; { | ||
description = "Mathematical components book"; | ||
homepage = "https://github.com/math-comp/mcb"; | ||
license = lib.licenses.cc-by-nc-40; | ||
maintainers = with maintainers; [ siraben ]; | ||
platforms = platforms.all; | ||
}; | ||
}; | ||
} | ||
); | ||
} | ||
|