refactor: update dotfiles paths and remove obsolete configurations
Some checks failed
Nix Format Check / check-format (push) Failing after 40s
Some checks failed
Nix Format Check / check-format (push) Failing after 40s
This commit is contained in:
19
setup.sh
19
setup.sh
@ -6,7 +6,7 @@ IFS=$'\n\t'
|
||||
# Constants
|
||||
readonly NIXOS_RELEASE="24.11" # Home Manager release version (Must match NixOS version)
|
||||
readonly GIT_REPO="https://git.mvl.sh/vleeuwenmenno/dotfiles.git" # Dotfiles repository URL
|
||||
readonly DOTFILES_DIR="${HOME}/dotfiles" # Dotfiles directory
|
||||
readonly DOTFILES_PATH="${HOME}/.dotfiles" # Dotfiles directory
|
||||
readonly SETUP_MARKER="${HOME}/.dotfiles-setup" # Setup marker file indicates setup has been run
|
||||
|
||||
# Color constants
|
||||
@ -84,7 +84,7 @@ validate_hostname() {
|
||||
update_home_manager_flake() {
|
||||
local hostname="$1"
|
||||
local isServer="$2"
|
||||
local flake_file="$DOTFILES_DIR/config/home-manager/flake.nix"
|
||||
local flake_file="$DOTFILES_PATH/config/home-manager/flake.nix"
|
||||
|
||||
# Create new configuration entry
|
||||
local new_config=" \"$hostname\" = home-manager.lib.homeManagerConfiguration {
|
||||
@ -157,8 +157,8 @@ setup_symlinks() {
|
||||
die "Failed to backup home-manager config"
|
||||
fi
|
||||
|
||||
log_info "Linking ~/.config/home-manager to $DOTFILES_DIR/config/home-manager..."
|
||||
ln -s "$DOTFILES_DIR/config/home-manager" "$HOME/.config/home-manager" || \
|
||||
log_info "Linking ~/.config/home-manager to $DOTFILES_PATH/config/home-manager..."
|
||||
ln -s "$DOTFILES_PATH/config/home-manager" "$HOME/.config/home-manager" || \
|
||||
die "Failed to create home-manager symlink"
|
||||
|
||||
# Verify symlinks
|
||||
@ -351,9 +351,9 @@ main() {
|
||||
check_prerequisites
|
||||
|
||||
# Clone dotfiles if needed
|
||||
if [ ! -d "$DOTFILES_DIR" ]; then
|
||||
if [ ! -d "$DOTFILES_PATH" ]; then
|
||||
log_info "Cloning dotfiles repo..."
|
||||
git clone "$GIT_REPO" "$DOTFILES_DIR" || die "Failed to clone dotfiles repository"
|
||||
git clone "$GIT_REPO" "$DOTFILES_PATH" || die "Failed to clone dotfiles repository"
|
||||
fi
|
||||
|
||||
if [ -n "${1:-}" ]; then
|
||||
@ -382,7 +382,12 @@ main() {
|
||||
# Get hostname
|
||||
local hostname
|
||||
hostname=$(cat "$HOME/.hostname") || die "Failed to read hostname"
|
||||
export PATH=$PATH:$HOME/dotfiles/bin
|
||||
export PATH=$PATH:$DOTFILES_PATH/bin
|
||||
|
||||
# Create new .bashrc with exports for initial `dotf update` command
|
||||
echo "export NIXPKGS_ALLOW_INSECURE=1" >> $HOME/.bashrc
|
||||
echo "export DOTFILES_PATH=$DOTFILES_PATH" >> $HOME/.bashrc
|
||||
echo "export PATH=$PATH:$DOTFILES_PATH/bin" >> $HOME/.bashrc
|
||||
|
||||
# Create setup marker
|
||||
touch "$SETUP_MARKER" || die "Failed to create setup marker"
|
||||
|
Reference in New Issue
Block a user