Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for Nix Flakes through nix develop #2453

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

GuilloteauQ
Copy link

Description

Add support for Nix Flakes.

Before, when users wanted to use Nix Flakes (https://nixos.org) they had to wrap the shell command into the cli call to nix develop:

shell:
    "nix develop .#myenv --command 'python3 run.py'"

with this PR, users can indicate which Nix environment to use, similarly to containers and conda:

nix_flake:
    ".#myenv"
shell:
    "python3 run.py"

Related issue: #139

QC

  • The PR contains a test case for the changes or the changes are already covered by an existing test case.
  • The documentation (docs/) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake).

This PR adds a simple test for the feature.
I am unsure how to add it to the test suite though because of the Nix dependency....

For the doc, I will be happy to write a section if this PR gets accepted :)

@sonarcloud
Copy link

sonarcloud bot commented Sep 20, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@GuilloteauQ GuilloteauQ changed the title Add support for Nix Flakes through nix develop feat: Add support for Nix Flakes through nix develop Sep 20, 2023
@johanneskoester
Copy link
Contributor

This is awesome, thanks a lot! Please be patient with me, we are currently preparing for Snakemake 8 which will support all kinds of plugins. So far, I am working on storage and executor plugins, but deployment plugins are also on my list. I still have to decide whether I merge this as is or whether we rather immediately do this as a plugin, which you could then even maintain directly yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants