Skip to content

francojc/dotfiles

Repository files navigation

DOTFILES

This repository contains my personal dotfiles for configuring my development environment on macOS.

Note

Before applying the new configurations, it's a good idea to back up your existing dotfiles. You can do this by renaming them or moving them to a backup directory.

Prerequisites

Before restoring the dotfiles, ensure you have the following installed:

  1. Install Xcode Command Line Tools: Open your terminal and run:

    xcode-select --install
  2. Install Homebrew: Run the following command in your terminal:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  3. Install Nix: Use the following command to install Nix using the Determinate Systems installer for macOS (multi-user install):

    curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install

    Check that your installation was successful by running:

    nix --version
  4. Bootstrap nix-darwin: After installing Nix, you can bootstrap nix-darwin by running the following commands:

    mkdir -p ~/.config/nix/
    cd ~/.config/nix/
    nix  flake init -t nix-darwin
    sed -i '' "s/simple/$(scutil --get LocalHostName)/" flake.nix
    nix run nix-darwin --extra-experimental-features "nix-command flakes" -- switch --flake ~/.config/nix

    Check to see that the installation was successful by running:

    type darwin-rebuild

Restoring Dotfiles

  1. Clone the repository:

    git clone --depth 1 https://github.com/francojc/dotfiles.git ~/.dotfiles
  2. Navigate to the dotfiles directory:

    cd ~/.dotfiles
  3. Remove any existing files that may conflict with the configurations:

    rm -rf ~/.zshrc ~/.zshenv ~/.zsh ~/.config/nix
  4. Make sure the flake.nix hostname to match the system hostname:

    To find the hostname, run the following command:

    hostname
  5. Apply the configurations using the full path to the flake's directory:

    NIXPKGS_ALLOW_UNFREE=1 darwin-rebuild switch --flake ~/.dotfiles/.config/nix/#<yourhostname> --impure

    Note: After a successful switch, you will be able to use the alias switch to apply the configurations in the future.

  6. Use stow to symlink the configurations:

    cd ~/.dotfiles
    stow .

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published