-
Notifications
You must be signed in to change notification settings - Fork 70
Add basic haskell-nix setup #544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.direnv | ||
result* | ||
dist-newstyle | ||
.pre-commit-config.yaml |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,51 @@ | ||||||||
{ | ||||||||
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" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; | ||||||||
imports = [ | ||||||||
inputs.devshell.flakeModule | ||||||||
inputs.haskell-flake.flakeModule | ||||||||
inputs.pre-commit-hooks.flakeModule | ||||||||
]; | ||||||||
|
||||||||
perSystem = { | ||||||||
config, | ||||||||
pkgs, | ||||||||
... | ||||||||
}: { | ||||||||
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; | ||||||||
ormolu.enable = true; | ||||||||
|
||||||||
alejandra.enable = true; | ||||||||
deadnix.enable = true; | ||||||||
}; | ||||||||
}; | ||||||||
haskellProjects.ghc96 = { | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
alternatively you can also rename this to smth like |
||||||||
basePackages = pkgs.haskell.packages.ghc96; | ||||||||
projectRoot = ./message-index; | ||||||||
}; | ||||||||
}; | ||||||||
}; | ||||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.