ddcmqtt/flake.nix

53 lines
1.5 KiB
Nix

{
description = "virtual environments";
inputs.devshell.url = "github:numtide/devshell";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.naersk.url = "github:nix-community/naersk";
inputs.rust-overlay.url = "github:oxalica/rust-overlay";
outputs = {
self,
flake-utils,
devshell,
nixpkgs,
naersk,
rust-overlay,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [(import rust-overlay)];
};
naersk-lib = naersk.lib."${system}";
in {
/*
defaultPackage = naersk-lib.buildPackage {
pname = "ddcmqtt";
root = ./.;
nativeBuildInputs = with pkgs; [ pkgconfig libudev ];
};
/* devshell currently not really working for stuff that needs pkgconfig/libs
devShell =
let pkgs = import nixpkgs {
inherit system;
overlays = [ devshell.overlay ];
};
in
pkgs.devshell.mkShell {
packages = with pkgs; [ rustc cargo gcc ];
nativeBuildInputs = with pkgs; [ libudev pkgconfig ];
};
*/
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
(rust-bin.nightly.latest.default.override {extensions = ["rls"];})
(pkgs.lib.optional pkgs.stdenv.isLinux udev)
pkgconfig
mosquitto # For testing mqtt with mosquitto_pub
];
};
formatter = pkgs.alejandra;
});
}