| Crates.io | railtube |
| lib.rs | railtube |
| version | 0.1.0 |
| created_at | 2025-09-23 17:42:10.966541+00 |
| updated_at | 2025-09-23 17:42:10.966541+00 |
| description | Declarative environment manager inspired by home-manager, for reproducible Linux setups with APT, Snap, Flatpak, Cargo and custom scripts. |
| homepage | |
| repository | https://github.com/p14c31355/railtube |
| max_upload_size | |
| id | 1851842 |
| size | 106,307 |
Railtube is a Rust-based command-line tool that allows you to manage your operating system's packages and run scripts declaratively using TOML manifests. It aims to simplify environment setup and reproducibility by integrating with common package managers like APT, Snap, Flatpak, Cargo, and handling .deb files, as well as executing custom scripts.
Inspired by the desire for a unified and reproducible environment setup, Railtube leverages the familiarity of Cargo and the readability of TOML. It provides a single command to define and apply your desired system configuration, making it easier to set up new machines, share environments, or manage dotfiles.
sudo apt install -y.sudo snap install.flatpak install -y.cargo install..deb files: Downloads .deb packages from URLs and installs them, handling dependency issues.apt update before APT package installations.railtube command.Prerequisites:
cargo) installed.sudo access for package installations.apt, snap, flatpak, dpkg, and a shell (sh) installed on your system.Build and Install railtube:
Navigate to the project's root directory in your terminal and run:
cargo build
Then, install the railtube executable globally:
cargo install --path .
This makes the railtube command available in your terminal.
Railtube provides four subcommands: apply, run, doctor, and export.
railtube applyApplies package installations defined in a TOML manifest. Skips already installed packages (with optional version checking).
railtube apply --source <path_or_url> [--dry-run] [--yes] [--only <sections>]
--dry-run: Show what would be installed without executing commands.--yes: Skip confirmation prompts.--only <sections>: Apply only specific sections (comma-separated, e.g., apt,cargo).railtube runExecutes a specific script defined in the [scripts] section of a TOML manifest.
railtube run --source <path_or_url> <script_name>
railtube doctorChecks for discrepancies between the packages listed in the TOML manifest and those currently installed on the system.
railtube doctor --source <path_or_url>
This command reports:
railtube exportExports the current installed packages (from APT, Snap, Flatpak, Cargo) to a TOML manifest file. Note: Scripts and deb sections are not exported as they are declarative, not queryable from the system.
railtube export [--output <file>]
--output: Path for the output TOML file (default: exported-env.toml).The TOML file defines different sections for various package managers and scripts.
# Example railtube.toml
# Optional: Run 'apt update' before installing apt packages
[system]
update = true
# APT packages (supports version pinning: "package=1.2.3")
[apt]
list = [
"git",
"vim",
"curl",
"htop",
]
# Snap packages
[snap]
list = [
"spotify",
"code --classic", # Example of snap install with arguments
]
# Flatpak packages
[flatpak]
list = [
"com.discordapp.Discord",
"org.mozilla.firefox",
]
# Cargo packages to install globally
[cargo]
list = [
"ripgrep",
"bat",
]
# URLs for .deb packages to download and install
[deb]
urls = [
"https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb",
"https://download.slack-edge.com/linux_releases/slack-desktop-4.29.149-amd64.deb",
]
# Scripts to run
[scripts]
setup-dev-env = "echo 'Setting up development environment...' && git config --global --add --bool push.default simple"
update-all = "echo 'Updating all systems...' && sudo apt update && sudo apt upgrade -y && cargo install-update -a"
Apply configuration from a local file:
railtube apply --source ./my-dev-env.toml
Run a script from a local TOML file:
railtube run --source ./my-dev-env.toml setup-dev-env
Apply configuration from a URL (e.g., a GitHub Gist):
railtube apply --source https://gist.github.com/yourusername/yourgistid/raw/yourfile.toml
Run a script from a URL:
railtube run --source https://gist.github.com/yourusername/yourgistid/raw/yourfile.toml update-all
apt --fix-broken install.See CONTRIBUTING.md for details. Contributions are welcome! Please open an issue or pull request on GitHub.
This project is licensed under either of
at your option.