Giter Club home page Giter Club logo

superb-bootstrap's Introduction

โš ๏ธ This project although convenient, it's too unreliable. Please use Nixpkgs instead.

OS bootstrap-system/dotfiles-manager framework that SuperB

License: GPL-3.0 Development completed

๐Ÿ’ก About

SuperB Bootstrap is a SuperB OS bootstrap-system/dotfiles-manager framework that can be installed with just one command on a new *NIX system installation.

โœจ Features

๐Ÿš€ Setup

First generate using this template, or if you want, you can setup manually:

๐Ÿ”ง Manually

If you manage your dotfiles with git, run the following commands:

mkdir -p ~/dotfiles/home ~/dotfiles/root ~/dotfiles/extra

curl -fsSL https://raw.githubusercontent.com/NNBnh/superb-bootstrap-template/main/packageslist --create-dirs --output ~/dotfiles/packageslist
curl -fsSL https://raw.githubusercontent.com/NNBnh/superb-bootstrap-template/main/setup --create-dirs --output ~/dotfiles/setup

cd ~/dotfiles

git submodule add https://github.com/NNBnh/superb-bootstrap.git ./extra/sbb
git submodule add https://github.com/NNBnh/bsymlink.git ./extra/bsymlink

if not, run the following commands:

mkdir -p ~/dotfiles/home ~/dotfiles/root ~/dotfiles/extra

curl -fsSL https://raw.githubusercontent.com/NNBnh/superb-bootstrap-template/main/packageslist --create-dirs --output ~/dotfiles/packageslist
curl -fsSL https://raw.githubusercontent.com/NNBnh/superb-bootstrap-template/main/setup --create-dirs --output ~/dotfiles/setup

curl -fsSL https://raw.githubusercontent.com/NNBnh/superb-bootstrap/master/sbb --create-dirs --output ~/dotfiles/extra/sbb/sbb
curl -fsSL https://raw.githubusercontent.com/NNBnh/bsymlink/main/bin/bsymlink --create-dirs --output ~/dotfiles/extra/bsymlink/bin/bsymlink

Note: if you don't use Git, you have to manually update SBB and Bsymlink by running the last two commands.

๐Ÿ“ File structure

The file structure will looks like this:

dotfiles/
โ”œโ”€ home/              # Symlink to home (add anything like .config/ or .local/ that you what to bootstrap here)
โ”œโ”€ root/              # Symlink to root (same with this directory but it will be symlink to '/' directory)
โ”œโ”€ extra/             # Other files that you want to backup or store but don't want to symlink
โ”‚  โ”œโ”€ sbb/...         # This contain the script file to bootstrap
โ”‚  โ””โ”€ bsymlink/...    # This contain the symlink tool
โ”œโ”€ packageslist       # Packages list
โ””โ”€ setup              # Setup script

โš™๏ธ Customization

Next, customizing your your dotfiles:

  • Move everything you want to backup in home/ and root/
  • Add packages to packageslist (see example)
  • Config the setup scripts (see example)

Remember to make setup executable:

chmod +x ~/dotfiles/setup

Finally store or upload your dotfiles to a safe place.

๐Ÿ“ฅ Installation

To install your dotfiles, put the dotfiles to the desired location then execute setup file.

For example if you store your dotfiles on Github, first download it:

git clone https://github.com/yourname/dotfiles.git

cd to dotfiles:

cd dotfiles

Then execute the setup file:

./setup

You can install your dotfiles with just one command:

git clone https://github.com/yourname/dotfiles.git && ./dotfiles/setup

๐Ÿ’Œ Credits

Special thanks to:






Made with โค๏ธ by NNB

Buy Me a Coffee

superb-bootstrap's People

Contributors

mikoxyz avatar nnbnh avatar weiss-d avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

superb-bootstrap's Issues

Syntax Error

Whenever I run the setup command I get a syntax error;

./setup: 137: Syntax error: "}" unexpected

[Suggestion] Clone and install paru only if it's not already installed

As I was testing the packages install feature, I noticed that this function was run although I already had paruAUR installed:

superb-bootstrap/setup

Lines 88 to 94 in 1e478bc

superbbootstrap_AUR() {
sudo pacman --sync --refresh --noconfirm --needed git base-devel
git clone 'https://aur.archlinux.org/paru.git' "$TEMPORARY/paru"
cd "$TEMPORARY/paru" || exit 1
makepkg -si
cd "$WD" || exit 1
}


[ "$packagemanager_main" = 'Pacman' ] && packagemanager_list="$packagemanager_list AUR"

What about using something like this instead, so that paruAUR is cloned and installed only if it's not already installed?

if [[ "$packagemanager_main"  = 'Pacman' ]]; then
    if ! command -v "paru" >/dev/null; then
        packagemanager_list="$packagemanager_list AUR"
    fi
        packagemanager_list="$packagemanager_list Flatpak"
fi

[#TODO] Support more package manager

Current state:

superb-bootstrap/sbb

Lines 47 to 77 in ef20588

APK_MARK='APK'; APK_PM='apk' ; APK_COMMAND="$PERMISSION_COMMAND $APT_PM add"
APT_MARK='APT'; APT_PM='apt' ; APT_COMMAND="$PERMISSION_COMMAND $APT_PM install --assume-yes"
DNF_MARK='DNF'; DNF_PM='dnf' ; DNF_COMMAND="$PERMISSION_COMMAND $DNF_PM install --assumeyes"
EOPKG_MARK='EOP'; EOPKG_PM='eopkg' ; EOPKG_COMMAND="$PERMISSION_COMMAND $EOPKG_PM install --yes-all"
Mports_MARK='MPT'; Mports_PM='mports' ; Mports_COMMAND="$PERMISSION_COMMAND $Mports_PM install"
OpenBSD_MARK='OBP'; OpenBSD_PM='pkg_add' ; OpenBSD_COMMAND="$PERMISSION_COMMAND $OpenBSD_PM -I"
Pacman_MARK='PAC'; Pacman_PM='pacman' ; Pacman_COMMAND="$PERMISSION_COMMAND $Pacman_PM --sync --noconfirm --needed"
Portage_MARK='PTG'; Portage_PM='emerge' ; Portage_COMMAND="$PERMISSION_COMMAND $Portage_PM"
PKGIN_MARK='PIN'; PKGIN_PM='pkgin' ; PKGIN_COMMAND="$PERMISSION_COMMAND $PKGIN_PM install -y"
PKGNG_MARK='PNG'; PKGNG_PM='pkg' ; PKGNG_COMMAND="$PERMISSION_COMMAND $PKGNG_PM install -y"
Slackpkg_MARK='SLK'; Slackpkg_PM='slackpkg' ; Slackpkg_COMMAND="$PERMISSION_COMMAND $Slackpkg_PM install"
Termux_MARK='TMP'; Termux_PM='pkg' ; Termux_COMMAND="$Termux_PM install --assume-yes"
URPMI_MARK='URP'; URPMI_PM='urpmi' ; URPMI_COMMAND="$PERMISSION_COMMAND $URPMI_PM --force"
XBPS_MARK='XBP'; XBPS_PM='xbps-install'; XBPS_COMMAND="$PERMISSION_COMMAND $XBPS_PM --yes"
YUM_MARK='YUM'; YUM_PM='yum' ; YUM_COMMAND="$PERMISSION_COMMAND $YUM_PM install --assumeyes"
Zypper_MARK='ZPR'; Zypper_PM='zypper' ; Zypper_COMMAND="$PERMISSION_COMMAND $Zypper_PM --non-interactive install"
AUR_MARK='AUR'; AUR_PM='paru' ; AUR_COMMAND="$AUR_PM --sync --skipreview --useask --noconfirm --needed"
Flatpak_MARK='FLA'; Flatpak_PM='flatpak' ; Flatpak_COMMAND="$PERMISSION_COMMAND $Flatpak_PM install"
Homebrew_MARK='HBR'; Homebrew_PM='brew' ; Homebrew_COMMAND="$Homebrew_PM install"
MacPorts_MARK='MCP'; MacPorts_PM='port' ; MacPorts_COMMAND="$PERMISSION_COMMAND $MacPorts_PM install"
MAS_MARK='MAS'; MAS_PM='mas' ; MAS_COMMAND="$MAS_PM install"
Nix_MARK='NIX'; Nix_PM='nix-env' ; Nix_COMMAND="NIXPKGS_ALLOW_UNFREE='1' $Nix_PM --install --attr"
SBO_MARK='SBO'; SBO_PM='sbopkg' ; SBO_COMMAND="$PERMISSION_COMMAND $SBO_PM -ifq"
Snap_MARK='SNA'; Snap_PM='snap' ; Snap_COMMAND="$PERMISSION_COMMAND $Snap_PM install"
Basher_MARK='BSR'; Basher_PM='sbb_basher' ; Basher_COMMAND="$Basher_PM"
BPKG_MARK='BPK'; BPKG_PM='sbb_bpkg' ; BPKG_COMMAND="$BPKG_PM"
NPM_MARK='NPM'; NPM_PM='npm' ; NPM_COMMAND="$PERMISSION_COMMAND $NPM_PM install --global"
PIP_MARK='PIP'; PIP_PM='pip' ; PIP_COMMAND="$PIP_PM install --user"
Yarn_MARK='YRN'; Yarn_PM='yarn' ; Yarn_COMMAND="$Yarn_PM global add"

#TODO

You can help us by summit:

  • A mark (3 letter)
  • A package manager tool
  • A full command with flags to install packages
  • A setup function
  • NOTE:
    • The less user input needed the better, you should add no-confirm flag like --noconfirm, --non-interactive, --assume-yes, ... to the commands
    • For more Clarity, use full flag instead of short flag (E.g: use --sync over -S)

Example:

Pacman_MARK='PAC'

Pacman_PM='pacman'

Pacman_COMMAND="$PERMISSION_COMMAND $Pacman_PM --sync --noconfirm --needed"

superbbootstrap_Pacman() {
	sudo pacman --sync --sysupgrade --refresh --noconfirm --needed
}

NOTE: $PERMISSION_COMMAND is default to sudo on Linux and doas on BSD

Split setup in two for easier integration of usptream changes

When the upstream setup file changes, integrating those changes can be complicated if you have custom steps. It would be nice to split the file in 2 parts, one functional and one for configuration, and maybe create a helper function for symlink_*.

./setup.sh: line 200: superbbootstrap_batch_symlink: command not found

./setup.sh:

Install packages

Before symlink step

Symlink to home (/home/username)
./setup.sh: line 200: superbbootstrap_batch_symlink: command not found

Symlink to root (/)
[sudo] password for username:
sudo: superbbootstrap_batch_symlink: command not found

After symlink step

superbbootstrap_batch_symlink "$DOTFILES_PATH/home" "$HOME"

I presume there is something wrong with this block?

superb-bootstrap/setup

Lines 126 to 137 in 1e478bc

sh -c 'superbbootstrap_batch_symlink() {
batch_symlink_directory="$1"
batch_symlink_target="$2"
[ -n "$TRASH_PATH" ] && mkdir -p "$TRASH_PATH"
if [ -d "$1" ]; then
superbbootstrap_scan_directory "$batch_symlink_directory"
else
printf "\n\033[1;7;31m%s\033[0m\n" "$batch_symlink_directory not found"
fi
}'

More comprehensive way to install PIP?

Hi everyone!
Turned out this line will not work in recent versions of Ubuntu (and maybe many other distros), because their system's Python doesn't have the ensurepip module. Ubuntu users are forced to install pip by this command: sudo apt-get install python3-pip.

python -m ensurepip --upgrade

The possible solution is to use this script whenever Python says "No module named ensurepip". But it may interfere with the way PIP is meant to be installed by the developers of a particular distro.

What do you say to that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.