Global Feed Post Login
Replying to Avatar stefan b

Nix/OS keeps impressing me - TIL that you can write a script in arbitrary languages and then add a nix-shell shebang to set up the environment using the standard Nix repo biz

so, you can do:

#! /usr/bin/env nix-shell

#! nix-shell -i python3 -p python3Packages.beautifulsoup4 python3Packages.prettytable

from bs4 import BeautifulSoup

from prettytable import PrettyTable

..more Python code..

no need to create / understand language-specific virtual environments

super cool!

#linux #nix #nixos

Avatar
Raito Bezarius 2y ago

nostr:npub1wl0tzswcyamc27vm2c77lltf5l3kqq443tmp8gws2qmy3vdw8ljqlzpv54 this feature has even advanced property like you can do --pure to have self contained pure Bash scripts that removes external environment variables

I use it to create "pure environment" for testing etc.

Reply to this note

Please Login to reply.

Discussion

No replies yet.