Skip to content

Nix flake #1933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ working_dir/
*.log
venv/
**/tmp
result*
.direnv/

# Deployment assets
crates/walrus-orchestrator/assets/
Expand Down
12 changes: 8 additions & 4 deletions crates/walrus-sdk/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,23 @@ pub use self::{
/// Returns the default paths for the Walrus configuration file.
pub fn default_configuration_paths() -> Vec<PathBuf> {
const WALRUS_CONFIG_FILE_NAMES: [&str; 2] = ["client_config.yaml", "client_config.yml"];
let mut rv = Vec::new();
let mut directories = vec![PathBuf::from(".")];
if let Ok(xdg_config_dir) = std::env::var("XDG_CONFIG_HOME") {
if let Ok(xdg_config_dir) = env::var("XDG_CONFIG_HOME") {
directories.push(xdg_config_dir.into());
}
if let Some(home_dir) = home::home_dir() {
directories.push(home_dir.join(".config").join("walrus"));
directories.push(home_dir.join(".walrus"));
}
directories
rv.extend(directories
.into_iter()
.cartesian_product(WALRUS_CONFIG_FILE_NAMES)
.map(|(directory, file_name)| directory.join(file_name))
.collect()
.map(|(directory, file_name)| directory.join(file_name)));
if let Ok(wal_config) = env::var("WALRUS_CONFIG") {
rv.push(PathBuf::from(wal_config));
}
rv
}

/// Loads the Walrus configuration from the given path and context.
Expand Down
1 change: 1 addition & 0 deletions crates/walrus-service/src/client/cli/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ pub struct App {
/// 2. If the environment variable `XDG_CONFIG_HOME` is set, in `$XDG_CONFIG_HOME/walrus/`.
/// 3. In `~/.config/walrus/`.
/// 4. In `~/.walrus/`.
/// 5. The environment variable `WALRUS_CONFIG` as complete path
// NB: Keep this in sync with `crate::cli`.
#[arg(long, verbatim_doc_comment, global = true)]
#[serde(
Expand Down
100 changes: 100 additions & 0 deletions flake.lock

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

Loading