Skip to content

feat: Nix Shell #799

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

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

feat: Nix Shell #799

wants to merge 11 commits into from

Conversation

maningreen
Copy link

@maningreen maningreen commented Mar 31, 2025

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change. If this change fixes any issues please put "Fixes #XX" in the description. Please also ensure to add the appropriate labels to the PR.

Guidelines

  • My code follows the style guidelines of this project (formatted with Ruff)

  • I have performed a self-review of my own code

  • I have commented my code, particularly in hard-to-understand areas

  • I have made corresponding changes to the documentation if needed

  • My changes generate no new warnings

  • I have tested this change

  • Any dependent changes have been merged and published in downstream modules

  • I have added all appropriate labels to this PR

  • I have followed all of these guidelines.

How Has This Been Tested? (if applicable)

Ran dev shell and check nix flake show, and built tux from poetry.

Summary by Sourcery

Add Nix development shell configuration for the Tux project, enabling reproducible and consistent development environments across different systems.

New Features:

  • Introduce Nix flake and shell configuration to support cross-platform development environment setup

Enhancements:

  • Configure development shell with Python 3.13 and Poetry
  • Support x86_64 and aarch64 architectures for Linux and macOS

Build:

  • Create Nix flake with support for multiple system architectures
  • Add shell.nix to define development environment dependencies

Copy link
Contributor

sourcery-ai bot commented Mar 31, 2025

Reviewer's Guide by Sourcery

This pull request introduces a Nix flake configuration for the project, enabling reproducible development environments. It includes flake.nix to define the flake, shell.nix to specify the development shell environment with Python 3.13 and Poetry, and a flake.lock file to track dependencies. The .gitignore file is also updated to exclude flake.lock.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Introduces a Nix flake configuration for the project.
  • Adds a flake.nix file to define the project's Nix environment.
  • Specifies the flake's description and input dependencies, including nixpkgs.
  • Defines supported systems for the development shell.
  • Creates a development shell using callPackage and shell.nix.
flake.nix
Introduces a Nix shell definition.
  • Adds a shell.nix file to define the development shell environment.
  • Specifies the packages required for development, including python313 and poetry.
  • Adds a shellHook to enter the user's preferred shell and exit after the child shell exits.
shell.nix
Adds a flake.lock file.
  • Adds a flake.lock file to track the versions of the flake's dependencies.
flake.lock
Updates .gitignore.
  • Adds flake.lock to .gitignore.
.gitignore

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @maningreen - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding a .envrc file with direnv to automatically load the environment when entering the project directory.
  • It might be helpful to add some common development tools to the nix shell, such as git or jq.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@midirhee12
Copy link

It's ready to merge now.

Copy link
Author

@maningreen maningreen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@kzndotsh
Copy link
Contributor

kzndotsh commented Apr 7, 2025

lgtm

Waiting till we merge the pre-0.1 branch into main before accepting as there will likely be merge conflicts / adjustments needing to be made.

@electron271
Copy link
Contributor

pre-0.1 has been merged into main @kzndotsh

@electron271 electron271 added category: meta Relating to architecture, systems and critical functions type: enhancement priority: medium misc: good first issue labels Apr 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: meta Relating to architecture, systems and critical functions misc: good first issue priority: medium type: enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants