quox/flake.nix

48 lines
1.4 KiB
Nix
Raw Normal View History

2022-05-04 11:09:49 -04:00
{ description = "quox: quantitative extensional type theory";
inputs = {
2022-06-19 08:22:58 -04:00
tap.url = "git+https://git.rhiannon.website/rhi/idris2-tap?ref=main";
nixpkgs.follows = "tap/nixpkgs";
flake-utils.follows = "tap/flake-utils";
idris2-pkgs.follows = "tap/idris2-pkgs";
2022-05-04 11:09:49 -04:00
};
outputs = { self, nixpkgs, idris2-pkgs, flake-utils, tap }:
2022-06-19 08:22:58 -04:00
let
packagePaths = {
quox-lib = ./lib;
quox = ./exe;
quox-tests = ./tests;
};
extraDeps = [ tap ];
systems = with flake-utils.lib.system;
[ x86_64-darwin x86_64-linux i686-linux ];
in
2022-06-19 08:22:58 -04:00
with builtins;
flake-utils.lib.eachSystem systems (system:
2022-05-04 11:09:49 -04:00
let
2022-06-19 08:22:58 -04:00
basePkgs = import nixpkgs {
2022-05-04 11:09:49 -04:00
inherit system;
overlays = [ idris2-pkgs.overlay ];
};
2022-06-19 08:22:58 -04:00
builders = basePkgs.idris2-pkgs._builders;
2022-06-19 08:22:58 -04:00
extraDepPkgs =
foldl' (acc: pkg: acc // pkg.packages.${system}) { } extraDeps;
mkPackage = name: path:
builders.idrisPackage path { extraPkgs = extraDepPkgs // packages; };
mkDevShell = _: pkg:
basePkgs.mkShell { buildInputs = [ (builders.devEnv pkg) ]; };
2022-05-04 12:35:43 -04:00
2022-06-19 08:22:58 -04:00
packages = mapAttrs mkPackage packagePaths;
devShells = mapAttrs mkDevShell packages;
2022-05-06 14:27:45 -04:00
in {
inherit packages devShells;
defaultPackage = packages.quox;
2022-06-19 08:22:58 -04:00
devShell = devShells.quox-lib;
2022-05-04 11:09:49 -04:00
}
);
}