Hacker News new | ask | show | jobs
by frankjr 851 days ago
> nix run nixpkgs#cowsay

> This is a game-changer, you don’t have to pollute your system to run a one-off command, or you can try a package out before committing to installing it.

Is there a way to run the command isolated from the rest of the system? Because while this is nice it will still leave behind whatever configuration files / caches the program created on start up.

3 comments

Not on macOS, but if you want run NixOS in a VM or on bare metal you can use nix-impermanence. Recreates your system/state from scratch on each reboot.

https://nixos.wiki/wiki/Impermanence

Nothing nix specific but you may be interested in https://github.com/containers/bubblewrap
Yeah I'm familiar, I was hoping for something more integrated, it seems like it would be a pretty good fit.
you can run nix in a container

It's tricky because said program probably needs to access the original $HOME