Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion rs/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
name = "cli"
version = "0.1.0"
edition = "2021"
description = "A CLI to process audio via the Elementary runtime"

[dependencies]
elem = { path = "../elem" }
server = { path = "../server" }
cxx = "1.0.131"
env_logger = "0.11.5"
futures-util = "0.3.31"
hound = "3.5.1"
log = "0.4.22"
Expand All @@ -16,6 +16,12 @@ serde_json = "1.0.133"
tokio = { version = "1.41.1", features = ["full"] }
tokio-tungstenite = "0.24.0"
cpal = "0.15.3"
tracing = "0.1.41"
tracing-subscriber = "0.3.19"
thiserror = "2.0.11"
ringbuf = "0.4.7"
clap = { version = "4.5.29", features = ["derive"] }
clap_derive = { version = "4.0.0-rc.1" }

[build-dependencies]
cxx-build = "1.0.131"
96 changes: 96 additions & 0 deletions rs/cli/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 59 additions & 0 deletions rs/cli/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
rust-overlay.url = "github:oxalica/rust-overlay";
};

outputs = inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" ];
perSystem = { config, self', pkgs, lib, system, ... }:
let
runtimeDeps = with pkgs; [ alsa-lib speechd ];
buildDeps = with pkgs; [ pkg-config rustPlatform.bindgenHook ];
devDeps = with pkgs; [ gdb ];

cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
msrv = cargoToml.package.rust-version;

rustPackage = features:
(pkgs.makeRustPlatform {
cargo = pkgs.rust-bin.stable.latest.minimal;
rustc = pkgs.rust-bin.stable.latest.minimal;
}).buildRustPackage {
inherit (cargoToml.package) name version;
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
buildFeatures = features;
buildInputs = runtimeDeps;
nativeBuildInputs = buildDeps;
# Uncomment if your cargo tests require networking or otherwise
# don't play nicely with the Nix build sandbox:
# doCheck = false;
};

mkDevShell = rustc:
pkgs.mkShell {
shellHook = ''
export RUST_SRC_PATH=${pkgs.rustPlatform.rustLibSrc}
'';
buildInputs = runtimeDeps;
nativeBuildInputs = buildDeps ++ devDeps ++ [ rustc ];
};
in {
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ (import inputs.rust-overlay) ];
};

packages.default = self'.packages.cli;
devShells.default = self'.devShells.nightly;

devShells.nightly = (mkDevShell (pkgs.rust-bin.selectLatestNightlyWith
(toolchain: toolchain.default)));
devShells.stable = (mkDevShell pkgs.rust-bin.stable.latest.default);
devShells.msrv = (mkDevShell pkgs.rust-bin.stable.${msrv}.default);
};
};
}
Loading