{ sources ? import ./nix/sources.nix , pkgs ? import sources.nixpkgs { overlays = [ (self: super: { apaperless = pkgs.writers.writeDashBin "apaperless" '' set -efu exec cabal run apaperless -- "$@" ''; }) ]; } }: let haskellPackages = pkgs.haskellPackages.override { overrides = self: super: { apaperless = super.callCabal2nix "apaperless" ./. { }; tags = super.callCabal2nix "tags" ./tags { }; }; }; in rec { inherit (haskellPackages) apaperless; shell = haskellPackages.shellFor { packages = _: [ apaperless ]; buildInputs = [ haskellPackages.cabal-install haskellPackages.hlint haskellPackages.ormolu haskellPackages.pointfree pkgs.apaperless pkgs.ghcid pkgs.haskell-language-server pkgs.niv pkgs.tesseract pkgs.pdfsandwich pkgs.unpaper ]; withHoogle = true; withHaddock = true; shellHook = '' HISTFILE=${pkgs.lib.escapeShellArg ./.}/.history; export HISTFILE APAPERLESS_STORE_DIR=${pkgs.lib.escapeShellArg ./.}/store; export APAPERLESS_STORE_DIR ''; }; }