nix-direnv
lorri

nix-direnv | lorri | |
---|---|---|
29 | 6 | |
2,012 | 998 | |
4.1% | - | |
7.9 | 0.0 | |
10 days ago | over 2 years ago | |
Shell | Rust | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
nix-direnv
- Enlightenmentware
-
Poetry2Nix Development Flake with Matplotlib GTK Support
You might want to checkout direnv and nix-direnv for added convenience.
- A faster, persistent implementation of direnv's use_Nix and use_flake
-
How do multiple versions of the package internally work?
BTW: I personally use direnv with nix-direnv. This basically works by setting your shell with proper tooling when you enter the directory.
-
I have a few beginner question, what is the difference between nix shell/env and what is the difference between flakes/home-manager?
I'm not sure what you mean by nix env, maybe you are referring to nix-direnv?
-
Just a reminder to make sure Garbage Collection is running
Although currently I'm using direnv + nix-direnv. Keep in mind that direnv has builtin nix support which is very basic and doesn't do any caching. So you still needs this add-on to preserve roots.
-
What do you install with configuration.nix and home manager
I distinguish between system level things and user level things, even though I don't really have different users on my machine. I install the bare minimum number of packages + a lot of different drivers in the configuration.nix, and desktop and editor related things in HM. For development environment, I have environment per project using mkShell and https://github.com/nix-community/nix-direnv, which allows you to switch to the specific environment once you cd into the directory. (Although I do have python installed globally with some commonly used packages such as numpy, so I can just start python and write something when I need to, without creating an environment)
-
How do YOU use your PKMS?
I further make my software projects so that when I click a link I go into an environment pre-loaded with their dependencies so dropping in/out of projects is always frictionless. I do this with the reproducibility guarantees of nix, along with glue like nix-direnv and envrc-mode to direnv.
-
Nuenv: an experimental Nushell environment for Nix
(I also use nix-direnv)
-
NixOS + Haskell best practices circa March 2023
direnv
lorri
-
NixOS + Haskell best practices circa March 2023
lorri
- Lorri: Project's Nix-Env
-
niv, naersk, napalm: moving on
And how does niv compare to https://github.com/target/lorri
-
A treatise on Nix
Yes, you can "hold on", it's called gcroots. There's lorri which you can also use to defer the tediousness of managing the gcroots to a daemon.
-
Per process memory and CPU usage control
Not that I know of but if you are having trouble with rebuilding and running out of memory, maybe the solution would be to cache the builds locally? You could use lorri to cache your development builds (https://github.com/target/lorri).
-
NixOS Linux
> Using a special command (nix-shell) whenever I needed to do development things (e.g. Rust builds) was not my idea of fun.
Funny you should mention that, because that's exactly what got me using Nix everywhere :). I've always hated installing tools and libraries globally—what if I need a different version for a future project?—so I like tools that sandbox as much as possible like virtualenv, cargo, cabal... etc. But these tools are all language-specific and have their own limitations (especially around native libraries and dependencies written in other languages).
nix-shell gives me the equivalent of virtualenv that works for everything. I can have a single sandboxed environment even if my project uses a bunch of different languages and I can manage everything in a reproducible, low-overhead fashion. No more worrying about making a mess by installing tools or packages globally.
Then, once I got really used to that, I spent some time setting up direnv[1] and lorri[2]—both of which are themselves managed with Nix, of course!—so that my environment gets automatically configured as soon as I enter a project directory without needing to call nix-shell explicitly. To be honest, the experience is still a bit rough, but it works well enough day-to-day that I have my reproducible sandbox cake and eat it in an mostly frictionless way too :).
[1]: https://direnv.net/
[2]: https://github.com/target/lorri
What are some alternatives?
devenv - Fast, Declarative, Reproducible, and Composable Developer Environments
direnv - unclutter your .profile
devshell - Per project developer environments
dotfiles - i3 + Plasma: using the i3 window manager on the top of KDE Plasma and other dotfiles, configurations, scripts, workarounds and practises from my Debian Sid machines.
naersk - Build Rust projects in Nix - no configuration, no code generation, no IFD, sandbox friendly.
nickel - Better configuration for less
nix-config - :space_invader: NixOS configuration
nix - Nix, the purely functional package manager
rnix-lsp - WIP Language Server for Nix! [maintainer=@aaronjanse]
patchelf - A small utility to modify the dynamic linker and RPATH of ELF executables
flake-templates - A collection of Nix flake templates for adding a reproducible environment quickly
nixops - NixOps is a tool for deploying to NixOS machines in a network or cloud.
