diff --git a/haskell/.envrc b/haskell/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/haskell/.envrc @@ -0,0 +1 @@ +use flake diff --git a/haskell/.gitignore b/haskell/.gitignore new file mode 100644 index 0000000..b3b7e72 --- /dev/null +++ b/haskell/.gitignore @@ -0,0 +1,3 @@ +result +.direnv +dist-newstyle diff --git a/haskell/flake.nix b/haskell/flake.nix new file mode 100644 index 0000000..a1af629 --- /dev/null +++ b/haskell/flake.nix @@ -0,0 +1,38 @@ +{ description = "A basic Haskell flake"; +# To be used in conjunction with cabal2nix + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + outputs = { self, nixpkgs, flake-utils}: + flake-utils.lib.eachDefaultSystem (system: + let pkgs = import nixpkgs { inherit system; }; + compiler = throw "add compiler version here"; + in { + packages = { + default = pkgs.haskell.packages.${compiler}.mkDerivation rec { + pname = throw "insert haskell package name here\nderived from the .cabal file"; + version = "0.1.0.0"; + src = ./.; + isLibrary = false; + isExecutable = true; + executableHaskellDepends = with pkgs.haskellPackages; [ + base + ]; + license = pkgs.lib.licenses.agpl3Only; + mainProgram = pname; + }; + }; + + devShells.default = pkgs.mkShell { + buildInputs = with pkgs.haskellPackages; [ + base + cabal-install + ghc + haskell-language-server + cabal2nix + ]; + }; + + }); +}