The main goal of this project is to help developers to focus on delivering value instead of struggling with the workstation configuration.
The solution provided is a composed of :
- one-liner installer script that will fully configure a workstation for mobile and web development.
- a cli tool named "laptop" to help workstation maintenance event after the script was installed
- an extended bash function collection to be able to create other configuration profile than the one on this repository
Its core values are :
- 🤖 Automated : provide all required tools with almost no manual action
- ✅ Safe : multiple runs should always work
- 🧑🏫 Opiniated yet Customizable : some configurations might not suit everybody, but for most people it will provide a great working experience. When possible, provide a simple way to customize/override setup
Available profiles :
-
Open a terminal ( How to )
-
Run the installation command :
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/jpolo/laptop/main/install.sh)"
Platform supported :
- ✓ macOS
- ✓ Debian like distros (Ubuntu, Debian)
- devcontainers (i.e. Docker) supported
Package Manager supported :
The laptop ZSH plugin provides a laptop
executable. This executable was created to make easier the maintenance of your laptop by providing a simple way to :
- update all tools and dependencies, to avoid security issues and benefit from latest bug fixes
- remove all unneeded files and free disk space
- auto-update itself. laptop can be updated itself to benefit to the latest tools / configuration of the organization
- Built to be easily forked (better for security, so everyone can review the code)
- Many bash functions for your needs in
./src/functions
- Multiple configuration profile is possible
laptop
aims to give a common full feature basis for each laptop machine.
Although there are some implementation tradeoffs, it should never limit developers to customize their workstation.
🔧 Override/Customize ZSH configuration
.zshrc
because any changes will be lost when laptop
script is run.
Here is the order of profile loading :
- 🔒 $XDG_DATA_HOME/zsh/global.{sh,zsh}
: default settings (always overwritten by laptop
)
- 🔒 $XDG_DATA_HOME/zsh/organization.{sh,zsh}
: organization settings (always overwritten by laptop
)
- ✍️ $XDG_DATA_HOME/zsh/personal.{sh,zsh}
: custom personal settings
- ✍️ .zshrc.local
: For local override (that should not be synched between devices)
Instead, configuration can be overridden in the following files () :
- .zshrc.local
: For local override (that should not be synched between devices)
- $XDG_DATA_HOME/zsh/*.sh
: For generic overrides (zsh plugins, etc). Files are included in alphabetic order, so as a convention each file starts with two digits.
Example $XDG_DATA_HOME/zsh/20_personal.sh
:
# Load OhMyZSH ruby plugin
zinit snippet OMZP::ruby
# Load OhMyZSH rails plugin
zinit snippet OMZP::rails
🎨 Customize ZSH Theme
> p10k configure
- Fork this repository
- Copy
profile/default/profile.sh
toprofile/{{my-company-profile}}/profile.sh
- Customize
profile/{{my-company-profile}}
(Avoid changingprofile/default
)- Modify
profile/{{my-company-profile}}/profile.sh
to fit your needs - Put any resources / template in this folder
- Modify
- Customize the installer script
install.sh
- Update the
README.md
installation instructions
Laptop CLI has 3 subcommands configure
, upgrade
and cleanup
More information is available with the command laptop help
.
Try to install all software from the current profile (that was configured at first installation).
Detect many tools (brew
, asdf
, etc) and launch their respective update command.
This will also update the laptop plugin and executable itself.
Launch this command regularly to be up to date and avoir keeping old software with potential security vulnerabilities.
Detect many tools (brew
, asdf
, etc) and try to free disk space (in a "safe" manner) :
- Remove cache
- Prune unused data
NPM, docker, mobile development can be quite greedy on disk space. Launch this command regularly to avoid to be out of free disk space.
Original repository is hosted at https://github.com/jpolo
Contributions are welcome especially when :
- adding documentation to the laptop shell library
./src/functions
- adding new capabilities / support for the tool
- reporting / fixing security issues
If you like this repository and it made you win a lot of time / money (by not hiring a devops for example :) ), you may consider a small donation to help me maintaining this repository Link to my profile.