2021-01-15 20:20:52 +03:00
|
|
|
{
|
|
|
|
description = "Idris2 flake";
|
|
|
|
|
2021-06-22 13:34:03 +03:00
|
|
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
2021-03-15 17:21:50 +03:00
|
|
|
inputs.idris-emacs-src = {
|
2021-06-22 13:34:03 +03:00
|
|
|
url = "github:redfish64/idris2-mode";
|
2021-03-15 17:21:50 +03:00
|
|
|
flake = false;
|
2021-01-15 20:20:52 +03:00
|
|
|
};
|
2021-12-24 15:36:54 +03:00
|
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
|
2021-03-15 17:21:50 +03:00
|
|
|
|
2021-12-24 15:36:54 +03:00
|
|
|
outputs = { self, nixpkgs, flake-utils, idris-emacs-src }:
|
2021-06-24 20:13:39 +03:00
|
|
|
let
|
2022-10-27 18:32:16 +03:00
|
|
|
idris2-version = "0.6.0";
|
2021-06-24 20:13:39 +03:00
|
|
|
lib = import ./nix/lib.nix;
|
|
|
|
sys-agnostic = rec {
|
2021-03-15 17:21:50 +03:00
|
|
|
templates.pkg = {
|
|
|
|
path = ./nix/templates/pkg;
|
|
|
|
description = "A custom Idris 2 package";
|
|
|
|
};
|
|
|
|
templates.pkgWithDeps = {
|
|
|
|
path = ./nix/templates/pkgWithDeps;
|
|
|
|
description = "A custom Idris 2 package with dependencies";
|
|
|
|
};
|
|
|
|
defaultTemplate = templates.pkg;
|
|
|
|
version = idris2-version;
|
|
|
|
};
|
2022-10-28 21:29:30 +03:00
|
|
|
per-system = { config ? { }, overlays ? [ ] }:
|
|
|
|
system:
|
2021-06-24 20:13:39 +03:00
|
|
|
let
|
|
|
|
pkgs = import nixpkgs { inherit config system overlays; };
|
2022-10-28 21:29:30 +03:00
|
|
|
chez = if system == "x86_64-linux" then
|
|
|
|
pkgs.chez
|
|
|
|
else
|
|
|
|
pkgs.chez-racket; # TODO: Should this always be the default?
|
|
|
|
idris2Bootstrap = pkgs.callPackage ./nix/package.nix {
|
flake.nix: Use Racket's Chez for non-x86_64-linux platforms
It supports many more platforms, excerpt from the README:
> Supported platforms:
>
> Windows: x86, x86_64
> Mac OS: x86, x86_64, AArch64, PowerPC32
> Linux: x86, x86_64, ARMv6, AArch64, PowerPC32
> FreeBSD: x86, x86_64, ARMv6, AArch64, PowerPC32
> OpenBSD: x86, x86_64, ARMv6, AArch64, PowerPC32
> NetBSD: x86, x86_64, ARMv6, AArch64, PowerPC32
> Solaris: x86, x86_64
> Android: ARMv7, AArch64
> iOS: AArch64
Link to the fork: https://github.com/racket/ChezScheme
2021-07-28 19:20:39 +03:00
|
|
|
inherit idris2-version chez;
|
2022-10-28 21:29:30 +03:00
|
|
|
idris2Bootstrap = null;
|
2021-06-24 20:13:39 +03:00
|
|
|
srcRev = self.shortRev or "dirty";
|
|
|
|
};
|
2022-10-24 23:51:28 +03:00
|
|
|
idris2Pkg = pkgs.callPackage ./nix/package.nix {
|
|
|
|
inherit idris2-version chez idris2Bootstrap;
|
|
|
|
srcRev = self.shortRev or "dirty";
|
|
|
|
};
|
2022-10-28 21:29:30 +03:00
|
|
|
buildIdris = pkgs.callPackage ./nix/buildIdris.nix {
|
|
|
|
inherit idris2-version;
|
|
|
|
idris2 = idris2Pkg;
|
|
|
|
};
|
flake.nix: Use Racket's Chez for non-x86_64-linux platforms
It supports many more platforms, excerpt from the README:
> Supported platforms:
>
> Windows: x86, x86_64
> Mac OS: x86, x86_64, AArch64, PowerPC32
> Linux: x86, x86_64, ARMv6, AArch64, PowerPC32
> FreeBSD: x86, x86_64, ARMv6, AArch64, PowerPC32
> OpenBSD: x86, x86_64, ARMv6, AArch64, PowerPC32
> NetBSD: x86, x86_64, ARMv6, AArch64, PowerPC32
> Solaris: x86, x86_64
> Android: ARMv7, AArch64
> iOS: AArch64
Link to the fork: https://github.com/racket/ChezScheme
2021-07-28 19:20:39 +03:00
|
|
|
in rec {
|
2021-06-24 20:13:39 +03:00
|
|
|
checks = import ./nix/test.nix {
|
|
|
|
inherit (pkgs) system stdenv runCommand lib;
|
|
|
|
inherit nixpkgs flake-utils;
|
|
|
|
idris = self;
|
|
|
|
};
|
2022-10-28 21:29:30 +03:00
|
|
|
packages = {
|
|
|
|
idris2 = idris2Pkg;
|
|
|
|
} // (import ./nix/text-editor.nix {
|
|
|
|
inherit pkgs idris-emacs-src idris2Pkg;
|
|
|
|
});
|
2021-06-24 20:13:39 +03:00
|
|
|
inherit buildIdris;
|
|
|
|
defaultPackage = packages.idris2;
|
flake.nix: Use Racket's Chez for non-x86_64-linux platforms
It supports many more platforms, excerpt from the README:
> Supported platforms:
>
> Windows: x86, x86_64
> Mac OS: x86, x86_64, AArch64, PowerPC32
> Linux: x86, x86_64, ARMv6, AArch64, PowerPC32
> FreeBSD: x86, x86_64, ARMv6, AArch64, PowerPC32
> OpenBSD: x86, x86_64, ARMv6, AArch64, PowerPC32
> NetBSD: x86, x86_64, ARMv6, AArch64, PowerPC32
> Solaris: x86, x86_64
> Android: ARMv7, AArch64
> iOS: AArch64
Link to the fork: https://github.com/racket/ChezScheme
2021-07-28 19:20:39 +03:00
|
|
|
};
|
2022-10-28 21:29:30 +03:00
|
|
|
in lib.mkOvrOptsFlake
|
|
|
|
(opts: flake-utils.lib.eachDefaultSystem (per-system opts) // sys-agnostic);
|
2021-01-15 20:20:52 +03:00
|
|
|
}
|