Make 'nix flake check' work
This commit is contained in:
parent
da3b61b467
commit
7a69fb2363
6 changed files with 27 additions and 20 deletions
15
flake.nix
15
flake.nix
|
|
@ -11,7 +11,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, pre-commit-hooks }:
|
outputs = { self, nixpkgs, flake-utils, pre-commit-hooks }:
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
|
||||||
let
|
let
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
|
||||||
|
|
@ -27,13 +27,13 @@
|
||||||
# Dependency overrides go here
|
# Dependency overrides go here
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultPackage = self.packages.${system}.${packageName};
|
packages.default = self.packages.${system}.${packageName};
|
||||||
|
|
||||||
apps = {
|
apps = {
|
||||||
# run with: nix run #.hcat
|
# run with: nix run #.hcat
|
||||||
hcat = {
|
hcat = {
|
||||||
type = "app";
|
type = "app";
|
||||||
program = "${self.defaultPackage.${system}}/bin/hcat";
|
program = "${self.packages.${system}.default}/bin/hcat";
|
||||||
};
|
};
|
||||||
|
|
||||||
# run with: nix run
|
# run with: nix run
|
||||||
|
|
@ -43,6 +43,8 @@
|
||||||
checks = {
|
checks = {
|
||||||
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
settings = { ormolu.defaultExtensions = [ "GHC2021" ]; };
|
||||||
|
tools.fourmolu = haskellPackages.fourmolu;
|
||||||
hooks = {
|
hooks = {
|
||||||
nixfmt.enable = true;
|
nixfmt.enable = true;
|
||||||
fourmolu.enable = true;
|
fourmolu.enable = true;
|
||||||
|
|
@ -51,17 +53,18 @@
|
||||||
doctest = {
|
doctest = {
|
||||||
enable = true;
|
enable = true;
|
||||||
name = "Run documentation tests";
|
name = "Run documentation tests";
|
||||||
entry = "doctest";
|
entry = "${haskellPackages.doctest}/bin/doctest src app";
|
||||||
files = "\\.l?hs$";
|
files = "\\.l?hs$";
|
||||||
|
pass_filenames = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
devShell = haskellPackages.shellFor {
|
devShells.default = haskellPackages.shellFor {
|
||||||
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
||||||
|
|
||||||
packages = p: [ self.defaultPackage.${system} ];
|
packages = p: [ self.packages.${system}.default ];
|
||||||
|
|
||||||
withHoogle = true;
|
withHoogle = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ library
|
||||||
default-extensions:
|
default-extensions:
|
||||||
BlockArguments
|
BlockArguments
|
||||||
OverloadedStrings
|
OverloadedStrings
|
||||||
|
ImportQualifiedPost
|
||||||
ghc-options: -Wall -Wunused-packages -fdefer-typed-holes
|
ghc-options: -Wall -Wunused-packages -fdefer-typed-holes
|
||||||
build-depends:
|
build-depends:
|
||||||
base >=4.13 && <5
|
base >=4.13 && <5
|
||||||
|
|
@ -41,6 +42,7 @@ executable hcat
|
||||||
default-extensions:
|
default-extensions:
|
||||||
BlockArguments
|
BlockArguments
|
||||||
OverloadedStrings
|
OverloadedStrings
|
||||||
|
ImportQualifiedPost
|
||||||
ghc-options: -Wall -Wunused-packages -fdefer-typed-holes
|
ghc-options: -Wall -Wunused-packages -fdefer-typed-holes
|
||||||
build-depends:
|
build-depends:
|
||||||
base >=4.13 && <5
|
base >=4.13 && <5
|
||||||
|
|
@ -59,6 +61,7 @@ test-suite spec
|
||||||
default-extensions:
|
default-extensions:
|
||||||
BlockArguments
|
BlockArguments
|
||||||
OverloadedStrings
|
OverloadedStrings
|
||||||
|
ImportQualifiedPost
|
||||||
ghc-options: -Wall -Wunused-packages -fdefer-typed-holes
|
ghc-options: -Wall -Wunused-packages -fdefer-typed-holes
|
||||||
cpp-options: -DTEST
|
cpp-options: -DTEST
|
||||||
build-tool-depends:
|
build-tool-depends:
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ ghc-options:
|
||||||
default-extensions:
|
default-extensions:
|
||||||
- BlockArguments
|
- BlockArguments
|
||||||
- OverloadedStrings
|
- OverloadedStrings
|
||||||
|
- ImportQualifiedPost
|
||||||
|
|
||||||
library:
|
library:
|
||||||
source-dirs: src
|
source-dirs: src
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{-# LANGUAGE GHC2021 #-}
|
-- {-# LANGUAGE GHC2021 #-}
|
||||||
|
|
||||||
module HCatSpec (spec) where
|
module HCatSpec (spec) where
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue