/ docs / reference / scripts.md
scripts.md
 1  # Compiled Scripts Reference
 2  
 3  Source: `nix/scripts/*.hs`
 4  
 5  32 Haskell scripts compiled for system operations.
 6  
 7  ## Container Operations
 8  
 9  | Script | Dependencies | Description |
10  |--------|--------------|-------------|
11  | `unshare-run` | bubblewrap, crane, jq | Run OCI images in bwrap/unshare namespaces |
12  | `unshare-gpu` | bubblewrap, crane, jq, pciutils | Run OCI with GPU device access |
13  | `crane-inspect` | crane, jq | Inspect OCI image metadata |
14  | `crane-pull` | crane | Pull OCI images |
15  
16  ## Namespace Runners
17  
18  | Script | Dependencies | Description |
19  |--------|--------------|-------------|
20  | `fhs-run` | bubblewrap | Run with FHS layout |
21  | `gpu-run` | bubblewrap, pciutils | Run with GPU access |
22  
23  ## VM Operations
24  
25  | Script | Dependencies | Description |
26  |--------|--------------|-------------|
27  | `isospin-run` | firecracker | Run Firecracker VMs |
28  | `isospin-build` | e2fsprogs, cpio, gzip | Build Firecracker disk images |
29  | `cloud-hypervisor-run` | cloud-hypervisor | Run Cloud Hypervisor VMs |
30  | `cloud-hypervisor-gpu` | cloud-hypervisor, pciutils | Run with GPU passthrough |
31  
32  ## GPU Passthrough
33  
34  | Script | Dependencies | Description |
35  |--------|--------------|-------------|
36  | `vfio-bind` | pciutils | Bind PCI devices to vfio-pci |
37  | `vfio-unbind` | pciutils | Unbind from vfio-pci |
38  | `vfio-list` | pciutils | List VFIO-capable devices |
39  
40  ## Development Tools
41  
42  | Script | Dependencies | Description |
43  |--------|--------------|-------------|
44  | `check` | - | Validation script |
45  | `gen-wrapper` | - | Generate typed CLI wrappers |
46  | `gen-gnu-wrapper` | - | Generate GNU getopt wrappers |
47  | `gen-tool-wrapper` | - | Generate tool wrappers |
48  | `nix-dev` | nix | Development Nix wrapper |
49  | `nix-ci` | nix | CI Nix wrapper |
50  | `lint-init` | - | Initialize linting |
51  | `lint-link` | - | Link linting config |
52  
53  ## CLI Wrapper Tools
54  
55  Supported tools for typed wrapper generation:
56  
57  ### Clap (Rust)
58  
59  rg, fd, bat, delta, dust, tokei, hyperfine, deadnix, statix, stylua, taplo, zoxide
60  
61  ### GNU getopt_long
62  
63  ls, grep, sed, find, xargs, tar, gzip, wget, rsync
64  
65  ### Hand-crafted
66  
67  jq, crane, bwrap
68  
69  ## Usage
70  
71  Via overlay:
72  
73  ```nix
74  pkgs.aleph.script.compiled.unshare-run
75  pkgs.aleph.script.compiled.fhs-run
76  pkgs.aleph.script.compiled.vfio-bind
77  ```
78  
79  Via devshell:
80  
81  ```nix
82  devShells.default = pkgs.mkShell {
83    packages = with pkgs.aleph.script.compiled; [
84      unshare-run
85      fhs-run
86      gpu-run
87    ];
88  };
89  ```
90  
91  All scripts at once:
92  
93  ```nix
94  packages = [ pkgs.aleph.script.all-compiled ];
95  ```