quox/flake.nix

37 lines
1.2 KiB
Nix

{ 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 }:
let systems = [ "x86_64-darwin" "x86_64-linux" "i686-linux" ]; in
flake-utils.lib.eachSystem systems (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ idris2-pkgs.overlay ];
};
builders = pkgs.idris2-pkgs._builders;
packages =
let inherit (builders) idrisPackage;
in rec {
quox-lib = idrisPackage ./lib { };
quox = idrisPackage ./exe { extraPkgs = packages; };
quox-tests = idrisPackage ./tests { extraPkgs = packages; };
};
devShells =
let mkDevShell = _: pkg:
pkgs.mkShell { buildInputs = [ (builders.devEnv pkg) ]; };
in builtins.mapAttrs mkDevShell packages;
in {
inherit packages devShells;
defaultPackage = packages.quox;
devShell = devShells.quox-lib;
}
);
}