{"id":24387147,"url":"https://github.com/42loco42/statish","last_synced_at":"2026-04-22T11:36:16.475Z","repository":{"id":273130483,"uuid":"918783888","full_name":"42LoCo42/statish","owner":"42LoCo42","description":"Bundle a shellscript with statically linked binaries!","archived":false,"fork":false,"pushed_at":"2025-03-11T10:05:47.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-11T11:23:01.468Z","etag":null,"topics":["bundler","nix","shellscript","statically-linked"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/42LoCo42.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"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":"2025-01-18T21:00:37.000Z","updated_at":"2025-03-11T10:05:50.000Z","dependencies_parsed_at":"2025-01-18T22:35:17.919Z","dependency_job_id":null,"html_url":"https://github.com/42LoCo42/statish","commit_stats":null,"previous_names":["42loco42/statish"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42LoCo42%2Fstatish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42LoCo42%2Fstatish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42LoCo42%2Fstatish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42LoCo42%2Fstatish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/42LoCo42","download_url":"https://codeload.github.com/42LoCo42/statish/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243280186,"owners_count":20265970,"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":["bundler","nix","shellscript","statically-linked"],"created_at":"2025-01-19T12:22:07.642Z","updated_at":"2025-12-27T14:30:25.797Z","avatar_url":"https://github.com/42LoCo42.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"* statish\nYou want to run a shellscript on some machine, but it doesn't have all of the binaries your script needs?\nTry statish! Using the awesome power of ❄️nixpkgs❄️ and some truly horrendous ELF magic,\nit combines your script \u0026 all of its dependencies into a single, statically-linked executable!\n\n** Usage\n#+begin_src nix\n    # flake.nix\n\n    {\n      inputs = {\n        statish = {\n          url = \"github:42LoCo42/statish\";\n\n          # optional\n          # inputs.flake-utils.follows = \"flake-utils\";\n          # inputs.nixpkgs.follows = \"nixpkgs\";\n        };\n      };\n\n      outputs = { flake-utils, nixpkgs, statish, ... }:\n        flake-utils.lib.eachDefaultSystem (system:\n          let pkgs = import nixpkgs { inherit system; }; in {\n            packages.default = statish.lib.mkstatish {\n              name = \"example\";\n              bins = [ \"curl\" ];\n              inherit pkgs;\n\n              text = ''\n                echo \"henlo wrold :3\"\n                echo \"my IP is $(curl -s https://ip.me)\"\n              '';\n\n              # shell = \"bash\";\n              # the default shell is bash\n              # set to null to directly launch the script\n              # (using its shebang to find the interpreter)\n            };\n          });\n    }\n#+end_src\n\n** Under the hood\nUsing Golang, we create a statically-linked \"template\" loader\nthat reads its own binary file, finds the =statish= section\nand unpacks it (as a tar-zstd archive) into a temporary folder.\n\nIt also reads a shell name from the =statish-shell= section.\nIf this was successful, it executes the given shell in the tempdir,\ngiving it the name of the script (always =main=) as well as any\narguments passed to the loader.\n\nIf no shell was found, it instead directly executes the =main= file\n(but still gives it any passed arguments).\n\nThe template loader is \"instantiated\"\nby the =lib.mkstatish= function exposed by this flake,\nwhich looks up all of the requested =bins= (and the shell)\nin the =pkgsStatic= subset of =nixpkgs=.\nIt then generates the corresponding archive and attaches it\nas well as the shell name to its output copy of the loader.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F42loco42%2Fstatish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F42loco42%2Fstatish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F42loco42%2Fstatish/lists"}