From 208a73aae509790c8c89c9ff2d218fc28cf0489c Mon Sep 17 00:00:00 2001 From: Rowan Torbitzky-Lane Date: Tue, 25 Feb 2025 01:30:59 -0600 Subject: [PATCH] add flake --- flake.nix | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 flake.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..57b1c63 --- /dev/null +++ b/flake.nix @@ -0,0 +1,66 @@ +# https://community.flake.parts/haskell-flake/dependency +{ + 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, lib, ... }: { + + # 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://community.flake.parts/haskell-flake/package-set + # basePackages = pkgs.haskellPackages; + + # Extra package information. See https://community.flake.parts/haskell-flake/dependency + # + # Note that local packages are automatically included in `packages` + # (defined by `defaults.packages` option). + # + projectRoot = builtins.toString (lib.fileset.toSource { + root = ./.; + fileset = lib.fileset.unions [ + ./src + ./haskell-template.cabal + ]; + }); + packages = { + # aeson.source = "1.5.0.0"; # Override aeson to a custom version from Hackage + # shower.source = inputs.shower; # Override shower to a custom source path + }; + 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; }; + + # Check that haskell-language-server works + # hlsCheck.enable = true; # Requires sandbox to be disabled + }; + }; + + # haskell-flake doesn't set the default package, but you can do it here. + packages.default = self'.packages.HushGP; + }; + }; +}