generated from Patagia/template-nix
Compare commits
1 commit
c06a3b31b2
...
b07d037a7d
Author | SHA1 | Date | |
---|---|---|---|
b07d037a7d |
7 changed files with 29 additions and 45 deletions
17
Cargo.lock
generated
17
Cargo.lock
generated
|
@ -1558,23 +1558,14 @@ version = "0.1.0"
|
|||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
"patagia-client",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"tracing-chrome",
|
||||
"tracing-subscriber",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "patagia-client"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chrono",
|
||||
"progenitor",
|
||||
"reqwest",
|
||||
"schemars",
|
||||
"serde",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"tracing-chrome",
|
||||
"tracing-subscriber",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
@ -2,13 +2,11 @@
|
|||
resolver = "2"
|
||||
members = [
|
||||
"agent",
|
||||
"client",
|
||||
"controller",
|
||||
"xtask",
|
||||
]
|
||||
default-members = [
|
||||
"agent",
|
||||
"client",
|
||||
"controller",
|
||||
"xtask",
|
||||
]
|
||||
|
|
|
@ -7,11 +7,14 @@ license = "MPL-2.0"
|
|||
[dependencies]
|
||||
anyhow.workspace = true
|
||||
clap.workspace = true
|
||||
patagia-client = { path = "../client" }
|
||||
progenitor.workspace = true
|
||||
reqwest.workspace = true
|
||||
schemars.workspace = true
|
||||
serde.workspace = true
|
||||
tokio.workspace = true
|
||||
tracing.workspace = true
|
||||
tracing-chrome.workspace = true
|
||||
tracing-subscriber.workspace = true
|
||||
tracing.workspace = true
|
||||
|
||||
[[bin]]
|
||||
name = "patagia-agent"
|
||||
|
|
|
@ -3,6 +3,8 @@ use clap::Parser;
|
|||
use tokio::time::{sleep, Duration};
|
||||
use tracing_subscriber::prelude::*;
|
||||
|
||||
mod patagia_api;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(version, about, long_about = None)]
|
||||
struct Cli {}
|
||||
|
@ -19,7 +21,7 @@ async fn main() -> Result<()> {
|
|||
|
||||
tracing::info!("Patagia Agent");
|
||||
|
||||
let client = patagia_client::Client::new("http://localhost:9474");
|
||||
let client = patagia_api::Client::new("http://localhost:9474");
|
||||
let result = client.version().await?;
|
||||
tracing::info!("Result: {:?}", result);
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
use progenitor::generate_api;
|
||||
|
||||
|
||||
generate_api!(spec = "../api.json", derives = [schemars::JsonSchema]);
|
|
@ -1,13 +0,0 @@
|
|||
[package]
|
||||
name = "patagia-client"
|
||||
version = "0.0.1"
|
||||
license = "MPL-2.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
anyhow.workspace = true
|
||||
chrono = { version = "0.4.0", default-features = false, features = ["serde"] }
|
||||
progenitor.workspace = true
|
||||
reqwest.workspace = true
|
||||
schemars.workspace = true
|
||||
serde.workspace = true
|
30
flake.nix
30
flake.nix
|
@ -52,23 +52,14 @@
|
|||
pkg-config
|
||||
];
|
||||
|
||||
sourceAndFixtures = path: type: (craneLib.filterCargoSources path type);
|
||||
jsonFilter = path: _type: builtins.match ".*json$" path != null;
|
||||
sourceAndFixtures = path: type:
|
||||
(jsonFilter path type) || (craneLib.filterCargoSources path type);
|
||||
src = pkgs.lib.cleanSourceWith {
|
||||
src = ./.;
|
||||
filter = sourceAndFixtures;
|
||||
};
|
||||
|
||||
treefmtEval = treefmt-nix.lib.evalModule pkgs {
|
||||
projectRootFile = "flake.nix";
|
||||
programs = {
|
||||
nixfmt.enable = true;
|
||||
nixfmt.package = pkgs.nixfmt-rfc-style;
|
||||
shfmt.enable = true;
|
||||
rustfmt.enable = true;
|
||||
};
|
||||
settings.formatter.rustfmt.command = pkgs.lib.mkForce "${pkgs.rust-toolchain}/bin/rustfmt";
|
||||
};
|
||||
|
||||
commonArgs = {
|
||||
inherit src stdenv nativeBuildInputs;
|
||||
strictDeps = true;
|
||||
|
@ -95,7 +86,6 @@
|
|||
./Cargo.toml
|
||||
./Cargo.lock
|
||||
(craneLib.fileset.commonCargoSources ./agent)
|
||||
(craneLib.fileset.commonCargoSources ./client)
|
||||
(craneLib.fileset.commonCargoSources ./controller)
|
||||
(craneLib.fileset.commonCargoSources ./xtask)
|
||||
(craneLib.fileset.commonCargoSources crate)
|
||||
|
@ -128,6 +118,18 @@
|
|||
src = fileSetForCrate ./xtask;
|
||||
}
|
||||
);
|
||||
|
||||
treefmtEval = treefmt-nix.lib.evalModule pkgs {
|
||||
projectRootFile = "flake.nix";
|
||||
programs = {
|
||||
nixfmt.enable = true;
|
||||
nixfmt.package = pkgs.nixfmt-rfc-style;
|
||||
shfmt.enable = true;
|
||||
rustfmt.enable = true;
|
||||
};
|
||||
settings.formatter.rustfmt.command = pkgs.lib.mkForce "${pkgs.rust-toolchain}/bin/rustfmt";
|
||||
};
|
||||
|
||||
in
|
||||
{
|
||||
# `nix build`
|
||||
|
@ -165,6 +167,7 @@
|
|||
(
|
||||
commonArgs
|
||||
// {
|
||||
inherit cargoArtifacts;
|
||||
src = fileSetForCrate ./xtask;
|
||||
}
|
||||
)
|
||||
|
@ -188,6 +191,7 @@
|
|||
cargo-nextest
|
||||
cargo-watch
|
||||
hyperfine
|
||||
openssl
|
||||
just
|
||||
rust-dev-toolchain
|
||||
watchexec
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue