this post was submitted on 04 Aug 2023
4 points (100.0% liked)

nixos

1244 readers
1 users here now

All about NixOS - https://nixos.org/

founded 4 years ago
 

I have a personal source project I created a shell.nix file for. However, in the project I have also scripts I want to execute periodically non-interactively. Could I use the nix-shell shebang pointing to shell.nix file in order to have the same programs when I use nix-shell interactively and when I launch the scripts?

top 4 comments
sorted by: hot top controversial new old
[–] [email protected] 2 points 1 year ago* (last edited 1 year ago)
#!/usr/bin/env nix-shell
#!nix-shell -i bash /path/to/shell.nix
echo "Hello, World!"

haven't tested, but it should work

load more comments
view more: next ›