🚿 Hydrate your development environment with ease.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Niklas Rosenstein ce85650730
fix: DynaFS.open() now computes the full path correctly
3 months ago
.changelog fix: `commands` hydrator now evaluates Bash-style variable references in DynaFS source file names 3 months ago
src/hydrator fix: DynaFS.open() now computes the full path correctly 3 months ago
.gitignore Rebuild dotconfig 3 months ago
README.md update README.md 3 months ago
package.yaml (hydrator) bump version to 0.2.0 3 months ago
setup.py feature: implement configuration "extending" via the `extends` key 3 months ago

README.md

Hydrator

Hydrate your development environment from a YAML configuration file.

Synopsis

Usage: hydrator [OPTIONS] COMMAND [ARGS]...

  Hydrate your development environment.

  Without arguments, all hydrators will be run.

Options:
  -c, --config path  The config file to load. Defaults to "hydrator.yml"
  -v, --verbose
  --dry              Do not commit changes to disk.
  --select TEXT      Select a subset of hydrators to run (comma separated).
  --help             Show this message and exit.

Commands:
  auth-status  Check the filesystem authentication status.
  login        Authenticate for a filesystem.
  logout       Revoke existing credentials for a filesystem.

Features

  • YAML-configuration for Bash profile and Git config.
  • Do not repeat yourself: Layer multiple YAML configurations for multiple environments.
  • Execute shell commands with access to external file systems (e.g. Nextcloud).

Roadmap

Example

In a Git repository, create a file called hydrator.yml. In that file you can configure files that will be produced from the YAML configuration or from external sources. External sources are "file systems" that can be configured in the same file.

filesystems:
  nextcloud: {type: nextcloud, server-url: https://my-cloud.example.org}

hydrators:
  gpg:
    type: commands
    commands:
    - gpg --import [[nextcloud://dotfiles/gpgp/master.key]]

  ssh:
    type: commands
    commands:
    - cp nextcloud://dotfiles/ssh/ida_rsa{,.pub} ~./ssh
    - chmod 600 ~/.ssh/id_rsa{,.pub}

  bash_profile:
    type: bash_profile
    aliases:
      ll: ls -l
    path:
    - ~/.local/bin

In order to access files your Nextcloud, Hydrator first needs to authenticate.

$ hydrator login nextcloud

Then you simply run Hydrator to execute all steps. You can select a subset of hydrators using the --select h1,h2,... option. Add --dry to not commit changes to disk, and -v,--verbose or more logs.

$ hydrator

Layering

You can have multiple YAML configuration files, where one extends the other by adding or overwriting keys. This is useful to customize a basic configuration for another environment.

extends: ./base.yml
hydrators:
  gpg: '{{exclude}}'
  gitconfig:
    Personal.user: '{{user}}'
    user:
      email: work@email.com
      signingkey: DEADBEEF

Copyright 2020 © Niklas Rosenstein