2021-03-15 17:21:50 +03:00
|
|
|
{
|
2024-01-06 00:59:11 +03:00
|
|
|
description = "My Idris 2 program";
|
2021-03-15 17:21:50 +03:00
|
|
|
|
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 = {
|
2021-06-22 13:34:03 +03:00
|
|
|
url = "github:idris-lang/Idris2";
|
2021-03-15 17:21:50 +03:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
|
|
};
|
2024-01-06 00:59:11 +03:00
|
|
|
# some package this project depends on:
|
2021-03-15 17:21:50 +03:00
|
|
|
inputs.pkg = {
|
2021-06-22 13:34:03 +03:00
|
|
|
url = "github:idris-lang/pkg";
|
2021-03-15 17:21:50 +03:00
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
|
|
inputs.idris.follows = "idris";
|
|
|
|
};
|
|
|
|
|
2022-10-28 21:29:30 +03:00
|
|
|
outputs = { self, nixpkgs, idris, flake-utils, pkg }:
|
|
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
|
|
let
|
|
|
|
npkgs = import nixpkgs { inherit system; };
|
2024-01-06 00:59:11 +03:00
|
|
|
my-pkg = pkg.packages.${system}.library { };
|
2022-10-28 21:29:30 +03:00
|
|
|
idrisPkgs = idris.packages.${system};
|
|
|
|
buildIdris = idris.buildIdris.${system};
|
|
|
|
pkgs = buildIdris {
|
|
|
|
projectName = "pkgWithDeps";
|
|
|
|
src = ./.;
|
2024-01-06 00:59:11 +03:00
|
|
|
idrisLibraries = [ my-pkg ];
|
2022-10-28 21:29:30 +03:00
|
|
|
};
|
|
|
|
in rec {
|
|
|
|
packages = pkgs // idrisPkgs;
|
2024-01-06 00:59:11 +03:00
|
|
|
defaultPackage = pkgs.executable;
|
2022-10-28 21:29:30 +03:00
|
|
|
devShell = npkgs.mkShell {
|
|
|
|
buildInputs = [ idrisPkgs.idris2 npkgs.rlwrap ];
|
|
|
|
shellHook = ''
|
|
|
|
alias idris2="rlwrap -s 1000 idris2 --no-banner"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
});
|
2021-03-15 17:21:50 +03:00
|
|
|
}
|