generated from pure_sagacity/rust-starter
added gitignore for result for nix
tried to build the nix fixed it as well
This commit is contained in:
@@ -5,6 +5,9 @@
|
|||||||
devenv.local.nix
|
devenv.local.nix
|
||||||
devenv.local.yaml
|
devenv.local.yaml
|
||||||
|
|
||||||
|
# Nix
|
||||||
|
result
|
||||||
|
|
||||||
# direnv
|
# direnv
|
||||||
.direnv
|
.direnv
|
||||||
|
|
||||||
|
|||||||
Generated
-21
@@ -442,7 +442,6 @@ dependencies = [
|
|||||||
"crypto",
|
"crypto",
|
||||||
"diesel",
|
"diesel",
|
||||||
"dotenvy",
|
"dotenvy",
|
||||||
"git-version",
|
|
||||||
"hex",
|
"hex",
|
||||||
"keyring",
|
"keyring",
|
||||||
"tokio",
|
"tokio",
|
||||||
@@ -853,26 +852,6 @@ dependencies = [
|
|||||||
"rand_core",
|
"rand_core",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "git-version"
|
|
||||||
version = "0.3.9"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "1ad568aa3db0fcbc81f2f116137f263d7304f512a1209b35b85150d3ef88ad19"
|
|
||||||
dependencies = [
|
|
||||||
"git-version-macro",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "git-version-macro"
|
|
||||||
version = "0.3.9"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hashbrown"
|
name = "hashbrown"
|
||||||
version = "0.16.1"
|
version = "0.16.1"
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ diesel = { version = "2.2.0", features = [
|
|||||||
clap = { version = "4.6.1", features = ["derive", "cargo"] }
|
clap = { version = "4.6.1", features = ["derive", "cargo"] }
|
||||||
tokio = { version = "1.52.3", features = ["full"] }
|
tokio = { version = "1.52.3", features = ["full"] }
|
||||||
crypto = { path = "../crypto" }
|
crypto = { path = "../crypto" }
|
||||||
git-version = "0.3"
|
|
||||||
keyring = "4.1.4"
|
keyring = "4.1.4"
|
||||||
colored = "3.1.1"
|
colored = "3.1.1"
|
||||||
chrono = "0.4.45"
|
chrono = "0.4.45"
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
use std::process::Command;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let git_version = if let Ok(v) = std::env::var("CARGO_ENV_GIT_VERSION") {
|
||||||
|
v
|
||||||
|
} else {
|
||||||
|
Command::new("git")
|
||||||
|
.args(["describe", "--always", "--dirty"])
|
||||||
|
.output()
|
||||||
|
.map(|output| String::from_utf8_lossy(&output.stdout).trim().to_string())
|
||||||
|
.unwrap_or_else(|_| "unknown".to_string())
|
||||||
|
};
|
||||||
|
|
||||||
|
println!("cargo:rustc-env=GIT_VERSION={}", git_version);
|
||||||
|
|
||||||
|
println!("cargo:rerun-if-changed=.git/HEAD");
|
||||||
|
}
|
||||||
@@ -4,9 +4,8 @@ use clap::Parser;
|
|||||||
use clap::crate_version;
|
use clap::crate_version;
|
||||||
use cli::Cli;
|
use cli::Cli;
|
||||||
use colored::*;
|
use colored::*;
|
||||||
use git_version::git_version;
|
|
||||||
|
|
||||||
const GIT_VERSION: &str = git_version!();
|
const GIT_VERSION: &str = env!("GIT_VERSION");
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let cli = Cli::parse();
|
let cli = Cli::parse();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
description = "an opensource secrets management and distribution platform.";
|
description = "an open source secrets management and distribution platform.";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||||
@@ -55,7 +55,23 @@
|
|||||||
default = naerskLib.buildPackage {
|
default = naerskLib.buildPackage {
|
||||||
name = "harbor";
|
name = "harbor";
|
||||||
version = "0.1.0";
|
version = "0.1.0";
|
||||||
src = ./crates/cli;
|
src = ./.;
|
||||||
|
|
||||||
|
cargoBuildOptions =
|
||||||
|
x:
|
||||||
|
x
|
||||||
|
++ [
|
||||||
|
"-p"
|
||||||
|
"cli"
|
||||||
|
];
|
||||||
|
|
||||||
|
# Cargo automatically forwards any env var starting with CARGO_ENV_ to your build script
|
||||||
|
CARGO_ENV_GIT_VERSION = if (inputs.self ? shortRev) then inputs.self.shortRev else "dirty";
|
||||||
|
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
sqlite
|
||||||
|
git
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user