narze dotfiles

repository·master·Indexed 41 days ago

https://github.com/narze/dotfiles

A collection of personal dotfiles managed with Chezmoi for macOS and Linux (Debian/Ubuntu). Includes shell configurations for Zsh and Fish, package management via Homebrew and Mise, and specialized profiles for homelabs and AI agents. Features custom utilities such as the murder CLI for process termination, executable_mx for mise environments, and a rubocop-daemon-wrapper.

Tokens
3.3K
Snippets
15
Records
17
Agent score
51%

What's inside narze-dotfiles

  1. Install the dotfiles via remote script

    master

    You can install the dotfiles using a one-line shell command. Using the ASK=1 environment variable allows you to customize your name during the first installation. If you omit ASK=1, the script will use the maintainer's names for the machine configuration.

    Note that the first installation will skip encrypted files; you must retrieve your GPG private key manually later. Because the script may not complete fully on the first pass, you should run chezmoi -k apply repeatedly until the setup is complete.

    ASK=1 sh -c "$(curl -fsSL https://raw.githubusercontent.com/narze/dotfiles/master/remote_install.sh) -k -v"
  2. Apply custom UI modifications to Vivaldi

    master

    To apply custom CSS modifications to the Vivaldi browser interface, follow these steps:

    1. Place your custom .css files into the ./custom_ui_modifications directory within the dotfiles repository.
    2. Enable CSS styling in Vivaldi by navigating to vivaldi://experiments in the address bar and enabling the option to allow using Styles.
    3. In Vivaldi's settings, locate the Custom UI Modifications folder setting and point it to the directory containing your CSS files.
    4. Restart Vivaldi to apply the changes.
    # No runnable code provided; follow manual steps in Vivaldi settings
  3. Setup Kitty on Apple Silicon (M1/M2/M3)

    master

    To ensure you are using the native ARM version of Kitty on Apple Silicon, you may need to build it from source and replace the Homebrew binary:

    1. Get the source: ghq get -l kovidgoyal/kitty
    2. Build using Python: /opt/homebrew/bin/python3 setup.py kitty.app
    3. Move to Applications: cp -r kitty.app /Applications/kitty.app
    4. Replace the CLI link: Remove the Homebrew version and symlink the new launcher.
    ghq get -l kovidgoyal/kitty
    /opt/homebrew/bin/python3 setup.py kitty.app
    cp -r kitty.app /Applications/kitty.app
    
    # Replace CLI
    rm /opt/homebrew/bin/kitty
    ln -s $PWD/kitty/launcher/kitty /opt/homebrew/bin/kitty
  4. Manage dotfiles with Chezmoi

    master

    The dotfiles are managed using Chezmoi. Use the following commands to manage your configuration:

    • Initialize/Customize: Use ASK=1 chezmoi init to change variables or chezmoi edit-config to edit the configuration.
    • Apply changes: To change data or scripts, run chezmoi cd to enter the chezmoi directory, edit the files, and then run chezmoi apply.
    • Set encryption password: Run SETPASS=1 chezmoi init to set your encryption password.
    • Force apply: Use chezmoi apply -k (keep going) to continue applying even if some errors occur.
    # Change variables
    ASK=1 chezmoi init
    
    # Edit config
    chezmoi edit-config
    
    # Apply changes after editing files in chezmoi directory
    chezmoi cd
    # ... edit files ...
    chezmoi apply
  5. Configure dual Homebrew installation for Apple Silicon

    master

    To support both arm64 and x86_64 packages on Apple Silicon, install both versions of Homebrew and add the following logic to your .zshrc to ensure the correct brew is in your PATH based on the architecture:

    1. Install arm64 brew: arch -arm64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    2. Install x86_64 brew: arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    3. Add the architecture detection logic to your shell config.
    # Install both versions
    arch -arm64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
    # .zshrc logic
    if [ "$(uname -m)" == "arm64" ]; then
      if [ -f /opt/homebrew/bin/brew ]; then
        export PATH="/usr/local/bin${PATH+:$PATH}";
        eval $(/opt/homebrew/bin/brew shellenv)
      fi
    else
      if [ -f /usr/local/bin/brew ]; then
        export PATH="/opt/homebrew/bin${PATH+:$PATH}";
        eval $(/usr/local/bin/brew shellenv)
      fi
    fi
  6. Configure Debian setup profiles

    master

    On Debian, chezmoi init prompts you to select a setup profile. This profile is stored in your configuration and can be changed by re-running chezmoi init.

    Available profiles:

    • minimal (default): Installs base essentials (apt packages: zsh, git, curl, unzip) and mise.
    • homelab, ai-agent, etc.: These run on top of the minimal base.

    Adding a new profile: Create a new folder within the profile directory. .chezmoiignore automatically discovers these folders and runs only the active one. Scripts are located in:

    • .chezmoiscripts/debian/ for run-once installs.
    • scripts/linux-debian/<profile>/ for optional per-apply scripts.
  7. Configure rubocop-daemon-wrapper via environment variables

    master

    You can influence how the wrapper executes the underlying rubocop-daemon using the following environment variables:

    VariableDescription
    RUBOCOP_DAEMON_USE_BUNDLERIf set to any non-empty value, the wrapper will prefix the command with bundle exec

    Note: The script also detects asdf automatically and will use asdf exec if available.

  8. Use Makefile commands for dotfiles management

    master

    The repository includes a Makefile with the following commands:

    • make help: Print the command list.
    • make dotfiles: Update dotfiles.
    • make apply: Run chezmoi apply.
    • make macos: Run the macOS specific setup script.
    $ make
    help                           Print command list
    dotfiles                       Update dotfiles
    apply                          Run chezmoi apply
    macos                          Run macos script
  9. Reference: murder CLI usage modes

    master

    The murder command accepts a single argument to determine the target type. Use the following patterns:

    Argument PatternTarget TypeDescription
    [PID] (e.g., 123)PIDTerminates the process with the specified Process ID.
    [name] (e.g., ruby)Process NameSearches for processes matching the name (case-insensitive, whole word) and prompts to kill each.
    :[port] (e.g., :3000)PortUses lsof to find the process listening on the specified port and prompts to kill it.
    usage:
    murder 123    # kill by pid
    murder ruby   # kill by process name
    murder :3000  # kill by port