wrap-shell-script

Wrap a shell script into a reproducible Nix package with runtime dependencies.

8|1|Updated Oct 21, 2015
One-click install
npx skills add https://github.com/iamruinous/nix-config --skill wrap-shell-script
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wrap-shell-script
Source: https://github.com/iamruinous/nix-config/tree/main/.opencode/skills/wrap-shell-script
Command: npx skills add https://github.com/iamruinous/nix-config --skill wrap-shell-script

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill converts a standalone shell script into a reproducible Nix package, ensuring deterministic builds and clean dependency handling.

Core Features & Use Cases

  • Package creation: automatically generate a Nix derivation that wraps the target script with proper runtime dependencies.
  • Dependency isolation: ensures the script runs with a controlled set of tools (bash, coreutils, etc.) and no host drift.
  • Use Case: deploy a script across multiple machines by packaging it for Nix-based environments.

Quick Start

Provide the script name and path to wrap, then run nix build to create the package.

Frequently Asked Questions about wrap-shell-script

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I package a shell script as a reproducible Nix derivation?

To package a shell script as a reproducible Nix derivation, provide the script name and path to generate a Nix package that embeds the script and exposes a runnable binary. You then run nix build to create the package.

Why should I wrap a shell script into a Nix package?

Wrapping a shell script into a Nix package ensures deterministic builds and clean dependency isolation. It standardizes deployment by controlling runtime dependencies like bash and coreutils, preventing host environment drift across multiple machines.

Can I use Nix to isolate runtime dependencies for utility scripts in CI?

Yes, you can use Nix to isolate runtime dependencies for utility scripts in CI. This process wraps the target script with a controlled set of tools, ensuring consistent packaging and deployment across development and system administration scenarios.

What is the best way to standardize deployment for small utility scripts?

The best way to standardize deployment for small utility scripts is wrapping them in a reproducible Nix package. This generates a derivation that embeds the script and wraps it with proper runtime dependencies for consistent execution.

Do I need to manually specify bash and coreutils when wrapping a script in Nix?

You do not need to manually specify bash and coreutils when wrapping a script in Nix. The process automatically handles dependency isolation, ensuring the script runs with a controlled set of tools and no host drift.