2021-03-10 00:29:14 +00:00
|
|
|
{
|
|
|
|
description = "Matemat";
|
|
|
|
|
2021-03-10 00:45:10 +00:00
|
|
|
outputs = { self, nixpkgs }:
|
|
|
|
let
|
|
|
|
systems = [ "x86_64-linux" "i686-linux" "aarch64-linux" ];
|
|
|
|
forSystems = nixpkgs.lib.genAttrs systems;
|
2021-03-12 00:56:27 +00:00
|
|
|
in rec {
|
2021-03-10 00:45:10 +00:00
|
|
|
packages = forSystems (system: {
|
|
|
|
yammat = nixpkgs.legacyPackages.${system}.haskellPackages.callPackage ./pkg.nix {};
|
|
|
|
});
|
2021-03-10 00:29:14 +00:00
|
|
|
|
2021-03-10 00:45:10 +00:00
|
|
|
defaultPackage = forSystems (system:
|
|
|
|
self.packages.${system}.yammat
|
|
|
|
);
|
2021-03-10 00:29:14 +00:00
|
|
|
|
2021-03-12 00:56:27 +00:00
|
|
|
checks = packages;
|
|
|
|
|
2021-03-12 01:24:30 +00:00
|
|
|
hydraJobs =
|
2021-03-12 00:56:27 +00:00
|
|
|
let
|
2021-03-12 01:24:30 +00:00
|
|
|
system = builtins.head systems;
|
2021-03-12 00:56:27 +00:00
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
ghcVersions =
|
|
|
|
builtins.filter (p:
|
|
|
|
builtins.match "ghc.+" p != null
|
|
|
|
) (builtins.attrNames pkgs.haskell.packages);
|
|
|
|
in
|
|
|
|
builtins.foldl' (checks: ghcVersion:
|
|
|
|
let
|
|
|
|
haskellPackages = pkgs.haskell.packages.${ghcVersion};
|
2022-06-16 20:45:49 +00:00
|
|
|
inherit (pkgs.haskell.lib.compose) justStaticExecutables;
|
2021-03-12 00:56:27 +00:00
|
|
|
in
|
|
|
|
checks // {
|
2022-06-16 20:45:49 +00:00
|
|
|
"${ghcVersion}".yammat = justStaticExecutables(haskellPackages.callPackage ./pkg.nix {});
|
2021-03-12 00:56:27 +00:00
|
|
|
}
|
2021-03-12 01:24:30 +00:00
|
|
|
) {} ghcVersions;
|
2021-03-12 00:56:27 +00:00
|
|
|
|
2021-03-10 00:45:10 +00:00
|
|
|
devShell = forSystems (system:
|
|
|
|
import ./shell.nix {
|
|
|
|
nixpkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
}
|
|
|
|
);
|
2021-03-10 00:29:14 +00:00
|
|
|
|
|
|
|
nixosModule = import ./nixos-module.nix;
|
2021-03-10 00:45:10 +00:00
|
|
|
};
|
2021-03-10 00:29:14 +00:00
|
|
|
}
|