Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installing custom .dotfiles #34

Open
Mehdi-YC opened this issue Apr 17, 2023 · 2 comments
Open

installing custom .dotfiles #34

Mehdi-YC opened this issue Apr 17, 2023 · 2 comments

Comments

@Mehdi-YC
Copy link

well , i think it's more complicated to explain,
do we have a solution to put our dotfiles inside to toolbox in creation ?
i use it generally with distrobox and i change my homedir for each container
but i always have a scipt that i run after i start my container to get my dotfiles

and i don't see any obvious solution to have my dotfiles outof the box in the creation , does anyone have an idea ?

@dvogeldev
Copy link

This should help you get started. Included in Boxkit is the program Chemoi. This is a dot file manager second to none. Using it, you commit your files/changes to git and apply to any and all of your machines. https://www.chezmoi.io/

Now the biggest question is whether you can automate the updating your dots automatically with the container recipe. Someone else will need to chime in on that.

hope this helps

@Mehdi-YC
Copy link
Author

well i managed to do something good i guess , i generally create db_ folder in my home dir and set it as the distrobox home dir , and i have now all my ditfiles in a repo and managed with stow ,

i created a script to clone the repo inside the homedir and stow the .dotfiles
then i copied the script into a permanent location when building the container ,
and i create my distrobox now with this function

dbox () { 
    if [ -d "$HOME/db_$1" ];then
        echo "Distrobox already exists $1 entering $1 ..."
        distrobox enter $1
    else 
        distrobox create -H $HOME/db_$1 $1 -i localhost/db_alpine
        distrobox enter $1 -- set_config
        distrobox enter $1
    fi
}

so now , typing dbox test will create db_test in my home dir and enter it launching the set_config script with this line
distrobox enter $1 -- set_config
and if it exists it enters it

here is my set config script

#!/bin/bash

#get my latest config
cd && git clone https://github.com/mehdi-yc/postinstall
stow -vRd "postinstall/distrobox_builder/" -t $HOME config
cp .bashrc .bash_profile
#pip install howdoi
if [ -x "$(command -v dnf)" ]; then
    sudo dnf copr enable atim/starship -y
    sudo dnf copr enable atim/nushell -y
    sudo dnf install starship nushell -y
fi

you can check my dotfiles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants