summaryrefslogtreecommitdiff
path: root/custom/thermoprint-service.nix
blob: d9131f6fe440b376911de2e10bfb30c3db519f3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ 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: {
      haskellPackages = 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;
    })];
  };
}