Skip to content

Commit

Permalink
refactor: swicth from dotdrop to chezmoi
Browse files Browse the repository at this point in the history
  • Loading branch information
Its-Alex committed Mar 11, 2024
1 parent fe1b6ea commit f19a8c6
Show file tree
Hide file tree
Showing 40 changed files with 61 additions and 449 deletions.
4 changes: 4 additions & 0 deletions .chezmoiignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.envrc
README.md
archlinux-gnome-install.sh
mise.toml
22 changes: 22 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

BITWARDEN_SESSION_FILE_PATH=/tmp/bitwarden-session

# Check if bw cli is installed
if [[ -x "$(command -v bw)" ]]; then
if [[ -a $BITWARDEN_SESSION_FILE_PATH ]]; then
BW_SESSION=$(cat $BITWARDEN_SESSION_FILE_PATH)
export BW_SESSION
fi
# Login to bitwarden if not logged
if [[ "$(bw status | jq -r .status)" == "unauthenticated" ]]; then
BW_SESSION=$(bw login | grep "export BW_SESSION" | cut -d "=" -f 2- | sed 's/"//g')
echo "$BW_SESSION" > $BITWARDEN_SESSION_FILE_PATH
export BW_SESSION
# Unlock bitwarden if locked
elif [[ "$(bw status | jq -r .status)" == "locked" ]]; then
BW_SESSION=$(bw unlock | grep "export BW_SESSION" | cut -d "=" -f 2- | sed 's/"//g')
echo "$BW_SESSION" > $BITWARDEN_SESSION_FILE_PATH
export BW_SESSION
fi
fi
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

3 changes: 2 additions & 1 deletion .mise.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[tools]
python = {version="3.11", virtualenv=".venv"}
direnv = '2.34.0'
bitwarden = '2024.2.1'
File renamed without changes
File renamed without changes
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This repo contains all my configuration.

## Requirements

- [`chezmoi`](https://github.com/twpayne/chezmoi)
- [`mise`](https://github.com/jdx/mise)

## Install
Expand All @@ -12,14 +13,11 @@ First you must allow direnv environment:

```sh
$ mise install
$ direnv allow
```

Then install dependencies:

```sh
$ pip install --upgrade pip
$ pip install -r dotdrop/requirements.txt
```
You will be asked to prompt your bitwarden email and password, this is for
files that can contain secrets.

## Linux

Expand Down
92 changes: 0 additions & 92 deletions config.yaml

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions dotfiles/tmux.conf → dot_tmux.conf.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{%@@ if profile == "macos" @@%}
set-option -g default-shell /opt/homebrew/bin/zsh
{%@@ elif profile == "linux-gnome" @@%}
set-option -g default-shell /usr/bin/zsh
{%@@ endif @@%}

# Define terminal option
set -as terminal-overrides ",alacritty*:Tc,xterm-256color:Tc"
Expand Down
14 changes: 7 additions & 7 deletions dotfiles/zshrc → dot_zshrc.tmpl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env bash

{%@@ if profile == "macos" @@%}
{{ if eq .chezmoi.os "darwin" -}}
eval "$(/opt/homebrew/bin/brew shellenv)"

{%@@ endif @@%}
{{ end -}}
# Environment variable
# Path
export PATH=/usr/local/bin:$PATH
Expand All @@ -15,7 +15,7 @@ export GOPATH=$HOME/go
export PATH=$PATH:$HOME/go/bin
# mise IDE Integration https://mise.jdx.dev/ide-integration.html#ide-integration
export PATH="$HOME/.local/share/mise/shims:$PATH"
# Gpg
# Gpg
GPG_TTY=$(tty)
export GPG_TTY

Expand Down Expand Up @@ -51,21 +51,21 @@ fi
export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
export EDITOR='vim'
export EDITOR='nvim'

{%@@ if profile == "macos" @@%}
{{ if eq .chezmoi.os "darwin" -}}
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
export ANDROID_SDK_ROOT="/usr/local/share/android-sdk"
export PATH=$ANDROID_SDK_ROOT:$PATH
export HOMEBREW_INSTALL_CLEANUP=1

alias ls="ls --color=auto"
{%@@ elif profile == "linux-gnome" @@%}
{{ else if eq .chezmoi.os "linux" -}}
# Python environment
export PATH=$PATH:/home/alex/.local/bin

# Android SDK
export ANDROID_SDK_ROOT=/opt/android-sdk
export PATH="${ANDROID_SDK_ROOT}/platform-tools:$PATH"
export PATH="${ANDROID_SDK_ROOT}/tools:$PATH"
{%@@ endif @@%}
{{ end -}}
1 change: 0 additions & 1 deletion dotdrop
Submodule dotdrop deleted from 5df2e1
44 changes: 0 additions & 44 deletions dotdrop.sh

This file was deleted.

4 changes: 0 additions & 4 deletions dotfiles/config/direnv/lib/use_mise.sh

This file was deleted.

1 change: 0 additions & 1 deletion dotfiles/config/mise/settings.toml

This file was deleted.

15 changes: 0 additions & 15 deletions dotfiles/config/nvim/init.lua

This file was deleted.

18 changes: 0 additions & 18 deletions dotfiles/config/nvim/lazy-lock.json

This file was deleted.

9 changes: 0 additions & 9 deletions dotfiles/config/nvim/lazyvim.json

This file was deleted.

24 changes: 0 additions & 24 deletions dotfiles/config/nvim/lua/plugins/colorscheme.lua

This file was deleted.

11 changes: 0 additions & 11 deletions dotfiles/config/nvim/lua/plugins/filetree.lua

This file was deleted.

9 changes: 0 additions & 9 deletions dotfiles/config/nvim/lua/plugins/git.lua

This file was deleted.

Loading

0 comments on commit f19a8c6

Please sign in to comment.