ctucx.git: nimtradfri

[nimlang] incomplete library to interact with ikea tradfri-gateways

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 
32 
33 
{
  pkgs ? import <nixpkgs> {}
, src ? ./.
}:

with pkgs;

let
  libcoap-with-dtls = libcoap.overrideAttrs (oldAttrs: {
    configureFlags = oldAttrs.configureFlags ++ [ "--enable-dtls" ];
    buildInputs = [ openssl ];
  });
in 
  stdenv.mkDerivation {
    pname = "tradfri-cli";
    version = "0.1.0";
    inherit src;
    nativeBuildInputs = [ nim makeWrapper ];
    buildPhase = ''
      runHook preBuild
      nim c -d:release --nimcache:$PWD tradfriCli
      runHook postBuild
    '';
    installPhase = ''
      runHook preInstall
      install -Dm755 tradfriCli $out/bin/tradfriCli
      runHook postInstall
    '';
    fixupPhase = ''
      wrapProgram $out/bin/tradfriCli \
        --prefix PATH : ${stdenv.lib.makeBinPath [ libcoap-with-dtls ]}
    '';
  }