format
Some checks failed
Hydra packages.x86_64-linux.default Hydra build #48488 of flakes:matrix-media-expanded:packages.x86_64-linux.default
Hydra packages.x86_64-linux.matrix-media-expanded Hydra build #48492 of flakes:matrix-media-expanded:packages.x86_64-linux.matrix-media-expanded
Hydra checks.aarch64-darwin.treefmt Hydra build #48489 of flakes:matrix-media-expanded:checks.aarch64-darwin.treefmt
Hydra checks.x86_64-darwin.treefmt Hydra build #48491 of flakes:matrix-media-expanded:checks.x86_64-darwin.treefmt
Hydra checks.x86_64-linux.treefmt Hydra build #48493 of flakes:matrix-media-expanded:checks.x86_64-linux.treefmt
Hydra checks.aarch64-linux.treefmt Hydra build #48490 of flakes:matrix-media-expanded:checks.aarch64-linux.treefmt
Hydra packages.aarch64-linux.default Hydra build #48487 of flakes:matrix-media-expanded:packages.aarch64-linux.default
Hydra packages.aarch64-linux.matrix-media-expanded Hydra build #48494 of flakes:matrix-media-expanded:packages.aarch64-linux.matrix-media-expanded

This commit is contained in:
Charlotte 🦝 Delenk 2023-06-10 15:28:09 +01:00
parent f5fda366a1
commit a1d56f65ae
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122
2 changed files with 114 additions and 114 deletions

201
flake.nix
View file

@ -12,7 +12,7 @@
};
outputs = inputs:
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = import inputs.systems;
imports = [
inputs.haskell-flake.flakeModule
@ -20,125 +20,124 @@
inputs.flake-root.flakeModule
inputs.mission-control.flakeModule
];
perSystem = {
self',
system,
lib,
config,
pkgs,
...
}: {
# Our only Haskell project. You can have multiple projects, but this template
# has only one.
# See https://github.com/srid/haskell-flake/blob/master/example/flake.nix
haskellProjects.default = {
# The base package set (this value is the default)
# basePackages = pkgs.haskellPackages;
perSystem =
{ self'
, system
, lib
, config
, pkgs
, ...
}: {
# Our only Haskell project. You can have multiple projects, but this template
# has only one.
# See https://github.com/srid/haskell-flake/blob/master/example/flake.nix
haskellProjects.default = {
# The base package set (this value is the default)
# basePackages = pkgs.haskellPackages;
# Packages to add on top of `basePackages`
packages = {
# Add source or Hackage overrides here
# (Local packages are added automatically)
/*
# Packages to add on top of `basePackages`
packages = {
# Add source or Hackage overrides here
# (Local packages are added automatically)
/*
aeson.source = "1.5.0.0" # Hackage version
shower.source = inputs.shower; # Flake input
*/
};
*/
};
# Add your package overrides here
settings = {
/*
# Add your package overrides here
settings = {
/*
haskell-template = {
haddock = false;
};
aeson = {
check = false;
};
*/
*/
};
# Development shell configuration
devShell = {
# TODO: Remove this after https://github.com/numtide/treefmt-nix/issues/65
tools = hp:
{
treefmt = config.treefmt.build.wrapper;
}
// config.treefmt.build.programs;
hlsCheck.enable = false;
};
# What should haskell-flake add to flake outputs?
autoWire = [ "packages" "apps" "checks" ]; # Wire all but the devShell
};
# Development shell configuration
devShell = {
# TODO: Remove this after https://github.com/numtide/treefmt-nix/issues/65
tools = hp:
{
treefmt = config.treefmt.build.wrapper;
}
// config.treefmt.build.programs;
hlsCheck.enable = true;
# Auto formatters. This also adds a flake check to ensure that the
# source tree was auto formatted.
treefmt.config = {
inherit (config.flake-root) projectRootFile;
package = pkgs.treefmt;
programs.ormolu.enable = true;
programs.nixpkgs-fmt.enable = true;
programs.cabal-fmt.enable = true;
programs.hlint.enable = true;
# We use fourmolu
programs.ormolu.package = pkgs.haskellPackages.fourmolu;
settings.formatter.ormolu = {
options = [
"--ghc-opt"
"-XImportQualifiedPost"
];
};
};
# What should haskell-flake add to flake outputs?
autoWire = ["packages" "apps" "checks"]; # Wire all but the devShell
};
# Dev shell scripts.
mission-control.scripts = {
docs = {
description = "Start Hoogle server for project dependencies";
exec = ''
echo http://127.0.0.1:8888
hoogle serve -p 8888 --local
'';
category = "Dev Tools";
};
repl = {
description = "Start the cabal repl";
exec = ''
cabal repl "$@"
'';
category = "Dev Tools";
};
fmt = {
description = "Format the source tree";
exec = config.treefmt.build.wrapper;
category = "Dev Tools";
};
run = {
description = "Run the project with ghcid auto-recompile";
exec = ''
ghcid -c "cabal repl exe:matrix-media-expanded" --warnings -T :main
'';
category = "Primary";
};
};
# Auto formatters. This also adds a flake check to ensure that the
# source tree was auto formatted.
treefmt.config = {
inherit (config.flake-root) projectRootFile;
package = pkgs.treefmt;
# Default package & app.
packages.default = self'.packages.matrix-media-expanded;
apps.default = self'.apps.matrix-media-expanded;
programs.ormolu.enable = true;
programs.nixpkgs-fmt.enable = true;
programs.cabal-fmt.enable = true;
programs.hlint.enable = true;
# We use fourmolu
programs.ormolu.package = pkgs.haskellPackages.fourmolu;
settings.formatter.ormolu = {
options = [
"--ghc-opt"
"-XImportQualifiedPost"
# Default shell.
devShells.default = pkgs.mkShell {
name = "matrix-media-expanded";
inputsFrom = [
config.haskellProjects.default.outputs.devShell
config.flake-root.devShell
config.mission-control.devShell
];
};
};
# Dev shell scripts.
mission-control.scripts = {
docs = {
description = "Start Hoogle server for project dependencies";
exec = ''
echo http://127.0.0.1:8888
hoogle serve -p 8888 --local
'';
category = "Dev Tools";
};
repl = {
description = "Start the cabal repl";
exec = ''
cabal repl "$@"
'';
category = "Dev Tools";
};
fmt = {
description = "Format the source tree";
exec = config.treefmt.build.wrapper;
category = "Dev Tools";
};
run = {
description = "Run the project with ghcid auto-recompile";
exec = ''
ghcid -c "cabal repl exe:matrix-media-expanded" --warnings -T :main
'';
category = "Primary";
};
};
# Default package & app.
packages.default = self'.packages.matrix-media-expanded;
apps.default = self'.apps.matrix-media-expanded;
# Default shell.
devShells.default = pkgs.mkShell {
name = "matrix-media-expanded";
inputsFrom = [
config.haskellProjects.default.outputs.devShell
config.flake-root.devShell
config.mission-control.devShell
];
};
formatter = pkgs.alejandra;
};
flake = {
hydraJobs = {
inherit (inputs.self) packages devShells checks;

View file

@ -93,30 +93,31 @@ common shared
default-language: Haskell2010
library
import: shared
import: shared
exposed-modules:
Codec.Multibase
, Codec.Multibase.Error
, Codec.Multibase.Identity
Codec.Multibase.Error
Codec.Multibase.Identity
executable matrix-media-expanded
import: shared
main-is: Main.hs
test-suite test
import: shared
import: shared
build-depends:
, tasty
, tasty-smallcheck
, tasty-quickcheck
, tasty-hunit
type: exitcode-stdio-1.0
, tasty-quickcheck
, tasty-smallcheck
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: Test.hs
ghc-options: -main-is Test
main-is: Test.hs
ghc-options: -main-is Test
other-modules:
Codec.Multibase.Error
, Codec.Multibase.Identity
, Test.Codec
, Test.Codec.Multibase
, Test.Codec.Multibase.Identity
Codec.Multibase.Identity
Test.Codec
Test.Codec.Multibase
Test.Codec.Multibase.Identity