12
submitted 10 months ago by yboutros@infosec.pub to c/nixos@infosec.pub

I setup a next.js project with pkgs.mkshell, and used nix develop to automatically build the project. However, when I leave the shell, the files persist. How should/can(?) I setup my shell.nix so that files in the directory it drops down into are automatically removed when leaving the ephemeral shell?

you are viewing a single comment's thread
view the rest of the comments
[-] Atemu@lemmy.ml 2 points 10 months ago

You could achieve something like that using bubblewrap; effectively a container. You can tell it to mount tmpfs wherever you like. That has other issues though.

That's a big of a complex setup which other people potentially working with you may not want to have. A clean task is just better. If you're using git anyways, you can also just use git clean.

this post was submitted on 25 Feb 2024
12 points (100.0% liked)

NixOS

1016 readers
1 users here now

NixOS is a Linux distribution built on top of the Nix package manager. Its declarative configuration allows reliable system upgrades via several official channels of stability and size.

This community discusses NixOS, Nix, and everything related.

founded 2 years ago
MODERATORS