{ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; flake-parts = { url = "github:hercules-ci/flake-parts"; inputs.nixpkgs-lib.follows = "nixpkgs"; }; treefmt-nix.url = "github:numtide/treefmt-nix"; }; outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } { systems = [ "x86_64-linux" ]; imports = [ inputs.treefmt-nix.flakeModule ]; perSystem = { pkgs, ... }: { packages.default = pkgs.haskellPackages.callCabal2nix "example" ./. { }; devShells.default = pkgs.haskellPackages.shellFor { packages = ps: [ ]; buildInputs = with pkgs.haskellPackages; [ cabal-install haskell-language-server megaparsec ]; }; treefmt = { projectRootFile = "flake.nix"; programs.nixpkgs-fmt.enable = true; programs.cabal-fmt.enable = true; }; }; }; }