Skip to content
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

Nixify #41

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ cabal.sandbox.config
*.eventlog
.stack-work/
cabal.project.local

# Nix build output
result
3 changes: 2 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
packages: .
packages:
.
80 changes: 80 additions & 0 deletions flake.lock

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

57 changes: 57 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
haskell-flake.url = "github:srid/haskell-flake";
};
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = nixpkgs.lib.systems.flakeExposed;
imports = [ inputs.haskell-flake.flakeModule ];
Copy link
Collaborator

Choose a reason for hiding this comment

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

You may want to pull in a pre-commit hooks module, see https://git.sr.ht/~jack/hslua-fennel-demo/tree/master/item/flake.nix for an example.


perSystem = { self', pkgs, ... }: {

# Typically, you just want a single project named "default". But
# multiple projects are also possible, each using different GHC version.
axman6 marked this conversation as resolved.
Show resolved Hide resolved
haskellProjects.default = {
# The base package set representing a specific GHC version.
# By default, this is pkgs.haskellPackages.
# You may also create your own. See https://zero-to-flakes.com/haskell-flake/package-set
# basePackages = pkgs.haskellPackages;

# Extra package information. See https://zero-to-flakes.com/haskell-flake/dependency
#
# Note that local packages are automatically included in `packages`
# (defined by `defaults.packages` option).
#
# packages = {
# aeson.source = "1.5.0.0"; # Hackage version override
# shower.source = inputs.shower;
# };
# settings = {
# aeson = {
# check = false;
# };
# relude = {
# haddock = false;
# broken = false;
# };
# };

devShell = {
# Enabled by default
enable = true;

# Programs you want to make available in the shell.
# Default programs can be disabled by setting to 'null'
# tools = hp: { fourmolu = hp.fourmolu; ghcid = null; };

hlsCheck.enable = true;
};
};

# haskell-flake doesn't set the default package, but you can do it here.
packages.default = self'.packages.amazonka-s3-streaming;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I didn't seem to need all that much of this.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Not sure I understand what you're suggesting I change here.

axman6 marked this conversation as resolved.
Show resolved Hide resolved
};
};
}
Loading