2020-02-16 03:08:31 +03:00
|
|
|
# SPDX-FileCopyrightText: 2020 Serokell <https://serokell.io/>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
|
|
|
{
|
|
|
|
description = "Get your UTF-8 IO right on the first try";
|
|
|
|
|
2021-02-18 06:10:45 +03:00
|
|
|
inputs = {
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
2021-03-29 16:05:42 +03:00
|
|
|
haskell-nix.url = "github:input-output-hk/haskell.nix";
|
|
|
|
nixpkgs.url = "github:serokell/nixpkgs";
|
2021-02-18 06:10:45 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, flake-utils, haskell-nix }:
|
2021-03-29 15:36:54 +03:00
|
|
|
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
|
2021-02-18 06:10:45 +03:00
|
|
|
let
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system}.extend haskell-nix.overlay;
|
2021-03-29 15:36:54 +03:00
|
|
|
inherit (pkgs) lib;
|
2021-02-18 06:10:45 +03:00
|
|
|
|
2021-03-29 15:36:54 +03:00
|
|
|
src = ./.;
|
|
|
|
project = args: pkgs.haskell-nix.stackProject ({ inherit src; } // args);
|
|
|
|
with-utf8 = (project {}).with-utf8;
|
|
|
|
check = args: (project args).with-utf8.checks.with-utf8-test;
|
2021-02-18 06:10:45 +03:00
|
|
|
in rec {
|
|
|
|
packages = {
|
|
|
|
with-utf8 = with-utf8.components.library;
|
|
|
|
};
|
|
|
|
defaultPackage = packages.with-utf8;
|
2020-02-16 05:23:42 +03:00
|
|
|
|
2021-03-29 15:36:54 +03:00
|
|
|
checks =
|
|
|
|
let
|
2021-03-29 16:05:42 +03:00
|
|
|
mkGhcCheck = ghcVersion: {
|
|
|
|
name = "test-ghc${ghcVersion}";
|
|
|
|
value = check { ghc = pkgs.haskell-nix.compiler."ghc${ghcVersion}"; };
|
2021-03-29 15:36:54 +03:00
|
|
|
};
|
|
|
|
in {
|
|
|
|
test = with-utf8.checks.with-utf8-test;
|
2021-03-29 16:05:42 +03:00
|
|
|
} // lib.listToAttrs (map mkGhcCheck [ "884" "8104" "901" ]);
|
2020-02-16 03:08:31 +03:00
|
|
|
|
2021-02-18 06:10:45 +03:00
|
|
|
apps.utf8-troubleshoot = {
|
|
|
|
type = "app";
|
|
|
|
program = "${with-utf8.components.exes.utf8-troubleshoot}/bin/utf8-troubleshoot";
|
|
|
|
};
|
|
|
|
defaultApp = apps.utf8-troubleshoot;
|
|
|
|
}
|
|
|
|
);
|
2020-02-16 03:08:31 +03:00
|
|
|
}
|