{ config, lib, pkgs, ... }: with lib; let pCfg = config.packages.thermoprint; in { options = { packages.thermoprint = { enable = mkEnableOption "thermoprint packages"; extraServerPackages = mkOption { type = types.unspecified; default = p: []; }; }; }; config = mkIf pCfg.enable { nixpkgs.overlays = [(selfPkgs: superPkgs: { haskell = superPkgs.haskell // { packages = superPkgs.haskell.packages // { ghc822 = superPkgs.haskell.packages.ghc822.extend (selfH: superH: import ./thermoprint { callPackage = superPkgs.lib.callPackageWith (selfH // { inherit (superPkgs) stdenv makeWrapper runCommand; }); extraPackages = pCfg.extraServerPackages; } ); }; }; inherit (selfPkgs.haskell.packages.ghc822) thermoprint-server thermoprint-webgui tprint; })]; }; }