Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.direnv
result*
dist-newstyle
.pre-commit-config.yaml
186 changes: 186 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 61 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
nixConfig.allow-import-from-derivation = true;
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
parts.url = "github:hercules-ci/flake-parts";
haskell-flake.url = "github:srid/haskell-flake";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
devshell.url = "github:numtide/devshell";
devshell.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs:
inputs.parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux"];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
systems = ["x86_64-linux"];
systems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];

imports = [
inputs.devshell.flakeModule
inputs.haskell-flake.flakeModule
inputs.pre-commit-hooks.flakeModule
];

perSystem = {
config,
# pkgs,
# lib,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# pkgs,
# lib,
pkgs,

This will be needed if you fix the basePackages, otherwise it can also be removed.

...
}: {
devshells.default = {
devshell = {
packagesFrom = [config.devShells.ghc96];
packages = [];
startup = {
pre-commit.text = config.pre-commit.installationScript;
};
};
};
pre-commit = {
check.enable = true;
settings.hooks = {
cabal-fmt.enable = true;
hlint.enable = true;
Comment on lines +37 to +38
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cabal-fmt.enable = true;
hlint.enable = true;
cabal-fmt.enable = true;
hlint.enable = true;
ormolu.enable = true;


alejandra.enable = true;
statix.enable = true;
deadnix.enable = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it would be good to remove statix from here, it sucks.

Suggested change
alejandra.enable = true;
statix.enable = true;
deadnix.enable = true;
alejandra.enable = true;
deadnix.enable = true;

};
};
haskellProjects.ghc96 = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
haskellProjects.ghc96 = {
haskellProjects.ghc96 = {
basePackages = pkgs.haskell.packages.ghc96;

alternatively you can also rename this to smth like default-haskell or you can search fo the option on flake.parts that switches off the automatic population of default.

# packages = {};
# settings = {};
projectRoot = ./message-index;
# devShell.mkShellArgs = {
# packages = [
# # pkgs.zlib.dev
# # pkgs.haskellPackages.zlib
# # pkgs.haskellPackages.zlib_0_7_1_0.dev
# ];
# # shellHook = config.pre-commit.installationScript;
# };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# packages = {};
# settings = {};
projectRoot = ./message-index;
# devShell.mkShellArgs = {
# packages = [
# # pkgs.zlib.dev
# # pkgs.haskellPackages.zlib
# # pkgs.haskellPackages.zlib_0_7_1_0.dev
# ];
# # shellHook = config.pre-commit.installationScript;
# };
projectRoot = ./message-index;

};
};
};
}