chore: initialize project template

This commit is contained in:
♥ Minnie ♥ 2025-02-20 13:43:07 +08:00
commit 3857b5dfa3
Signed by: jasmine
GPG key ID: 8563E358D4E8040E
15 changed files with 3728 additions and 0 deletions

View file

@ -0,0 +1,19 @@
{
perSystem = { config, pkgs, ... }: {
# Default shell.
devShells.default = pkgs.mkShell {
name = "xmonad-config";
meta.description = "Haskell development environment";
# See https://community.flake.parts/haskell-flake/devshell#composing-devshells
inputsFrom = [
config.haskellProjects.default.outputs.devShell # See ./nix/modules/haskell.nix
config.pre-commit.devShell # See ./nix/modules/formatter.nix
];
packages = with pkgs; [
just
nixd
ghciwatch
];
};
};
}

View file

@ -0,0 +1,62 @@
{ root, inputs, ... }:
{
imports = [
inputs.haskell-flake.flakeModule
];
perSystem = { self', 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 = {
# To avoid unnecessary rebuilds, we filter projectRoot:
# https://community.flake.parts/haskell-flake/local#rebuild
projectRoot = builtins.toString (lib.fileset.toSource {
inherit root;
fileset = lib.fileset.unions [
(root + /src)
(root + /xmonad-config.cabal)
(root + /LICENSE)
(root + /README.md)
];
});
# 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)
/*
aeson.source = "1.5.0.0" # Hackage version
shower.source = inputs.shower; # Flake input
*/
};
# Add your package overrides here
settings = {
xmonad-config = {
stan = true;
# haddock = false;
};
/*
aeson = {
check = false;
};
*/
};
# Development shell configuration
devShell = {
hlsCheck.enable = false;
};
# What should haskell-flake add to flake outputs?
autoWire = [ "packages" "apps" "checks" ]; # Wire all but the devShell
};
# Default package & app.
packages.default = self'.packages.xmonad-config;
apps.default = self'.apps.xmonad-config;
};
}

View file

@ -0,0 +1,32 @@
{ inputs, ... }:
{
imports = [
(inputs.git-hooks + /flake-module.nix)
inputs.fourmolu-nix.flakeModule
];
perSystem = { config, ... }: {
pre-commit.settings = {
hooks = {
nixpkgs-fmt.enable = true;
cabal-fmt.enable = true;
fourmolu = {
enable = true;
package = config.fourmolu.wrapper;
};
hlint.enable = true;
};
};
fourmolu.settings = {
indentation = 2;
comma-style = "leading";
record-brace-space = true;
indent-wheres = true;
import-export-style = "diff-friendly";
respectful = true;
haddock-style = "multi-line";
newlines-between-decls = 1;
extensions = [ "ImportQualifiedPost" ];
};
};
}