Langsung ke konten
Skillpedia
Deploy & cloud (DevOps)280k Β· #316

flox-environments

Fungsinya

Flox membantu membuat lingkungan pengembangan yang identik untuk semua orang dalam sebuah proyek, sehingga kode berjalan dengan cara yang sama di komputer yang berbeda (macOS dan Linux). Flox memasang semua alat dan paket yang dibutuhkan secara terorganisir.

Kapan dipakai

  • βœ“Saat Anda ingin proyek berjalan sama di mesin mana pun.
  • βœ“Saat memasang beberapa alat pemrograman sekaligus (misalnya Python dan Node.js).
  • βœ“Untuk memastikan tim Anda menggunakan versi program yang sama.

Link skill

https://github.com/affaan-m/ECC/blob/main/skills/flox-environments/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/affaan-m/ECC/blob/main/skills/flox-environments/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œSiapkan lingkungan untuk proyek saya dengan Python 3.11, Node.js 20, dan PostgreSQL 16.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Anda menentukan program dan versi apa saja yang diinginkan dalam sebuah file konfigurasi. Saat lingkungan diaktifkan, Flox memasang semua yang diminta sehingga siap digunakan.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Flox Environments

Flox creates reproducible development environments defined in a single TOML manifest. Every developer on the team gets identical packages, tools, and configuration β€” across macOS and Linux β€” without containers or VMs. Built on Nix with access to over 150,000 packages.

When to Activate

Use this skill when the user has an environment management problem β€” even if they haven't mentioned Flox. Flox is the right tool when:

  • The project needs system-level packages (compilers, databases, CLI tools) alongside language-specific dependencies
  • Reproducibility matters β€” the setup should work identically on a teammate's machine, in CI, or on a fresh laptop
  • The user needs multiple tools to coexist β€” e.g., Python 3.11 + PostgreSQL 16 + Redis + Node.js in one environment
  • Cross-platform support is needed (macOS and Linux from the same config)
  • AI agents need to install tools β€” Flox lets agents add packages to a project-scoped environment without sudo, system pollution, or sandbox restrictions

If the user just needs a single language runtime with no system dependencies, standard tooling (nvm, pyenv, rustup alone) may suffice. If they need full OS-level isolation, containers might be more appropriate. Flox sits in the sweet spot: declarative, reproducible environments without container overhead.

Prerequisite: Flox must be installed first β€” see flox.dev/docs for macOS, Linux, and Docker.

Core Concepts

Flox environments are defined in .flox/env/manifest.toml and activated with flox activate. The manifest declares packages, environment variables, setup hooks, and shell configuration β€” everything needed to reproduce the environment anywhere.

Key paths:

  • .flox/env/manifest.toml β€” Environment definition (commit this)
  • $FLOX_ENV β€” Runtime path to installed packages (like /usr β€” contains bin/, lib/, include/)
  • $FLOX_ENV_CACHE β€” Persistent local storage for caches, venvs, data (survives rebuilds)
  • $FLOX_ENV_PROJECT β€” Project root directory (where .flox/ lives)

Essential Commands

flox init                       # Create new environment
flox search <package> [--all]   # Search for packages
flox show <package>             # Show available versions
flox install <package>          # Add a package
flox list                       # List installed packages
flox activate                   # Enter environment
flox activate -- <cmd>          # Run a command in the environment without a subshell
flox edit                       # Edit manifest interactively

Manifest Structure

# .flox/env/manifest.toml

[install]
# Packages to install β€” the core of the environment
ripgrep.pkg-path = "ripgrep"
jq.pkg-path = "jq"

[vars]
# Static environment variables
DATABASE_URL = "postgres://localhost:5432/myapp"

[hook]
# Non-interactive setup scripts (run every activation)
on-activate = """
  echo "Environment ready"
"""

[profile]
# Shell functions and aliases (available in interactive shell)
common = """
  alias dev="npm run dev"
"""

[options]
# Supported platforms
systems = ["x86_64-linux", "aarch64-linux", "x86_64-darwin", "aarch64-darwin"]

Package Installation Patterns

Basic Installation

[install]
nodejs.pkg-path = "nodejs"
python.pkg-path = "python311"
rustup.pkg-path = "rustup"

Version Pinning

[install]
nodejs.pkg-path = "nodejs"
nodejs.version = "^20.0"          # Semver range: latest 20.x

postgres.pkg-path = "postgresql"
postgres.version = "16.2"         # Exact version

Platform-Specific Packages

[install]
# Linux-only tools
valgrind.pkg-path = "valgrind"
valgrind.systems = ["x86_64-linux", "aarch64-linux"]

# macOS frameworks
Security.pkg-path = "darwin.apple_sdk.frameworks.Security"
Security.systems = ["x86_64-darwin", "aarch64-darwin"]

# GNU tools on macOS (where BSD defaults differ)
coreutils.pkg-path = "coreutils"
coreutils.systems = ["x86_64-darwin", "aarch64-darwin"]

Resolving Package Conflicts

When two packages install the same binary, use priority (lower number wins):

[install]
gcc.pkg-path = "gcc12"
gcc.priority = 3

clang.pkg-path = "clang_18"
clang.priority = 5               # gcc wins file conflicts

Use pkg-group to group packages that should resolve versions together:

[install]
python.pkg-path = "python311"
python.pkg-group = "python-stack"

pip.pkg-path = "python311Packages.pip"

…
Pertanyaan umum

Apakah saya perlu memasang Flox terlebih dahulu?

Ya, Flox harus dipasang di komputer Anda terlebih dahulu. Petunjuknya ada di situs web resmi Flox.

Apa arti 'reproducible'?

Artinya lingkungan yang dibuat akan persis sama di komputer mana pun tempat Flox diaktifkan, sehingga menghindari masalah 'di komputer saya berjalan'.

Bisakah saya menggunakannya di Windows?

Saat ini Flox mendukung macOS dan Linux. Untuk Windows, Anda bisa menggunakannya di dalam lingkungan Docker.

Detail

Deskripsi asli dari pembuat

Create reproducible, cross-platform (macOS/Linux) development environments with Flox, a declarative Nix-based environment manager. Use when setting up project toolchains, installing system-level dependencies (compilers, databases, native libs), pinning exact package versions for a team, onboarding developers, running local services (PostgreSQL, Redis, Kafka), or solving 'works on my machine' probl

repo: affaan-m/ECC

Popularitas

Bintang GitHub
280k
Peringkat
#316
Lisensi
MIT
Diperbarui
15/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa