https://github.com/patrixr/glue
Machine configuration tool using Go+Lua
https://github.com/patrixr/glue
ansible configuration go golang lua system
Last synced: about 2 months ago
JSON representation
Machine configuration tool using Go+Lua
- Host: GitHub
- URL: https://github.com/patrixr/glue
- Owner: patrixr
- License: gpl-3.0
- Created: 2024-08-15T07:10:59.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-22T07:02:34.000Z (over 1 year ago)
- Last Synced: 2025-04-19T10:56:52.207Z (about 1 year ago)
- Topics: ansible, configuration, go, golang, lua, system
- Language: Go
- Homepage:
- Size: 281 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Glue
Glue is a powerful system setup tool combining using Lua as a configuration language .
It provides an intuitive, imperative approach to machine setup and configuration management.
> Warning: Glue is still is in prototype phase. Features and APIs may evolve
## Overview
Glue seamlessly combines Go + Lua (hence the name) to offer:
- Lua-based configuration language
- Simple, imperative API (inspired by Ansible)
- Extensible module system
- "Blueprint" generation and execution
- Filtering of configuration blocks
> **Note:** Glue is still in prototype phase. Features and APIs may evolve. Please report issues via GitHub.
## Quick Start
Glue typically works globally on your system by referencing the `glue.lua` file in your XDG_CONFIG_HOME folder.
Typically that would be `~/.config/glue/glue.lua`.
Here's an example of a configuration that sets up some configurations and installs Homebrew packages:
```lua
group("configs", function ()
Copy({
source = "./configs/alacritty" .. name,
dest = "~/.config/alacritty",
strategy = "merge"
})
Blockinfile({
state = true,
block = read("./configs/zshrc.sh"),
path = "~/.zshrc"
})
end)
group("homebrew", function ()
HomebrewInstall()
Homebrew({
taps = {
"oven-sh/bun",
"homebrew/cask-fonts",
},
casks = {
"zen-browser",
"steam",
"emacs",
"love",
},
packages = {
"ffmpeg",
"watch",
"httpie",
"ruby",
"lua",
}
})
end)
```
## CLI Reference
```bash
glue [flags] [command]
```
### Commands
| Command | Description |
| ------------ | ---------------------------------------- |
| `completion` | Generate shell autocompletion scripts |
| `document` | Generate internal function documentation |
| `help` | Display help information |
| `init` | Initialize Glue on your system |
| `only` | Execute specific groups using a selector |
### Flags
| Flag | Description |
| ------------------- | ------------------------------------------------------ |
| `--plan` | See the execution blueprints without applying anything |
| `-h, --help` | Show help information |
| `-p, --path string` | Specify glue.lua location |
| `-v, --verbose` | Enable verbose logging |
## Extending Glue
Glue can be extended through its module system. Create new modules in the `modules` package using the registry system.
Here's an example of a simple module that prints a message:
```go
Registry.RegisterModule(func(glue *core.Glue) error {
glue.Plug("print", core.FUNCTION).
Brief("Print a string").
Arg("obj", ANY, "the message or object to log").
Do(func(R Runtime, args *Arguments) (RTValue, error) {
glue.Log.Info(args.Get(0).String())
return nil, nil
})
return nil
})
```
## Contributing
Contributions are welcome! Please:
1. Fork the repository
2. Create a feature branch
3. Submit a pull request
## License
GNU General Public License v3.0