{"id":20122208,"url":"https://github.com/danielrolls/shellify","last_synced_at":"2025-08-24T19:25:15.516Z","repository":{"id":159445599,"uuid":"618058272","full_name":"danielrolls/shellify","owner":"danielrolls","description":"Quickly generate shell.nix files once you have a working shell","archived":false,"fork":false,"pushed_at":"2025-03-26T13:19:54.000Z","size":1502,"stargazers_count":29,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T14:21:27.698Z","etag":null,"topics":["nix","nix-shell","nixos","utility"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielrolls.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-23T17:02:36.000Z","updated_at":"2025-03-27T17:20:24.000Z","dependencies_parsed_at":"2023-10-15T07:59:44.578Z","dependency_job_id":"da0ac5af-62be-4d84-beb4-bbef9b02c4d8","html_url":"https://github.com/danielrolls/shellify","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielrolls%2Fshellify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielrolls%2Fshellify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielrolls%2Fshellify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielrolls%2Fshellify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielrolls","download_url":"https://codeload.github.com/danielrolls/shellify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252721086,"owners_count":21793749,"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":["nix","nix-shell","nixos","utility"],"created_at":"2024-11-13T19:35:40.483Z","updated_at":"2025-08-24T19:25:15.505Z","avatar_url":"https://github.com/danielrolls.png","language":"Haskell","funding_links":[],"categories":["Haskell"],"sub_categories":[],"readme":"# Shellify\n\n[![Packaging status](https://repology.org/badge/vertical-allrepos/shellify.svg?columns=4\u0026header=Shellify)](https://repology.org/project/shellify/versions)\n\n[![Packaging status](https://repology.org/badge/vertical-allrepos/haskell%3Ashellify.svg?columns=4\u0026header=Shellify%20Library)](https://repology.org/project/shellify/versions)\n\nWant to quicky get something to build and to have it reproducable and sharable? With [`nix`](https://nixos.org/manual/nix/stable/command-ref/nix-shell.html) it is easy to quickly add dependencies to get something to build. It's also easy to work quickly and iteratively. With this tool, once you're done you can save a `shell.nix` so that you and anybody else can quickly and instantly rebuild with an identical environment with all the same dependencies. Just swap out `nix-shell` or `nix` for `nix-shellify` to create the necessary `shell.nix` in the local directory. It makes saving a basic working `shell.nix` almost instant. Take a look at the short examples below to see the workflow.\n\n## Prerequisites\n\nThis utility assumes [nix is installed](https://nixos.org/download.html).\n\n\n## Example usage without flakes\n\n![Interactive demo showing how to use shellify with flakes](docs/legacy-nix-demo.gif)\n\nI want to run a program called `foo`. When I run `./foo` it complains I don't have python. So I run `nix-shell -p python` and try running `./foo` again.\n\nNow it complains I don't have asciidoc so I come out of the shell and edit the last command to add asciidoc by running `nix-shell -p python asciidoc`. Now it works.\n\nI exit my shell and change `nix-shell -p python asciidoc` to `nix-shellify -p python asciidoc`. It then creates a `shell.nix` which I keep next to foo. It looks like this:\n\n```nix\n{ pkgs ? import \u003cnixpkgs\u003e {} }:\n\npkgs.mkShell {\n\n  buildInputs = [\n    pkgs.asciidoc\n    pkgs.python\n  ];\n\n}\n```\n\nNow I can just type `nix-shell` and I have what I need to run foo. I can share and everybody else can run foo too without the same search. They also don't need to run it in a conatainer or VM or to maintain depenencies on their system themself. \n\n## Example usage with flakes\n\n![Interactive demo showing how to use shellify with flakes](https://user-images.githubusercontent.com/50051176/258610444-6e848fa4-a675-4aa3-b3b6-d099605bc4b7.gif)\n\nI want to run something called `foo`. When I run `./foo` it complains I don't have python. So I run `nixshell nixpkgs#python` and try running `./foo` again.\n\nNow it complains I didn't have asciidoc so I come out of the shell and edit the last command to add asciideoc by running `nix shell nixpkgs#python nixpkgs#asciidoc`. Now it works.\n\nI exit my shell and change `nix shell nixpkgs#python nixpkgs#asciidoc` to `nix-shellify shell nixpkgs#python nixpkgs#asciidoc`. I do this by quickly extending `nix` to `nix-shellify` using tab completion. It then creates a `flake.nix` and `shell.nix` which I commit in git next to foo. Now I can just type `nix develop` and I have what I need to run foo. I can share and everybody else can quickly run foo too with the same environment. I can also go on to modify my nix files e.g. to run as an app or run an initialisation command when starting the shell.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielrolls%2Fshellify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielrolls%2Fshellify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielrolls%2Fshellify/lists"}