74 lines
1.8 KiB
Nix
74 lines
1.8 KiB
Nix
{
|
|
description = "Hyprmonitors - Hyprland monitor control server";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = {
|
|
self,
|
|
nixpkgs,
|
|
rust-overlay,
|
|
flake-utils,
|
|
}:
|
|
flake-utils.lib.eachDefaultSystem (system: let
|
|
overlays = [(import rust-overlay)];
|
|
pkgs = import nixpkgs {
|
|
inherit system overlays;
|
|
};
|
|
|
|
rustToolchain = pkgs.rust-bin.stable.latest.default.override {
|
|
extensions = ["rust-src" "rust-analyzer"];
|
|
};
|
|
in {
|
|
devShells.default = pkgs.mkShell {
|
|
buildInputs = with pkgs; [
|
|
rustToolchain
|
|
pkg-config
|
|
openssl
|
|
curl
|
|
jq
|
|
];
|
|
|
|
shellHook = ''
|
|
echo "Hyprmonitors development environment"
|
|
echo "Rust version: $(rustc --version)"
|
|
echo ""
|
|
echo "Available commands:"
|
|
echo " cargo build - Build the project"
|
|
echo " cargo run - Run the server"
|
|
echo " cargo test - Run tests"
|
|
echo " ./examples.sh - Run API examples"
|
|
echo ""
|
|
'';
|
|
|
|
RUST_SRC_PATH = "${rustToolchain}/lib/rustlib/src/rust/library";
|
|
};
|
|
|
|
packages.default = pkgs.rustPlatform.buildRustPackage {
|
|
pname = "hyprmonitors";
|
|
version = "0.1.0";
|
|
|
|
src = ./.;
|
|
|
|
cargoLock = {
|
|
lockFile = ./Cargo.lock;
|
|
};
|
|
|
|
buildInputs = with pkgs; [
|
|
openssl
|
|
pkg-config
|
|
];
|
|
|
|
meta = with pkgs.lib; {
|
|
description = "Hyprland monitor control server";
|
|
homepage = "https://github.com/your-username/hyprmonitors";
|
|
license = licenses.mit;
|
|
maintainers = [];
|
|
};
|
|
};
|
|
});
|
|
}
|