aboutsummaryrefslogtreecommitdiff
path: root/server/wrapped.nix
blob: 8fde8ac7d04589ef4ad9759a93f0be0cc3e88626 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{ runCommand, makeWrapper
, ghcWithPackages
, thermoprint-server
, extraPackages ? (p: [])
}:

let
  name = "${thermoprint-server.name}-wrapper";
in runCommand name {
  paths = [ thermoprint-server ];
  buildInputs = [ makeWrapper ];
} ''
  cp -vr ${thermoprint-server} $out
  chmod u+w $out/bin
  wrapProgram $out/bin/thermoprint-server \
    --set NIX_GHC ${ghcWithPackages (p: [ thermoprint-server ] ++ extraPackages p)}/bin/ghc
''