# Nuenv - now revived!

**URL:** https://discourse.nixos.org/t/nuenv-now-revived/66851
**Category:** Announcements
**Created:** [July 16, 2025, 11:36pm UTC](https://discourse.nixos.org/t/nuenv-now-revived/66851 "2025-07-16T23:36:20Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![xav-ie](https://discourse.nixos.org/user_avatar/discourse.nixos.org/xav-ie/32/17948_2.png) [@xav-ie](https://discourse.nixos.org/u/xav-ie)
#### Post date: [July 16, 2025, 11:36pm UTC](https://discourse.nixos.org/t/nuenv-now-revived/66851/1 "2025-07-16T23:36:20Z")

</div>

**New project:** [GitHub - xav-ie/nuenv: A Nushell environment for Nix - revived!](https://github.com/xav-ie/nuenv) ⚰

Last year, [GitHub - DeterminateSystems/nuenv: A Nushell environment for Nix](https://github.com/DeterminateSystems/nuenv) was archived 😢. Nuenv enabled `writeShellApplication` to use Nushell wrappers instead of Bash.

Nushell is great and I find I can work far faster with it than any Python, Bash, or Node script I write. I love the expressiveness and ease. You can learn more about it here: [https://nushell.sh](https://nushell.sh).

Fortunately, the original project encourages forks and the license is MIT. I’ve made enough local changes to my `writeNuApplication` copy that I decided to publish an update.

**Notable improvements:**

- Supports `--stdin` and arbitrary arguments for `writeNuApplication`, fixing upstream [add `--stdin` to shebang · Issue #30 · DeterminateSystems/nuenv · GitHub](https://github.com/DeterminateSystems/nuenv/issues/30)
- Allows specifying which Nushell interpreter to run more easily
- Up-to-date with latest Nushell version

It’s still a baby and I mainly migrated my updates and got basic CI working. If you write any Nushell, please consider contributing so we can all benefit 🤗. Technical feedback welcome through GitHub issues!

---

<div class="post-metadata">

### Author: ![ksvivek](https://discourse.nixos.org/user_avatar/discourse.nixos.org/ksvivek/32/35158_2.png) [@ksvivek](https://discourse.nixos.org/u/ksvivek)
#### Post date: [July 17, 2025, 12:32am UTC](https://discourse.nixos.org/t/nuenv-now-revived/66851/2 "2025-07-17T00:32:27Z")

</div>

Just yesterday I was looking for something like this​:fire:🎉.

Btw, just wondering how this differs from using,  
pkgs.writers.wrtieNuBin?  
🤔  
I see that this Nuenv have builInputs kind of attributes.  
But functionality wise anything different?  
When I should go for these compared to writers?🤔

---

<div class="post-metadata">

### Author: ![xav-ie](https://discourse.nixos.org/user_avatar/discourse.nixos.org/xav-ie/32/17948_2.png) [@xav-ie](https://discourse.nixos.org/u/xav-ie)
#### Post date: [July 17, 2025, 12:51am UTC](https://discourse.nixos.org/t/nuenv-now-revived/66851/3 "2025-07-17T00:51:58Z")

</div>

Hm, I was not aware of `writeNuBin`… that definitely makes some of the project obsolete!

I mostly only use `writeNuApplication`, which allows you to specify `runtimeInputs` without having to write `lib.getExe` or `${derivation}/bin/${name}` everywhere. It also allows specifying `runtimeEnv`, which I find very useful.

`writeNuBin` or any `write*Bin` writers are kind of cumbersome to use for any script that has lots of deps or is greater than ~10 lines.

I will have to see how this `writeNuBin` affects things and simplify the project. Thanks for bringing that to my attention.

---

<div class="post-metadata">

### Author: ![mightyiam](https://discourse.nixos.org/user_avatar/discourse.nixos.org/mightyiam/32/33998_2.png) [@mightyiam](https://discourse.nixos.org/u/mightyiam)
#### Post date: [July 17, 2025, 2:43am UTC](https://discourse.nixos.org/t/nuenv-now-revived/66851/4 "2025-07-17T02:43:08Z")

</div>

Whatever you end up doing, I would find it most convenient in Nixpkgs. I should really start using one of these instead of `writeShellApplication` everywhere.

---

<div class="post-metadata">

### Author: ![uep](https://discourse.nixos.org/user_avatar/discourse.nixos.org/uep/32/5167_2.png) [@uep](https://discourse.nixos.org/u/uep)
#### Post date: [July 17, 2025, 9:07am UTC](https://discourse.nixos.org/t/nuenv-now-revived/66851/5 "2025-07-17T09:07:02Z")

</div>

also of relevance and use:

> **[GitHub - YPares/nushellWith: Isolated nushell envs with specific plugins and...](https://github.com/YPares/nushellWith)**
>
> Isolated nushell envs with specific plugins and libraries (with Nix)

---

<div class="post-metadata">

### Author: ![xav-ie](https://discourse.nixos.org/user_avatar/discourse.nixos.org/xav-ie/32/17948_2.png) [@xav-ie](https://discourse.nixos.org/u/xav-ie)
#### Post date: [July 17, 2025, 9:20am UTC](https://discourse.nixos.org/t/nuenv-now-revived/66851/6 "2025-07-17T09:20:47Z")

</div>

I did not know this was an option… I was under impression for some reason this was unwanted. I would also prefer it there.

I will try and fix this up and make a pr for the writeNuApplication soon. 😃

---

<div class="post-metadata">

### Author: ![xav-ie](https://discourse.nixos.org/user_avatar/discourse.nixos.org/xav-ie/32/17948_2.png) [@xav-ie](https://discourse.nixos.org/u/xav-ie)
#### Post date: [July 17, 2025, 9:23am UTC](https://discourse.nixos.org/t/nuenv-now-revived/66851/7 "2025-07-17T09:23:07Z")

</div>

Ooh, this seems way more powerful. I only created this project again mainly to get writeNuApplication back, but maybe this project will be closed again due to these other cool projects. I will have to see how this affects things. Thank you.

---

<div class="post-metadata">

### Author: ![llakala](https://discourse.nixos.org/user_avatar/discourse.nixos.org/llakala/32/38325_2.png) [@llakala](https://discourse.nixos.org/u/llakala)
#### Post date: [July 18, 2025, 2:49am UTC](https://discourse.nixos.org/t/nuenv-now-revived/66851/8 "2025-07-18T02:49:36Z")

</div>

If you’re doing that, I should add [`writeFishApplication`](https://github.com/llakala/llakaLib/blob/78e744b1ea60c1baf2c66962570316db940a445a/impureLib/writeFishApplication.nix) too.

---

<div class="post-metadata">

### Author: ![delliott](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/d/e9a140/32.png) [@delliott](https://discourse.nixos.org/u/delliott)
#### Post date: [July 18, 2025, 9:51am UTC](https://discourse.nixos.org/t/nuenv-now-revived/66851/9 "2025-07-18T09:51:10Z")

</div>

If it looks like we are going to be adding more write\*Application, maybe we should instead have writeShellApplication have an optional setting for the shell to use, and some conditional logic for what checkers to use based on that?

---

<div class="post-metadata">

### Author: ![ksvivek](https://discourse.nixos.org/user_avatar/discourse.nixos.org/ksvivek/32/35158_2.png) [@ksvivek](https://discourse.nixos.org/u/ksvivek)
#### Post date: [July 21, 2025, 6:00pm UTC](https://discourse.nixos.org/t/nuenv-now-revived/66851/10 "2025-07-21T18:00:39Z")

</div>

> <https://github.com/vivekanandan-ks/ksvnixscriptdemo/blob/7deca2660e4f35abc109387e51db1641a9d19b96/flake.nix>

Also just a demo script setup for Bash using writers. Improved the readability, so I’ll just touch the name, dependencies, script there.

Maybe we can bring a common wrapperArgs like that?  
But too many functions out there, we want a common pattern here.  
Like a universal function with args like:

name  
Interpreter  
extraArgs  
packages  
script

And making default values, template examples will help unify things.

---

<div class="post-metadata">

### Author: ![terlar](https://discourse.nixos.org/user_avatar/discourse.nixos.org/terlar/32/868_2.png) [@terlar](https://discourse.nixos.org/u/terlar)
#### Post date: [July 23, 2025, 6:17am UTC](https://discourse.nixos.org/t/nuenv-now-revived/66851/11 "2025-07-23T06:17:13Z")

</div>

At work we migrated all our scripts to nushell and also created a `writeNuApplication` wrapper as we migrated from `writeShellApplication` and missed some of the features in `writeNuBin`.

Some notable features are to inject environment variables as well as support nushell modules where common functions/tooling could be included.

Here is the source:

```nix
{
  lib,
  symlinkJoin,
  writers,
  nushell,
}:

{
  name,
  text,
  modules ? [],
  runtimeInputs ? [],
  runtimeEnv ? null,
}:

let
  modulesDrv = symlinkJoin {
    name = "modules";
    paths = modules;
  };

  interpreterArgs = [
    "--no-config-file"
  ]
  ++ (lib.optional (modules != []) "--include-path=${modulesDrv}");

  setEnvWrapperArgs = lib.pipe runtimeEnv [
    (lib.mapAttrsToList (
      name: value: [
        "--set"
        name
        value
      ]
    ))
    lib.flatten
  ];
in
writers.makeScriptWriter {
  interpreter = "${lib.getExe nushell} ${lib.concatStringsSep " " interpreterArgs}";
  makeWrapperArgs =
    lib.optionals (runtimeInputs != []) [
      "--prefix"
      "PATH"
      ":"
      (lib.makeBinPath runtimeInputs)
    ]
    ++ lib.optionals (runtimeEnv != null) setEnvWrapperArgs;
} "/bin/${name}" text

```

Usage could look something like this:

```nix
{
  writeNuApplication,
  # Runtime
  google-cloud-sdk,
  kubectl,
  nushell-modules,
}:

writeNuApplication {
  name = "mesh-cert-status-test";

  modules = [
    nushell-modules.k8s
  ];

  runtimeInputs = [
    (google-cloud-sdk.withExtraComponents [
      google-cloud-sdk.components.gke-gcloud-auth-plugin
    ])
    kubectl
  ];

  text = builtins.readFile ./main.nu;
}

```

---

<div class="post-metadata">

### Author: ![xav-ie](https://discourse.nixos.org/user_avatar/discourse.nixos.org/xav-ie/32/17948_2.png) [@xav-ie](https://discourse.nixos.org/u/xav-ie)
#### Post date: [July 24, 2025, 4:21pm UTC](https://discourse.nixos.org/t/nuenv-now-revived/66851/12 "2025-07-24T16:21:58Z")

</div>

That is really cool and exactly the type of thing I want to do in the near future. Thank you. I will try to integrate something like this probably in the next month. I am out for a few weeks.

---

<div class="post-metadata">

### Author: ![lucperkins](https://discourse.nixos.org/user_avatar/discourse.nixos.org/lucperkins/32/2708_2.png) [@lucperkins](https://discourse.nixos.org/u/lucperkins)
#### Post date: [September 14, 2025, 5:43pm UTC](https://discourse.nixos.org/t/nuenv-now-revived/66851/13 "2025-09-14T17:43:41Z")

</div>

Original author of Nuenv here 😄 This is really great to see! I wish I had had more bandwidth to push the original project forward myself but I’m excited to see what develops under your stewardship, @xav-ie! Let me know if I can be of any assistance.

---

<div class="post-metadata">

### Author: ![Yethal](https://discourse.nixos.org/user_avatar/discourse.nixos.org/yethal/32/28771_2.png) [@Yethal](https://discourse.nixos.org/u/Yethal)
#### Post date: [September 14, 2025, 8:09pm UTC](https://discourse.nixos.org/t/nuenv-now-revived/66851/14 "2025-09-14T20:09:52Z")

</div>

Out of curiosity, why was nuenv abandoned by detsys?

---

<div class="post-metadata">

### Author: ![lucperkins](https://discourse.nixos.org/user_avatar/discourse.nixos.org/lucperkins/32/2708_2.png) [@lucperkins](https://discourse.nixos.org/u/lucperkins)
#### Post date: [September 14, 2025, 11:44pm UTC](https://discourse.nixos.org/t/nuenv-now-revived/66851/15 "2025-09-14T23:44:32Z")

</div>

It was an experiment and a fun side project and was never intended as anything more. I opted to archive it to send the signal that it wasn’t going to be developed further.

---

<div class="post-metadata">

### Author: ![Yethal](https://discourse.nixos.org/user_avatar/discourse.nixos.org/yethal/32/28771_2.png) [@Yethal](https://discourse.nixos.org/u/Yethal)
#### Post date: [September 15, 2025, 1:49pm UTC](https://discourse.nixos.org/t/nuenv-now-revived/66851/16 "2025-09-15T13:49:57Z")

</div>

That’s a shame, nix and nushell are a match made in heaven

---

<div class="post-metadata">

### Author: ![lucperkins](https://discourse.nixos.org/user_avatar/discourse.nixos.org/lucperkins/32/2708_2.png) [@lucperkins](https://discourse.nixos.org/u/lucperkins)
#### Post date: [September 15, 2025, 1:54pm UTC](https://discourse.nixos.org/t/nuenv-now-revived/66851/17 "2025-09-15T13:54:35Z")

</div>

Yeah, it’s good stuff! It’s just not something I can devote much time to given other commitments, so I’m glad others are carrying the torch.

---

<div class="post-metadata">

### Author: ![ginkogruen](https://discourse.nixos.org/user_avatar/discourse.nixos.org/ginkogruen/32/39404_2.png) [@ginkogruen](https://discourse.nixos.org/u/ginkogruen)
#### Post date: [September 15, 2025, 5:21pm UTC](https://discourse.nixos.org/t/nuenv-now-revived/66851/18 "2025-09-15T17:21:37Z")

</div>

Could you elaborate where you see the synergy between the two?  
Especially in comparison with Bash + Nix.

I’ve had my first experience writing a small Nu script and I really liked the experience but I don’t have much experience with Bash either so I think I might be missing some points.

---

<div class="post-metadata">

### Author: ![Yethal](https://discourse.nixos.org/user_avatar/discourse.nixos.org/yethal/32/28771_2.png) [@Yethal](https://discourse.nixos.org/u/Yethal)
#### Post date: [September 15, 2025, 5:50pm UTC](https://discourse.nixos.org/t/nuenv-now-revived/66851/19 "2025-09-15T17:50:22Z")

</div>

Both languages lean heavily towards functional paradigm and both feature native support for parsing and generating structured data (which is like 90% of what happens when Nixos configuration is built)

The problem with bash is that the language is very basic and primitive and trying to represent any type of complex logic in it is cumbersome and error prone, as a result a lot of projects in Nix ecosystem either perform all of their data validation/manipulation/generation in Nix itself and then generate the resulting script (e.g Disko) or get rewritten in a more capable language such as Python Go or Rust (nixos-rebuild, switch-to-configuration, serokell’s deploy which became deploy-rs and surely lots of others but those I can list off the top of my head).

---

<div class="post-metadata">

### Author: ![ginkogruen](https://discourse.nixos.org/user_avatar/discourse.nixos.org/ginkogruen/32/39404_2.png) [@ginkogruen](https://discourse.nixos.org/u/ginkogruen)
#### Post date: [September 15, 2025, 7:17pm UTC](https://discourse.nixos.org/t/nuenv-now-revived/66851/20 "2025-09-15T19:17:06Z")

</div>

That makes a lot of sense thanks for elaborating!

I didn’t think about it in this way of enabling one to have the convenience of using a language made for working with the shell but still getting a lot of the stability of the functional programming style and data handling which makes a rewrite in Go, Rust etc. less needed for smaller projects.

[Next page](https://discourse.nixos.org/t/nuenv-now-revived/66851.md?page=2)
