Skip to content

Commit

Permalink
Add nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
axman6 committed Mar 28, 2024
1 parent bb46c5e commit bf460fb
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 1 deletion.
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 ];

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

# Typically, you just want a single project named "default". But
# multiple projects are also possible, each using different GHC version.
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;
};
};
}

0 comments on commit bf460fb

Please sign in to comment.