{"id":20697990,"url":"https://github.com/fly-apps/rails-nix","last_synced_at":"2025-04-22T21:29:29.185Z","repository":{"id":43272003,"uuid":"459129857","full_name":"fly-apps/rails-nix","owner":"fly-apps","description":"Deploy Rails apps on Fly.io with Nix","archived":false,"fork":false,"pushed_at":"2022-04-07T22:42:20.000Z","size":142,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-29T19:02:09.765Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fly-apps.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-02-14T11:13:40.000Z","updated_at":"2024-10-07T05:16:37.000Z","dependencies_parsed_at":"2022-09-06T07:01:56.033Z","dependency_job_id":null,"html_url":"https://github.com/fly-apps/rails-nix","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/fly-apps%2Frails-nix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fly-apps%2Frails-nix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fly-apps%2Frails-nix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fly-apps%2Frails-nix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fly-apps","download_url":"https://codeload.github.com/fly-apps/rails-nix/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250327782,"owners_count":21412498,"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-17T00:21:26.052Z","updated_at":"2025-04-22T21:29:29.167Z","avatar_url":"https://github.com/fly-apps.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is a sample Rails app for testing [a Nix-based development and deployment system](https://github.com/fly-apps/nix-base). It inherits most behavior from Fly's [Nix modules](https://github.com/fly-apps/nix-base). The following files are interesting for understanding how the module system works.\n\n* [default.nix](.nix/default.nix): Entry point for Nix commands. All module configuration is passed through here. This can eventually be moved to `nix-base`.\n* [shell.nix](.nix/shell.nix): Entry point for `nix-shell`. It ensures all gem groups are included in the bundle environment.\n* [nix-base.nix](.nix/nix-base.nix): Importer shim for loading Nix modules that fetches the `nix-base` git commit from `fly.toml`. A helper script in `.nix/update-nix-base` will update values in `fly.toml` HEAD of `nix-base/main`.\n* [nix-build-image](.nix/nix-build-image): Script that will build an image and push it to the Fly repository.\n\n## Building a Docker image\n\nIf you just want to build the Docker image and see the results, you can run the following on **Linux**. Building Docker images on Darwin is not well supported.\n\n`nix-build . -A eval.config.outputs.container.image | docker load`\n\nThis will generate a Docker image tarball and load it into your local Docker. You can inspect its contents with an amazing tool called [Dive](https://github.com/wagoodman/dive).\n## Deploying on Fly.io\n\nTo deploy, use `fly deploy -i image_name`, substituting the image name from the `docker load`.\n\nFor Fly employees and enthusiasts: there's experimental support for running a remote build using `fly deploy --nix`. Using this will require a custom remote builder Docker image. Ask an admin how to get that setup. Eventually, Nix will be enabled by default on remote builder VMs.\n## Using Nix in Development\n\nThe same Nix environment used in production can also be run in development.\n\nFirst install Nix locally, then run `nix-shell` in the project root. You'll be popped into a shell with all the good stuff. If you want a shell with *nothing but Nix* - not inheriting `PATH` or any other environment from your system - use `nix-shell --pure`.\n## Notes\n\nChanging Ruby versions can mess with the Bootsnap cache. If errors are raised by bootsnap, try `rm -rf tmp/cache`.\n\nBundling gems requires an extra step to update `gemset.nix`. Run `bin/bundix` after any `Gemfile` updates.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffly-apps%2Frails-nix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffly-apps%2Frails-nix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffly-apps%2Frails-nix/lists"}