feedback/flake.nix

99 lines
3.0 KiB
Nix
Raw Normal View History

2022-10-21 11:12:23 +03:00
{
description = "feedback";
2022-11-13 23:53:31 +03:00
nixConfig = {
extra-substituters = "https://feedback.cachix.org";
extra-trusted-public-keys = "feedback.cachix.org-1:8PNDEJ4GTCbsFUwxVWE/ulyoBMDqqL23JA44yB0j1jI=";
};
2022-10-21 11:12:23 +03:00
inputs = {
2023-06-05 12:47:04 +03:00
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-23.05";
2022-10-21 11:12:23 +03:00
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
2023-06-05 12:47:04 +03:00
validity.url = "github:NorfairKing/validity";
2022-10-21 11:12:23 +03:00
validity.flake = false;
2023-06-05 12:47:04 +03:00
autodocodec.url = "github:NorfairKing/autodocodec";
2022-10-21 11:12:23 +03:00
autodocodec.flake = false;
2023-06-05 12:47:04 +03:00
safe-coloured-text.url = "github:NorfairKing/safe-coloured-text";
2022-10-21 11:12:23 +03:00
safe-coloured-text.flake = false;
2023-10-12 17:58:52 +03:00
fast-myers-diff.url = "github:NorfairKing/fast-myers-diff";
fast-myers-diff.flake = false;
2023-06-05 12:47:04 +03:00
sydtest.url = "github:NorfairKing/sydtest";
2022-10-21 11:12:23 +03:00
sydtest.flake = false;
2023-01-14 22:44:49 +03:00
dekking.url = "github:NorfairKing/dekking";
dekking.flake = false;
2022-10-21 11:12:23 +03:00
};
outputs =
{ self
, nixpkgs
, pre-commit-hooks
, validity
, safe-coloured-text
, sydtest
2023-10-12 17:58:52 +03:00
, fast-myers-diff
2022-10-21 11:12:23 +03:00
, autodocodec
2023-01-14 22:44:49 +03:00
, dekking
2022-10-21 11:12:23 +03:00
}:
let
system = "x86_64-linux";
pkgsFor = nixpkgs: import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
self.overlays.${system}
(import (autodocodec + "/nix/overlay.nix"))
(import (safe-coloured-text + "/nix/overlay.nix"))
(import (sydtest + "/nix/overlay.nix"))
2023-10-12 17:58:52 +03:00
(import (fast-myers-diff + "/nix/overlay.nix"))
2022-10-21 11:12:23 +03:00
(import (validity + "/nix/overlay.nix"))
2023-01-14 22:44:49 +03:00
(import (dekking + "/nix/overlay.nix"))
2022-10-21 11:12:23 +03:00
];
};
pkgs = pkgsFor nixpkgs;
in
{
overlays.${system} = import ./nix/overlay.nix;
packages.${system}.default = pkgs.feedback;
checks.${system} = {
2023-06-05 12:47:04 +03:00
release = self.packages.${system}.default;
2022-10-21 11:12:23 +03:00
shell = self.devShells.${system}.default;
2023-01-14 22:44:49 +03:00
coverage-report = pkgs.dekking.makeCoverageReport {
name = "test-coverage-report";
coverables = [ "feedback" ];
coverage = [ "feedback-test-harness" ];
};
2022-10-21 11:12:23 +03:00
pre-commit = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
hlint.enable = true;
hpack.enable = true;
ormolu.enable = true;
nixpkgs-fmt.enable = true;
nixpkgs-fmt.excludes = [ ".*/default.nix" ];
cabal2nix.enable = true;
};
};
};
devShells.${system}.default = pkgs.haskellPackages.shellFor {
name = "feedback-shell";
2023-01-14 22:43:45 +03:00
packages = p: [ p.feedback p.feedback-test-harness ];
2022-10-21 11:12:23 +03:00
withHoogle = true;
doBenchmark = true;
2022-11-14 18:48:19 +03:00
buildInputs = (with pkgs; [
2022-10-21 11:12:23 +03:00
feedback
niv
zlib
cabal-install
2022-11-14 18:48:19 +03:00
]) ++ (with pre-commit-hooks.packages.${system};
2022-10-21 11:12:23 +03:00
[
hlint
hpack
nixpkgs-fmt
ormolu
cabal2nix
]);
shellHook = self.checks.${system}.pre-commit.shellHook + pkgs.feedback.shellHook;
};
};
}