Skip to content

Instantly share code, notes, and snippets.

@aldoborrero
Created May 11, 2024 10:07
Show Gist options
  • Save aldoborrero/ff3995de46cbb1c67e229e029cc47821 to your computer and use it in GitHub Desktop.
Save aldoborrero/ff3995de46cbb1c67e229e029cc47821 to your computer and use it in GitHub Desktop.
# Function to ensure a dir exists
ensure_directory_exists() {
local dir="${1}"
if [ ! -d "${dir}" ]; then
mkdir -p "${dir}"
fi
}
# Function to use nix flakes if exists
use_flake_if_nix_installed() {
if command -v nix >/dev/null 2>&1; then
# Nix is installed, proceed to use flake
use flake
else
echo "Nix is not installed, skipping flake configuration."
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment