quox/flake.nix

41 lines
1.3 KiB
Nix
Raw Normal View History

2022-05-04 11:09:49 -04:00
{ description = "quox: quantitative extensional type theory";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
idris2-pkgs.url = "github:claymager/idris2-pkgs";
nixpkgs.follows = "idris2-pkgs/nixpkgs";
};
outputs = { self, nixpkgs, idris2-pkgs, flake-utils }:
2022-05-07 11:37:47 -04:00
let systems = with flake-utils.lib.system;
# [ x86_64-darwin x86_64-linux i686-linux ]; # FIXME
[ x86_64-linux ];
in
2022-05-04 11:09:49 -04:00
flake-utils.lib.eachSystem systems (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ idris2-pkgs.overlay ];
};
2022-05-06 14:27:45 -04:00
builders = pkgs.idris2-pkgs._builders;
2022-05-04 12:35:43 -04:00
2022-05-08 13:29:03 -04:00
packages = rec {
quox-lib = builders.idrisPackage ./lib { };
quox = builders.idrisPackage ./exe { extraPkgs = packages; };
quox-tests = builders.idrisPackage ./tests { extraPkgs = packages; };
};
2022-05-04 12:35:43 -04:00
2022-05-06 14:27:45 -04:00
devShells =
let mkDevShell = _: pkg:
pkgs.mkShell { buildInputs = [ (builders.devEnv pkg) ]; };
2022-05-08 13:29:03 -04:00
shells = packages //
(with packages; { lib = quox-lib; test = quox-tests; });
in builtins.mapAttrs mkDevShell shells;
2022-05-06 14:27:45 -04:00
in {
inherit packages devShells;
defaultPackage = packages.quox;
2022-05-08 13:29:03 -04:00
devShell = devShells.lib;
2022-05-04 11:09:49 -04:00
}
);
}