ddcmqtt/flake.nix

53 lines
1.5 KiB
Nix
Raw Normal View History

2022-04-07 16:23:53 +01:00
{
description = "virtual environments";
inputs.devshell.url = "github:numtide/devshell";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.naersk.url = "github:nix-community/naersk";
2022-05-11 01:15:48 +01:00
inputs.rust-overlay.url = "github:oxalica/rust-overlay";
2022-04-07 16:23:53 +01:00
2022-07-07 01:17:14 +01:00
outputs = {
self,
flake-utils,
devshell,
nixpkgs,
naersk,
rust-overlay,
}:
2022-04-07 16:23:53 +01:00
flake-utils.lib.eachDefaultSystem (system: let
2022-05-11 01:15:48 +01:00
pkgs = import nixpkgs {
inherit system;
2022-07-07 01:17:14 +01:00
overlays = [(import rust-overlay)];
2022-05-11 01:15:48 +01:00
};
2022-04-07 16:23:53 +01:00
naersk-lib = naersk.lib."${system}";
in {
2022-05-11 01:15:48 +01:00
/*
2022-07-07 01:17:14 +01:00
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; [
2022-10-11 20:41:42 +01:00
(rust-bin.nightly.latest.default.override {extensions = ["rls"];})
(pkgs.lib.optional pkgs.stdenv.isLinux udev)
2022-07-07 01:17:14 +01:00
pkgconfig
mosquitto # For testing mqtt with mosquitto_pub
];
2022-04-07 16:23:53 +01:00
};
2022-07-07 01:17:14 +01:00
formatter = pkgs.alejandra;
2022-04-07 16:23:53 +01:00
});
}