skeleton of example

This commit is contained in:
rhiannon morris 2022-05-26 16:29:47 +02:00
parent 4c0ab9ca9b
commit d8e8a95ef4
3 changed files with 39 additions and 14 deletions

7
example/Example.idr Normal file
View File

@ -0,0 +1,7 @@
module Example
import TAP
main : IO ()
main = TAP.main !getTestOpts []

8
example/example.ipkg Normal file
View File

@ -0,0 +1,8 @@
package tap-example
depends = base, contrib, tap
sourcedir = "."
executable = tap-example
main = Example
modules = Example

View File

@ -7,20 +7,30 @@
}; };
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 ];
let in
pkgs = import nixpkgs { flake-utils.lib.eachSystem systems (system:
inherit system; let
overlays = [ idris2-pkgs.overlay ]; pkgs = import nixpkgs {
}; inherit system;
inherit (pkgs.idris2-pkgs._builders) idrisPackage devEnv; overlays = [ idris2-pkgs.overlay ];
};
inherit (pkgs.idris2-pkgs._builders) idrisPackage devEnv;
packages = rec {
tap = idrisPackage ./. { }; tap = idrisPackage ./. { };
in { tap-example = idrisPackage ./example { extraPkgs = packages; };
defaultPackage = tap; };
packages = { inherit tap; }; devShells =
devShell = pkgs.mkShell { buildInputs = [ (devEnv tap) ]; }; 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;
}
);
} }