forked from w3f/polkadot-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
53 lines (42 loc) · 1.63 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{
description = "Polkadot Protocol Specification";
nixConfig = {
extra-experimental-features = "nix-command flakes";
extra-substituters = "https://polkadot-spec.cachix.org";
extra-trusted-public-keys = "polkadot-spec.cachix.org-1:tQiTEmNIdQ+aEV0zrfdrCn8bQZo/spEMAFGH8YEidQU=";
};
inputs = {
# Nix base libraries
utils.url = "github:numtide/flake-utils";
# Basis for included packages
nixpkgs.url = "github:nixos/nixpkgs/release-21.11";
};
outputs = { self, utils, nixpkgs } :
utils.lib.eachSystem [ "aarch64-linux" "x86_64-linux" ] (system:
let
pkgs = nixpkgs.legacyPackages."${system}";
src = self;
version = if self ? rev then (builtins.substring 0 7 self.rev)
else if self ? lastModifiedDate then self.lastModifiedDate
else "dirty";
algorithmacs = pkgs.callPackage ./.nix/algorithmacs.nix {};
host-spec-pkgs = pkgs.callPackage ./.nix/host-spec.nix { inherit src version algorithmacs; };
texlive-spec = pkgs.callPackage ./.nix/texlive.nix {
extraTexPackages = {
inherit (pkgs.texlive) latexmk algorithms algorithmicx luacode;
};
};
in {
packages = host-spec-pkgs // {
runtime-spec = pkgs.callPackage ./.nix/runtime-spec.nix { inherit src version texlive-spec; };
};
devShell = pkgs.mkShell {
pname = "polkadot-spec-env";
inherit version;
inputsFrom = builtins.attrValues self.packages."${system}";
buildInputs = [ pkgs.gnumake ];
};
}) // {
checks = self.packages;
};
}