{"id":13512347,"url":"https://github.com/nix-community/lorri","last_synced_at":"2026-02-11T13:34:22.896Z","repository":{"id":38223478,"uuid":"332479921","full_name":"nix-community/lorri","owner":"nix-community","description":"Your project’s nix-env [maintainer=@Profpatsch,@nyarly]","archived":false,"fork":false,"pushed_at":"2025-04-19T22:07:58.000Z","size":2965,"stargazers_count":841,"open_issues_count":26,"forks_count":25,"subscribers_count":8,"default_branch":"canon","last_synced_at":"2026-01-29T10:15:10.912Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","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/nix-community.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"open_collective":"nix-community"}},"created_at":"2021-01-24T15:10:38.000Z","updated_at":"2026-01-28T09:28:31.000Z","dependencies_parsed_at":"2024-04-29T22:34:56.085Z","dependency_job_id":"7c4f53e8-ddbf-4608-b8a3-53f177c579fc","html_url":"https://github.com/nix-community/lorri","commit_stats":{"total_commits":886,"total_committers":62,"mean_commits":"14.290322580645162","dds":0.6580135440180587,"last_synced_commit":"cb99f085b448f38e5d31196866111925a6465876"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/nix-community/lorri","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-community%2Florri","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-community%2Florri/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-community%2Florri/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-community%2Florri/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nix-community","download_url":"https://codeload.github.com/nix-community/lorri/tar.gz/refs/heads/canon","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-community%2Florri/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29333565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T12:42:24.625Z","status":"ssl_error","status_checked_at":"2026-02-11T12:41:23.344Z","response_time":97,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-08-01T03:01:45.452Z","updated_at":"2026-02-11T13:34:22.880Z","avatar_url":"https://github.com/nix-community.png","language":"Rust","funding_links":["https://opencollective.com/nix-community"],"categories":["Rust","Development","Go"],"sub_categories":[],"readme":"# ℓ lorri\n\nlorri is a `nix-shell` replacement for project development. lorri is\nbased around fast direnv integration for robust CLI and editor\nintegration.\n\nWhen changes are made that would affect a project's development shell,\nlorri builds the new shell in the background, and applies the result on the next\nshell prompt. The result is that development tools are kept in sync\nwith the current Nix shell configuration (even e.g. as you switch branches)\nwithout blocking your use of the terminal.\n\nlorri supports both `shell.nix` and `devShells` in `flake.nix` files.\n\nThe project is about experimenting with and improving the developer's\nexperience with Nix. A particular focus is managing your project's\nexternal dependencies, editor integration, and quick feedback.\n\nlorri supports Linux and macOS. macOS support is brittle, we are looking\nfor funding to improve it (see below).\n\n## Business Support\n\nWe provide support to businesses who wish to use lorri in their development team\nor wish to pay for further improvements or set up support contracts.\n\nSee [BUSINESS_SUPPORT.md](BUSINESS_SUPPORT.md) for further information\nand [ROADMAP.md](ROADMAP.md) for an overview of planned improvements that need funding.\n\n## Demo\n\nThis screencast shows lorri and direnv working together to reload the\ndevelopment environment as `shell.nix` is updated:\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.tweag.io/posts/2019-03-28-introducing-lorri.html\"\u003e\n    \u003cimg width=\"600\" src=\"./assets/2019-04-01-lorri-demo.gif?raw=true\" alt=\"lorri screencast\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Setup on NixOS or with `home-manager` on Linux\n\nIf you are using [NixOS][nixos] or [`home-manager`][home-manager] on Linux and\na Nixpkgs channel at least as recent as `nixos-19.09`, you can get started with\nlorri as follows. Otherwise see the next section, [Setup on other\nplatforms](#setup-on-other-platforms).\n\n1. **Enable the daemon service.** Set `services.lorri.enable = true;` in your\n   NixOS [`configuration.nix`][nixos-service] or your home-manager\n   [`home.nix`][home-manager-service].\n\n   This will automatically install the `lorri` command.\n\n   **Note**: There's [a known issue](https://github.com/target/lorri/issues/374 \"nixpkgs `services.lorri` requires reboot for the user lorri.socket to appear\")\n   preventing the lorri daemon from starting automatically upon installation.\n   Until it's resolved, you'll have to reload the user daemon by hand by\n   running `systemctl --user daemon-reload`, or reboot.\n\n2. **Install direnv.** Add `pkgs.direnv` to `environment.systemPackages` in\n   your NixOS `configuration.nix` or to `home.packages` in your home-manager\n   `home.nix`.\n\n3. **Set up the direnv hook for your shell.** See [this section][direnv-hook]\n   of the direnv documentation.\n\n4. **Activate the lorri integration.** Run `lorri init` in your project\n   directory to create a `shell.nix` and [`.envrc`][direnv-usage] file. This\n   will not overwrite existing files.\n\n   In your shell, you will now see the following message from direnv:\n\n   ```console\n   direnv: error .envrc is blocked. Run `direnv allow` to approve its content.\n   ```\n\n   Activate the integration by running [`direnv allow`][direnv-usage].\n\nFrom this point on, lorri monitors your `shell.nix` and its dependencies and\ntriggers builds as required. Whenever a build succeeds, direnv automatically\nreloads your environment.\n\nSee [Usage](#usage) for more details.\n\n## Setup on other platforms\n\nIf you are running Nix on a Linux distribution other than NixOS or on macOS,\nthe following instructions will help you get started with lorri.\n\n1. **Install lorri.** If you are using a Nixpkgs channel at least as recent\n   as `nixos-19.09`, you can install lorri using `nix-env -i lorri`.\n\n   Otherwise, install lorri from the repository as follows:\n\n   ```console\n   $ nix-env -if https://github.com/nix-community/lorri/archive/canon.tar.gz\n   ```\n\n2. **Start the daemon.** For testing, you can start the daemon in a separate\n   terminal by running `lorri daemon`.\n\n   See [`contrib/daemon.md`](contrib/daemon.md) for ways to start the daemon\n   automatically in the background.\n\n3. **Install direnv v2.19.2 or later.** If you are using a Nixpkgs channel at\n   least as recent as `nixos-19.03`, you can install a compatible version of\n   direnv using `nix-env -i direnv`.\n\n   Otherwise, you can install direnv from source as follows:\n\n   ```console\n   $ nix-env -if https://github.com/direnv/direnv/archive/master.tar.gz\n   ```\n\n4. **Set up the direnv hook for your shell.** See [this section][direnv-hook]\n   of the direnv documentation.\n\n5. **Activate the lorri integration.** Run `lorri init` in your project\n   directory to create a `shell.nix` and [`.envrc`][direnv-usage] file. This\n   will not overwrite existing files.\n\n   In your shell, you will see the following message from direnv:\n\n   ```console\n   direnv: error .envrc is blocked. Run `direnv allow` to approve its content.\n   ```\n\n   Activate the integration by running [`direnv allow`][direnv-usage].\n\nFrom this point on, lorri monitors your `shell.nix` and its dependencies and\ntriggers builds as required. Whenever a build succeeds, direnv automatically\nreloads your environment.\n\nSee [Usage](#usage) for more details.\n\n## Usage\n\nOnce the daemon is running and direnv is set up, the daemon process will\ncontinue monitoring and evaluating the Nix expressions in your project's\n`shell.nix`, and direnv will automatically reload the environment as it\nchanges.\n\ndirenv will continue to load the _cached environment_ when the daemon is not\nrunning. However, the daemon must be running for direnv to reload the\nenvironment based on the current `shell.nix` and its dependencies.\n\n## Editor integration\n\nWith the right setup, you can use lorri and direnv to customize your\ndevelopment environment for each project.\n\nIf you use Emacs, our [`direnv-mode` tutorial](./contrib/emacs.md) is there to\nhelp you get started.\n\nThis section needs to be fleshed out more\n([#244](https://github.com/target/lorri/issues/244)).\n\n## Associated Projects\n\nlorri embodies a Unix philosophy of doing one thing well.\nAs a result, it works very well with other tools to provide a powerful\nand streamlined development experience.\n\n[direnv](https://github.com/direnv/direnv) is lorri's chief collaborator. From\nits website:\n\n\u003e [direnv] augments existing shells with a new feature that can load and unload\n\u003e environment variables depending on the current directory.\n\nAs a foundation, lorri relies on [Nix and Nixpkgs](https://nixos.org/nix/)\nto install and manage software packages.\n\nFor pinning versions of software during development,\n[niv](https://github.com/nmattia/niv) is very helpful.\n\n---\n\n## Support \u0026 Questions\n\nPlease use the [issue tracker](https://github.com/nix-community/lorri/issues)\nfor any problems or bugs you encounter.\n\n- We have monthly [Office Hours](https://calendar.google.com/calendar/ical/s9gbabv28b8mbnb1kfegbplf1c%40group.calendar.google.com/public/basic.ics) on [Google Meet](https://meet.google.com/phf-bfdq-ypp)\n- We are on IRC/Matrix, `libera/#lorri` ([Webchat][]), though we might not be responsive at all times.\n\n[Webchat]: https://matrix.to/#/#lorri:libera.chat\n\n### Why is lorri not on [crates.io][]?\n\nCommand line tools written in Rust are commonly available as Rust crates on\n[crates.io][]. lorri is not distributed in this way, for good reasons.\n\nlorri can only be built within a Nix environment, and it can only be installed\nvia Nix. This is because lorri specifies its runtime dependencies as a Nix\nclosure, and because Nix is itself a runtime dependency of lorri.\n\nIn addition to these technical reasons, there is simply no point in running\nlorri if you don't have Nix installed. And if you have Nix installed, then\nyou're best off installing lorri via Nix.\n\n[crates.io]: https://crates.io\n\n## How To Help\n\nAll development on lorri happens on the Github repository, in the\nopen. You can propose a change in an issue, then create a pull request\nafter some discussion. Some issues are marked with the “good first\nissue” label, those are a good place to start. Just remember to leave\na comment when you start working on something.\n\n## Debugging\n\nSet these environment variables when debugging:\n\n```\nRUST_LOG=lorri=debug RUST_BACKTRACE=1 lorri watch\n```\n\n### lorri reevaluates more than expected\n\nlorri sometimes recursively watches a directory that the user did\nnot expect. This can happen for a number of reasons:\n\n1. When using a local checkout instead of a channel for `nixpkgs`,\n   lorri watches that directory recursively, and will trigger on\n   any file change.\n2. When specifying `src` via a path, (like the much-used `src = ./.;`)\n   lorri watches that path recursively (see\n   https://github.com/target/lorri/issues/6 for details).\n   To get around this, use a `builtins.filterSource`-based function\n   to filter `src`, e.g., use\n   [`nix-gitignore`](https://github.com/NixOS/nixpkgs/blob/8c1f1b2324bb90f8e1ea33db3253eb30c330ed99/pkgs/build-support/nix-gitignore/default.nix):\n   `src = pkgs.nix-gitignore.gitignoreSource [] ./.`, or one of the\n   functions in\n   [`nixpkgs/lib/sources.nix`](https://github.com/NixOS/nixpkgs/blob/8c1f1b2324bb90f8e1ea33db3253eb30c330ed99/lib/sources.nix)\n\n---\n\n## Evaluator + watch design\n\nThe evaluator should eagerly reevaluate the Nix expressions as soon as\nanything material to their output changes. This takes place in a few\nstages.\n\n### Initial evaluation\n\n`builder::run()` instantiates (and builds) the Nix expression with\n`nix-build -vv`. The evaluator prints each imported Nix file, and\neach copied source file. `builder::run()` parses the log and notes each\nof these paths out as an \"input\" path.\n\nEach input path is the absolute path which Nix examined.\n\nEach input path is then passed to `PathReduction` which examines each\npath referenced, and reduces it to a minimum set of paths with the\nfollowing rules:\n\n1. Discard any store paths which isn't a symlink to outside\n   the store: they are immutable.\n2. Replace any store path which is a symlink to outside the store to\n   the destination of the symlink.\n3. Replace a reference to a Nix Channel with the updateable symlink\n   root of the channel. Concretely, replace the path\n   `/nix/var/nix/profiles/per-user/root/channels/nixos/default.nix` with\n   `/nix/var/nix/profiles/per-user/root/` to watch for the channels\n   symlink to change.\n\nInitial testing collapses over 2,000 paths to just five.\n\n### Loop\n\nEach identified path is watched for changes with inotify (Linux) or\nfsevent (macOS). If the watched path is a directory, all of its\nsub-directories are also watched for changes.\n\nEach new batch of change notifications triggers a fresh evaluation.\nNewly discovered paths are added to the watch list.\n\n### Garbage Collection Roots\n\nlorri creates an indirect garbage collection root for each .drv in\n`$XDG_CACHE_HOME/lorri` (`~/.cache/lorri/` by default) each time it\nevaluates your project.\n\n### License \u0026 Copyright\n\nCopyright 2019–2020 Target, Copyright 2021 The Nix Community\nLicense: Apache 2.0 (see [`LICENSE` file](./LICENSE))\n\n---\n\n## Historical\n\nLorri was originally started by [Tweag]() for [Target](https://target.com).\nSee the [original announcement Blogpost](https://www.tweag.io/blog/2019-03-28-introducing-lorri/) (2018-03-28)\nfor more details and a sense of the original feature set.\n\n###### ASCII Art\n\n    ################################################################\n    ################################################################\n    ################################################################\n    ################################################################\n    ################################################################\n    ################################################################\n    #################( )############################################\n    ################################################################\n    ################################################################\n    ################################################################\n    ################################################################\n    ################################################################\n    ################################################################\n    ################################################################\n    ################################################################\n    ################################################################\n    ################################################################\n    ################################################################\n    ################################################################\n    ################################################################\n    ################################################################\n    ################################################################\n    ################################################################\n\n_([Nix as observed by LORRI on 2015-07-13](https://www.nasa.gov/newhorizons/lorri-gallery))_\n\n[contrib]: ./contrib\n[direnv-hook]: https://direnv.net/docs/hook.html\n[direnv-setup]: https://direnv.net/index.html#setup\n[direnv-usage]: https://direnv.net/man/direnv.1.html#usage\n[home-manager-service]: https://nix-community.github.io/home-manager/options.xhtml#opt-services.lorri.enable\n[home-manager]: https://nix-community.github.io/home-manager/\n[lorri-blog-post]: https://www.tweag.io/posts/2019-03-28-introducing-lorri.html\n[nixos-service]: https://nixos.org/nixos/options.html#services.lorri.enable\n[nixos]: https://nixos.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnix-community%2Florri","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnix-community%2Florri","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnix-community%2Florri/lists"}