{"id":18980645,"url":"https://github.com/snowfallorg/vhs","last_synced_at":"2025-04-19T19:13:54.842Z","repository":{"id":63962154,"uuid":"572147493","full_name":"snowfallorg/vhs","owner":"snowfallorg","description":"Render VHS tapes with Nix.","archived":false,"fork":false,"pushed_at":"2023-08-25T03:21:31.000Z","size":18,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T12:11:11.524Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/snowfallorg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-29T16:47:58.000Z","updated_at":"2024-08-15T19:30:34.000Z","dependencies_parsed_at":"2023-01-29T01:45:12.490Z","dependency_job_id":null,"html_url":"https://github.com/snowfallorg/vhs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snowfallorg%2Fvhs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snowfallorg%2Fvhs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snowfallorg%2Fvhs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snowfallorg%2Fvhs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snowfallorg","download_url":"https://codeload.github.com/snowfallorg/vhs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249239338,"owners_count":21235846,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T16:07:24.791Z","updated_at":"2025-04-16T12:31:12.241Z","avatar_url":"https://github.com/snowfallorg.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VHS ❤ Nix\n\n\u003ca href=\"https://nixos.wiki/wiki/Flakes\" target=\"_blank\"\u003e\n\t\u003cimg alt=\"Nix Flakes Ready\" src=\"https://img.shields.io/static/v1?logo=nixos\u0026logoColor=d8dee9\u0026label=Nix%20Flakes\u0026labelColor=5e81ac\u0026message=Ready\u0026color=d8dee9\u0026style=for-the-badge\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/snowfallorg/lib\" target=\"_blank\"\u003e\n\t\u003cimg alt=\"Built With Snowfall\" src=\"https://img.shields.io/static/v1?logoColor=d8dee9\u0026label=Built%20With\u0026labelColor=5e81ac\u0026message=Snowfall\u0026color=d8dee9\u0026style=for-the-badge\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/charmbracelet/vhs\" target=\"_blank\"\u003e\n\t\u003cimg alt=\"Powered By VHS\" src=\"https://img.shields.io/static/v1?logoColor=d8dee9\u0026label=Powered%20By\u0026labelColor=5e81ac\u0026message=VHS\u0026color=d8dee9\u0026style=for-the-badge\"\u003e\n\u003c/a\u003e\n\n\u003cp\u003e\n\u003c!--\n\tThis paragraph is not empty, it contains an em space (UTF-8 8195) on the next line in order\n\tto create a gap in the page.\n--\u003e\n  \n\u003c/p\u003e\n\nThis flake provides a helper utility to render [VHS](https://github.com/charmbracelet/vhs)\ntapes with Nix.\n\n\u003e **Warning**\n\u003e\n\u003e Rendering VHS tapes in Nix requires a relaxed or disabled sandbox. Either run `nix build`\n\u003e with the flag `--no-sandbox` or set `sandbox = relaxed` in your `nix.conf` file.\n\n## Usage\n\nFirst, include this flake as an input in your flake.\n\n```nix\n{\n\tdescription = \"My awesome flake\";\n\n\tinputs = {\n\t\tnixpkgs.url = \"github:nixos/nixpkgs/nixos-22.05\";\n\n\t\t# Snowfall Lib is not required, but will make configuration easier for you.\n\t\tsnowfall-lib = {\n\t\t\turl = \"github:snowfallorg/lib\";\n\t\t\tinputs.nixpkgs.follows = \"nixpkgs\";\n\t\t};\n\n\t\tvhs = {\n\t\t\turl = \"github:snowfallorg/vhs\";\n\t\t\tinputs.nixpkgs.follows = \"nixpkgs\";\n\t\t};\n\t};\n}\n```\n\nNext, write a VHS tape.\n\n```tape\nOutput sample.mp4\nOutput sample.gif\n\nType \"# Hello World\" Enter Enter\n\nSleep 1\n\nType \"# This is built in Nix!\"\n\nSleep 2\n```\n\nThen, use this flake's library to render your VHS tape.\n\n```nix\n{\n\tdescription = \"My awesome flake\";\n\n\tinputs = {\n\t\tnixpkgs.url = \"github:nixos/nixpkgs/nixos-22.05\";\n\n\t\t# Snowfall Lib is not required, but will make configuration easier for you.\n\t\tsnowfall-lib = {\n\t\t\turl = \"github:snowfallorg/lib\";\n\t\t\tinputs.nixpkgs.follows = \"nixpkgs\";\n\t\t};\n\n\t\tvhs = {\n\t\t\turl = \"github:snowfallorg/vhs\";\n\t\t\tinputs.nixpkgs.follows = \"nixpkgs\";\n\t\t};\n\t};\n\n\toutputs = inputs:\n\t\tinputs.snowfall-lib.mkFlake {\n\t\t\tinherit inputs;\n\t\t\tsrc = ./.;\n\n\t\t\toutputs-builder = channels:\n\t\t\t\tlet\n\t\t\t\t\trecorder = inputs.vhs.lib.mkRecorder channels.nixpkgs;\n\t\t\t\tin {\n\t\t\t\t\tpackages.default = recorder.record {\n\t\t\t\t\t\ttape = ./example.tape;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t};\n}\n```\n\nFinally, run the build!\n\n```bash\n# If you have a relaxed sandbox set in your nix.conf file.\nnix build .#\n\n# Otherwise you can build this package without a sandbox.\nnix build .# --no-sandbox\n```\n\n## Library\n\n### `vhs.lib.mkRecorder`\n\nCreate a VHS recorder.\n\nType: `Attrs -\u003e Attrs`\n\nUsage:\n\n```nix\nmkRecorder pkgs\n```\n\nResult:\n\n```\n{ record = attrs: {/* ... */}; }\n```\n\n#### `Recorder.record`\n\nCreate a recording from a tape.\n\nType: `{ tape, buildInputs, files } -\u003e Derivation`\n\nUsage:\n\n```nix\nrecorder.record {\n\t# You can use a tape file\n\t# tape = ./example.tape;\n\t#\n\t# Or you can supply its contents as a string!\n\ttape = ''\n\t\tOutput sample.mp4\n\t\tOutput sample.gif\n\n\t\tType \"hello\" Enter\n\n\t\tSleep 2\n\n\t\tType \"cat ./example.txt\" Enter\n\n\t\tSleep 2\n\t'';\n\n\t# Add packages to use in your recording.\n\tbuildInputs = [ pkgs.hello ];\n\n\t# Recordings are done in a temporary directory, so any files\n\t# you want to use in your recording must be specified here.\n\tfiles = [\n\t\t./example.txt\n\t];\n\n\t# Configuration for the Bash shell.\n\tbashrc = ''\n\t\texport GUM_INPUT_PROMPT=\"What's up?\"\n\t'';\n}\n```\n\nResult:\n\n```\nDerivation\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnowfallorg%2Fvhs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnowfallorg%2Fvhs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnowfallorg%2Fvhs/lists"}