nix-direnv
naersk
nix-direnv | naersk | |
---|---|---|
29 | 6 | |
2,012 | 771 | |
4.1% | 1.8% | |
7.9 | 6.5 | |
6 days ago | 8 days ago | |
Shell | Nix | |
MIT License | MIT License |
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
naersk
-
Help with building a 32bit library with cargo
i would also recommend using crane or naersk since iirc rustPlaform.buildRustPackage can mangle some of these options (or maybe i just did something wrong lol)
-
Nix & Rust - cargo2nix 0.11.0 released
Have a look at naersk, it neither requires generated Nix files nor IFD.
-
Nix and NixOS Get So Close to Perfect
We use naersk[0] for Rust projects in our Nix monorepo (for example [1]). It's pretty hands-off in terms of the Nix code needed (you don't need to pin hashes inside of the Nix code as long as you have a Cargo lockfile) and all the existing tooling keeps working fine.
The main drawback of it is that it currently builds all of your dependencies in one big derivation, so any dependency changes cause a full rebuild. There's some other project I saw fly by which attempts to do a similar thing but split each crate into a separate derivation, but I forgot what it's called and have no experience with it.
[0]: https://github.com/nix-community/naersk
[1]: https://cs.tvl.fyi/depot/-/blob/ops/journaldriver/default.ni...
-
Nixery – Docker images on the fly with Nix
You can also use naersk¹ if you want to avoid a two-step process. It's especially convenient when using nix flakes.
¹https://github.com/nix-community/naersk
-
niv, naersk, napalm: moving on
I created https://github.com/nmattia/napalm/issues/34 and https://github.com/nmattia/naersk/issues/183 to move them to nix-community
-
Nix-ifying a Rust project
sounds exactly like what naersk does. naersk doesn't need a cargSha256 argument since it downloads dependencies from Cargo.lock. it can also grab the version number from Cargo.toml
What are some alternatives?
devenv - Fast, Declarative, Reproducible, and Composable Developer Environments
crate2nix - rebuild only changed crates in CI with crate2nix and nix
devshell - Per project developer environments
crane - A Nix library for building cargo projects. Never build twice thanks to incremental artifact caching.
lorri - Your project's nix-env
rust-overlay - Pure and reproducible nix overlay of binary distributed rust toolchains
nix-config - :space_invader: NixOS configuration
nix2container - An archive-less dockerTools.buildImage implementation
rnix-lsp - WIP Language Server for Nix! [maintainer=@aaronjanse]
cargo2nix - Granular builds of Rust projects for Nix
flake-templates - A collection of basic Nix flake templates for adding a reproducible environment quickly