Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tsirysndr/envhub
Manage your dotfiles, secrets and packages with ease. Define your $HOME as Code and re-use it everywhere (local machine, CI, server ...) 💻 🚀 ✨
https://github.com/tsirysndr/envhub
devbox devenv dotfiles dotfiles-linux dotfiles-macos environment gnu-stow home-manager homebrew linux macos nix packages pkgx wsl
Last synced: 6 days ago
JSON representation
Manage your dotfiles, secrets and packages with ease. Define your $HOME as Code and re-use it everywhere (local machine, CI, server ...) 💻 🚀 ✨
- Host: GitHub
- URL: https://github.com/tsirysndr/envhub
- Owner: tsirysndr
- License: mpl-2.0
- Created: 2023-10-07T03:31:52.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-07T14:55:22.000Z (4 months ago)
- Last Synced: 2024-12-07T21:44:42.412Z (15 days ago)
- Topics: devbox, devenv, dotfiles, dotfiles-linux, dotfiles-macos, environment, gnu-stow, home-manager, homebrew, linux, macos, nix, packages, pkgx, wsl
- Language: TypeScript
- Homepage:
- Size: 18.8 MB
- Stars: 33
- Watchers: 1
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[![FlakeHub](https://img.shields.io/endpoint?url=https://flakehub.com/f/tsirysndr/envhub/badge)](https://flakehub.com/flake/tsirysndr/envhub)
[![built with nix](https://img.shields.io/badge/Built_With-Nix-5277C3.svg?logo=nixos&labelColor=73C3D5)](https://builtwithnix.org)
[![flakestry.dev](https://flakestry.dev/api/badge/flake/github/tsirysndr/envhub)](https://flakestry.dev/flake/github/tsirysndr/envhub)
[![crates](https://img.shields.io/crates/v/envhub.svg)](https://crates.io/crates/envhub)
[![downloads](https://img.shields.io/crates/dr/envhub)](https://crates.io/crates/envhub)
[![ci](https://github.com/tsirysndr/envhub/actions/workflows/ci.yml/badge.svg)](https://github.com/tsirysndr/envhub/actions/workflows/ci.yml)
[![discord](https://img.shields.io/discord/1160636024167333979?label=discord&logo=discord&color=5865F2)](https://discord.gg/aTGPE3Myhk)EnvHub is a simple tool to manage dotfiles and packages accross multiple machines.
Written in [Rust](https://www.rust-lang.org/), internally it uses [nix](https://nixos.org)/[homebrew](https://brew.sh)/[pkgx](https://pkgx.sh)/[devbox](https://www.jetpack.io/devbox) to manage packages and [home-manager](https://nix-community.github.io/home-manager/)/[stow](https://www.gnu.org/software/stow/) to manage dotfiles.
![Made with VHS](https://vhs.charm.sh/vhs-3jvaLIJUoMP67jfuoCMuex.gif)
## 🚚 Installation
Using bash :
```bash
curl -sSL https://install.envhub.sh | bash
```Using [Cargo](https://crates.io) :
```bash
cargo install envhub
```Using [Nix](https://nixos.org) :
```bash
cachix use tsirysndr
nix profile install --experimental-features "nix-command flakes" github:tsirysndr/envhub
```Compile from source :
```bash
git clone https://github.com/tsirysndr/envhub.git
cd envhub
nix develop --experimental-features "nix-command flakes"
cargo install --path crates/cli
envhub --help
```Using [Homebrew](https://brew.sh) :
```bash
brew install tsirysndr/tap/envhub
```Or download the latest release for your platform [here](https://github.com/tsirysndr/envhub/releases).
## 🚀 Quick Start
Initialize a new environment :
```sh
envhub init
```It will create a new `envhub.hcl` file and a `dotfiles` directory in the current directory.
You can then edit the `envhub.hcl` file to add packages and add dotfiles to the `dotfiles` directory.
Enable the environment :
```sh
envhub use
```## 📚 Example
The following example will install the `hello` package, set the `EDITOR` environment variable to `vim`, and copy the `.screenrc` and `gradle.properties` files from the current directory to the home directory.
```hcl
# Path: envhub.hcl
packages = [
"hello"
]envs {
"EDITOR" = "vim"
}file ".screenrc" {
source = ".screenrc"
}file ".gradle/gradle.properties" {
content = "org.gradle.daemon=true"
}
```See [demo](demo) and [examples](examples) for a more complete example.
## 🧩 As a Dagger Module
Call from the command line:
```bash
dagger -m github.com/tsirysndr/daggerverse/envhub call \
use --environment github:tsirysndr/dotfiles-example \
--src .
```call from a [Fluent CI](https://fluentci.io/) module:
```typescript
import { use } from 'jsr:@fx/envhub';await use(
".",
"github:tsirysndr/dotfiles-example"
);
```## As a GitHub Action
You can use EnvHub as a [GitHub Action](https://github.com/tsirysndr/setup-envhub) to manage your dotfiles and packages in your CI/CD workflow.
```yaml
- uses: tsirysndr/setup-envhub@v1
with:
version: 'v0.2.18'
- run: envhub --help
```