{"id":23739380,"url":"https://github.com/ralismark/nix-appimage","last_synced_at":"2025-09-04T14:33:14.745Z","repository":{"id":54340601,"uuid":"522133036","full_name":"ralismark/nix-appimage","owner":"ralismark","description":"Convert a nixos derivation into a self-contained binary","archived":false,"fork":false,"pushed_at":"2024-09-08T01:17:10.000Z","size":46,"stargazers_count":145,"open_issues_count":4,"forks_count":15,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-09-08T23:27:36.175Z","etag":null,"topics":["appimage","nix","nixos"],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ralismark.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-07T06:20:32.000Z","updated_at":"2024-09-08T01:17:13.000Z","dependencies_parsed_at":"2024-05-06T06:26:22.527Z","dependency_job_id":"30acbbd8-1af1-4494-ba7f-a1ba01b70647","html_url":"https://github.com/ralismark/nix-appimage","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/ralismark%2Fnix-appimage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralismark%2Fnix-appimage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralismark%2Fnix-appimage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralismark%2Fnix-appimage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ralismark","download_url":"https://codeload.github.com/ralismark/nix-appimage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231970924,"owners_count":18453924,"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":["appimage","nix","nixos"],"created_at":"2024-12-31T09:36:49.788Z","updated_at":"2024-12-31T09:37:39.919Z","avatar_url":"https://github.com/ralismark.png","language":"Nix","funding_links":[],"categories":["Command-Line Tools","Nix"],"sub_categories":[],"readme":"# nix-appimage\n\nCreate an AppImage, bundling a derivation and all its dependencies into a single-file executable.\nLike [nix-bundle](https://github.com/matthewbauer/nix-bundle), but much faster and without the glibc dependency.\n\n## Getting started\n\nTo use this, you will need to have [Nix](https://nixos.org/) available.\nThen, run this via the [nix bundle](https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-bundle.html) interface, replacing `nixpkgs.hello` with the flake you want to build:\n\n```\n$ nix bundle --bundler github:ralismark/nix-appimage nixpkgs#hello\n```\n\nThis produces `hello.AppImage`, which prints \"Hello world!\" when run:\n\n```\n$ ./hello.AppImage\nHello, world!\n```\n\nIf you get a `entrypoint ... is not executable` error, or want to specify a different binary to run, you can instead use the `./bundle` script:\n\n```\n$ ./bundle dnsutils /bin/dig # or ./bundle dnsutils dig\n$ ./dig.AppImage -v\nDiG 9.18.14\n```\n\nYou can also use nix-appimage as a nix library -- the flake provides `lib.\u003csystem\u003e.mkAppImage` which supports more options.\nSee mkAppImage.nix for details.\n\n## Caveats\n\nOpenGL apps not being able to run on non-NixOS systems is a **known problem**, see https://github.com/NixOS/nixpkgs/issues/9415 and https://github.com/ralismark/nix-appimage/issues/5.\nYou'll need to use something like [nixGL](https://github.com/guibou/nixGL).\nAddressing this problem outright is _out of scope_ for this project, however PRs to integrate solutions (e.g. nixGL) are welcome.\n\nAdditionally, the produced file isn't a _fully_ conforming AppImage.\nFor example, it's missing the relevant .desktop file and icons -- this doesn't affect the running of bundled apps in any way, but might cause issues with showing up correctly in application launchers (e.g. rofi).\nPlease open an issue if this is something you want.\n\nThe current implementation also has some limitations:\n\n- This requires Linux User Namespaces (i.e. `CAP_SYS_USER_NS`), which are available since Linux 3.8 (released in 2013), but may not be enabled for security reasons.\n- Plain files in the root directory aren't visible to the bundled app.\n\n## Under The Hood\n\nnix-appimage creates [type 2 AppImages](https://github.com/AppImage/AppImageSpec/blob/ce1910e6443357e3406a40d458f78ba3f34293b8/draft.md#type-2-image-format), which are essentially just a binary, known as the Runtime, concatenated with a squashfs file system.\nWhen the AppImage is run, the runtime simply mounts the squashfs somewhere and runs the contained `AppRun`.\nThe squashfs contains all the files needed to run the program:\n\n- `nix/store/...`, containing the closure of the bundled program\n- `entrypoint`, a symlink to the actual executable, e.g. `/nix/store/q9cqc10sw293xpx3hca4qpsmbg7hsgzy-hello-2.12.1/bin/hello`\n- `AppRun`, which gets started after the squashfs is mounted.\n  This isn't the actual bundled executable, but a wrapper that makes the bundled nix/store file visible under /nix/store before executing `entrypoint`.\n\nRuntimes are included within the flake as `packages.\u003csystem\u003e.appimage-runtimes.\u003cname\u003e`.\nCurrently supported are:\n\n- `appimage-type2-runtime` (default)\n  This is [AppImage/type2-runtime](https://github.com/AppImage/type2-runtime), a static runtime maintained by the official AppImage team.\n- `appimagecrafters`.\n  This is [AppImageCrafers/appimage-runtime](https://github.com/AppImageCrafters/appimage-runtime), a similar static runtime that was the old default for nix-appimage.\n\nAppRuns are included within the flake as `packages.\u003csystem\u003e.appimage-appruns.\u003cname\u003e`.\nCurrently supported are:\n\n- `userns-chroot` (default).\n  This uses Linux User Namespaces and chroot to make /nix/store appear to have the bundled files, similar to [nix-user-chroot](https://github.com/nix-community/nix-user-chroot).\n  There is a known problem of plain files in the root folder not being visible to the bundled app when using this AppRun.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fralismark%2Fnix-appimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fralismark%2Fnix-appimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fralismark%2Fnix-appimage/lists"}