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

Added nix for developer setup (#1379) - Asking for feedback #1602

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

daveoconnor
Copy link
Collaborator

@daveoconnor daveoconnor commented Jan 16, 2025

This PR isn't to be merged, I'm posting it just to solicit feedback.

I've talked with Greg and done a demo, now making it more widely available for feedback before I carry out the rest of the work of consolidating/updating the docs, but this is an important change that should have general buy in before I proceed.

What I'm proposing is docs/nix_based_setup.md becomes the README.md and the only install documentation we have. I may move content from other documentation to here as I consolidate. General information docs will remain separate. I'm thinking the readme should be setup + an index of other docs.

For those who aren't aware, Nix is a package manager which you can consider as similar to brew, but can be declarative like having a package.json/requirements.txt (see flake.nix) and can be limited to a single project, like it is here for website-v2. There's a video linked in docs/nix_based_setup.md that covers Nix.

What this will provide is a system that should be much easier to start with, it sets up all dependencies, asciidoctor and the boost gem etc., sets up a virtualenv, compiles all the json out of the gate, and should allow a developer to be up and running with a complete system (as far as I'm aware of it now) for the project quickly.

There are bootstrap scripts in docs/scripts already that could be useful but would need updating. Personally I'm wary of running scripts that make wide ranging changes to my system and am of the opinion it's easier/quicker to follow instructions than read the scripts to see if there might be issues or collisions with how I normally do things, or might not have been maintained, but I might be in the minority there, so I'd like feedback on that too.

Happy to do another demo if people want to know what it will look like or have questions.

Please add anyone else you think may be useful to provide feedback as a reviewer.

@sdarwin
Copy link
Collaborator

sdarwin commented Jan 16, 2025

It seems that in both scenarios (nix, not-nix) the developer must install.

  • Docker Desktop
  • Just

Next, it's common to have Python and Git installed anyway.

That leaves... pip, gems, nvm. These might be a convenient advantage of nix. But nix is not the only solution:

  • Python virtual environments are a way to switch between multiple sets of python packages.
  • nvm is a way to switch between multiple versions of node.

The reviewers tagged in this issue should weigh in. They will be using this on a regular basis. It's a comparison between "I am comfortable with the current setup" versus being enthusiastic about nix. Especially - if Julio, Rob, Chrissy could try this in real life, make an informed decision, and provide feedback/comments.

I wonder if both scenarios could continue to be supported (nix, not-nix). Well, let's see what the feedback is.

@daveoconnor daveoconnor force-pushed the doc/1379-developer-setup-nix branch from b7b255a to b692281 Compare February 5, 2025 22:10
@cdw9
Copy link
Collaborator

cdw9 commented Feb 21, 2025

This worked pretty smoothly for me on macOS. I used Docker Desktop.

Issues I ran into:

  1. I got an error on the libraries migration 0020_repopulate_slug_20240325_1616: psycopg2.errors.UndefinedColumn: column libraries_library.graphic does not exist. I'm not sure if this is related to nix, it might just be a migration issue that needs to be fixed (I was able to hack my way around it)
  2. I got a message like this a few times: direnv: error /nix-website-v2/.env is blocked. Run 'direnv allow' to approve its content. Is there a way to avoid it?

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.

3 participants