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?

  • ck_@discuss.tchncs.de
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    So what I understood here is:

    • you have a shell.nix file that puts packages on your path for working on your package
    • you have a script with a nix-shell shebang that puts the same packages as your shell.nix on the script path because you call it when not being “in the shell”
    • you want your script to “source” the packages from the shell.nix instead of having to specific them twice in the shebang

    Is that correct so far?