diff --git a/Cargo.lock b/Cargo.lock index 85220c5b..c7c12087 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2988,7 +2988,6 @@ dependencies = [ "futures", "glob", "globset", - "home", "ignore", "indexmap", "is_elevated", diff --git a/Cargo.toml b/Cargo.toml index 9e360e78..fc1477b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,6 @@ edition = "2021" readme = "README.md" [dependencies] -home = "=0.5.11" etcetera = "=0.10.0" serde = { version = "~1.0", features = ["derive"] } toml = { version = "=0.9.8", features = ["preserve_order"] } diff --git a/src/main.rs b/src/main.rs index 99559f56..ba457aae 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,7 @@ #![allow(clippy::cognitive_complexity)] use std::env; +use std::env::home_dir; use std::io; use std::path::PathBuf; use std::process::exit; @@ -48,7 +49,7 @@ mod sudo; mod terminal; mod utils; -pub(crate) static HOME_DIR: LazyLock = LazyLock::new(|| home::home_dir().expect("No home directory")); +pub(crate) static HOME_DIR: LazyLock = LazyLock::new(|| home_dir().expect("No home directory")); #[cfg(unix)] pub(crate) static XDG_DIRS: LazyLock = LazyLock::new(|| Xdg::new().expect("No home directory")); diff --git a/src/steps/os/unix.rs b/src/steps/os/unix.rs index 175f4d06..d48dc654 100644 --- a/src/steps/os/unix.rs +++ b/src/steps/os/unix.rs @@ -2,13 +2,13 @@ use color_eyre::eyre::Context; use color_eyre::eyre::Result; use color_eyre::eyre::{eyre, OptionExt}; use etcetera::BaseStrategy; -use home; use ini::Ini; #[cfg(target_os = "linux")] use nix::unistd::Uid; use regex::Regex; use rust_i18n::t; use semver::Version; +use std::env::home_dir; use std::ffi::OsStr; use std::io::Write; use std::os::unix::fs::MetadataExt; @@ -526,8 +526,8 @@ pub fn run_nix(ctx: &ExecutionContext) -> Result<()> { let nix = require("nix")?; let nix_channel = require("nix-channel")?; let nix_env = require("nix-env")?; - // TODO: Is None possible here? - let profile_path = match home::home_dir() { + // TODO: Is None possible here? Should we use HOME_DIR instead? + let profile_path = match home_dir() { Some(home) => XDG_DIRS .state_dir() .map(|d| d.join("nix/profile"))