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
|
20
flake.nix
20
flake.nix
|
@ -7,8 +7,10 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, idris2-pkgs, flake-utils }:
|
outputs = { self, nixpkgs, idris2-pkgs, flake-utils }:
|
||||||
flake-utils.lib.eachSystem [ "x86_64-darwin" "x86_64-linux" "i686-linux" ]
|
let systems = with flake-utils.lib.system;
|
||||||
(system:
|
[ x86_64-darwin x86_64-linux i686-linux ];
|
||||||
|
in
|
||||||
|
flake-utils.lib.eachSystem systems (system:
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
|
@ -16,11 +18,19 @@
|
||||||
};
|
};
|
||||||
inherit (pkgs.idris2-pkgs._builders) idrisPackage devEnv;
|
inherit (pkgs.idris2-pkgs._builders) idrisPackage devEnv;
|
||||||
|
|
||||||
|
packages = rec {
|
||||||
tap = idrisPackage ./. { };
|
tap = idrisPackage ./. { };
|
||||||
|
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 {
|
in {
|
||||||
defaultPackage = tap;
|
inherit packages devShells;
|
||||||
packages = { inherit tap; };
|
defaultPackage = packages.tap;
|
||||||
devShell = pkgs.mkShell { buildInputs = [ (devEnv tap) ]; };
|
devShell = devShells.tap;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue