skeleton of example
This commit is contained in:
parent
4c0ab9ca9b
commit
d8e8a95ef4
3 changed files with 39 additions and 14 deletions
7
example/Example.idr
Normal file
7
example/Example.idr
Normal file
|
@ -0,0 +1,7 @@
|
|||
module Example
|
||||
|
||||
import TAP
|
||||
|
||||
|
||||
main : IO ()
|
||||
main = TAP.main !getTestOpts []
|
8
example/example.ipkg
Normal file
8
example/example.ipkg
Normal file
|
@ -0,0 +1,8 @@
|
|||
package tap-example
|
||||
depends = base, contrib, tap
|
||||
|
||||
sourcedir = "."
|
||||
|
||||
executable = tap-example
|
||||
main = Example
|
||||
modules = Example
|
38
flake.nix
38
flake.nix
|
@ -7,20 +7,30 @@
|
|||
};
|
||||
|
||||
outputs = { self, nixpkgs, idris2-pkgs, flake-utils }:
|
||||
flake-utils.lib.eachSystem [ "x86_64-darwin" "x86_64-linux" "i686-linux" ]
|
||||
(system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ idris2-pkgs.overlay ];
|
||||
};
|
||||
inherit (pkgs.idris2-pkgs._builders) idrisPackage devEnv;
|
||||
let systems = with flake-utils.lib.system;
|
||||
[ 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 ];
|
||||
};
|
||||
inherit (pkgs.idris2-pkgs._builders) idrisPackage devEnv;
|
||||
|
||||
packages = rec {
|
||||
tap = idrisPackage ./. { };
|
||||
in {
|
||||
defaultPackage = tap;
|
||||
packages = { inherit tap; };
|
||||
devShell = pkgs.mkShell { buildInputs = [ (devEnv tap) ]; };
|
||||
}
|
||||
);
|
||||
tap-example = idrisPackage ./example { extraPkgs = packages; };
|
||||
};
|
||||
devShells =
|
||||
let mkDevShell = _: pkg:
|
||||
pkgs.mkShell { buildInputs = [ (devEnv pkg) ]; };
|
||||
shells = packages // (with packages; { example = tap-example; });
|
||||
in builtins.mapAttrs mkDevShell shells;
|
||||
in {
|
||||
inherit packages devShells;
|
||||
defaultPackage = packages.tap;
|
||||
devShell = devShells.tap;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue