nixos-config/mqtt/shell.nix

20 lines
447 B
Nix
Raw Normal View History

2021-03-16 21:09:22 +01:00
{ pkgs ? import <nixpkgs> { } }:
let
2021-03-16 22:14:50 +01:00
myPython = pkgs.python3.withPackages
(python-packages: with python-packages; [ paho-mqtt ]);
2021-03-16 21:09:22 +01:00
startServer = pkgs.writers.writeBashBin "start-server" ''
2021-03-16 22:14:50 +01:00
${myPython}/bin/python ./heater.py
2021-03-16 21:09:22 +01:00
'';
2021-03-26 02:46:05 +01:00
reformat = pkgs.writers.writeBashBin "reformat" ''
${pkgs.black}/bin/black --exclude venv ${toString ./.}
'';
2021-03-16 21:09:22 +01:00
in pkgs.mkShell {
2021-03-26 02:46:05 +01:00
buildInputs = with pkgs; [ myPython startServer reformat ];
2021-03-16 21:09:22 +01:00
}