Skip to content

Add NixOS development setup support#1541

Open
Karl-Paul wants to merge 7 commits intofoambubble:mainfrom
Purschke:dev/nixos
Open

Add NixOS development setup support#1541
Karl-Paul wants to merge 7 commits intofoambubble:mainfrom
Purschke:dev/nixos

Conversation

@Karl-Paul
Copy link
Copy Markdown

This PR introduces a minimal NixOS setup to make local development of Foam easier and fully reproducible. With this, contributors can start coding immediately in a clean enviroment — no manual installation or setup required.

  • adds Nix shell configuration (shell.nix)
  • ensures Node, Yarn, and VSCode tooling are available via direnv
  • no changes to existing build or runtime behavior
  • fully optional — no impact on existing workflows

Let me know if you'd prefer this be documented.

… and added precombiled executables to enable debugging jest tests
Running test from VScode GUI not working yet. Therefor we must update the jest version to v29.
… makes the pah variables in the shell.nix file available for VSCode. Otherwiese VSCode is unable to run jest;npm or other commands.
@riccardoferretti
Copy link
Copy Markdown
Collaborator

Hi @Karl-Paul - thanks for taking the initiative on this.
I am not familiar with nixOS, so yes, please document it.
I want to be sure I understand and find useful the changes (as, in the end, maintaining it will be my responsibility) before moving forward with it

@Karl-Paul
Copy link
Copy Markdown
Author

Hey @riccardoferretti — thanks for your response!
I’ll add the documentation under the docs/dev/ folder this week. In this file, I’ll describe the idea behind the NixOS setup, its advantages, and the setup steps.
I’ll also include a link to the official Nix project and its documentation.

Copy link
Copy Markdown
Collaborator

@riccardoferretti riccardoferretti left a comment

Choose a reason for hiding this comment

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

This is looking good, can you tell me more about the eslint part?

Comment thread .vscode/settings.json Outdated
Comment on lines +34 to +48
"eslint.enable": true,
"eslint.run": "onType",
"eslint.alwaysShowStatus": true,
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"eslint.workingDirectories": [
{
"directory": ".",
"changeProcessCWD": true
}
]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

are these settings about Nix?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good that you asked! I had some problems with ESLint. I was getting import errors that I couldn’t really interpret at first. I initially thought it was a Nix issue. But it turned out the problem was actually in the .eslintrc file, which I also fixed in the same commit. I checked again now and noticed that most of them are just default settings, so I’ll remove those changes.
Sorry for the confusion — my mistake!

Comment thread docs/dev/nix-setup.md
Comment thread docs/dev/nix-setup.md

### yarn test

Error: $DISPLAY not set / GUI-related errors on Windows or SSH
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this is a good example of the type of issue I am worried might arise and I'd need to support ;)

Copy link
Copy Markdown
Author

@Karl-Paul Karl-Paul Nov 8, 2025

Choose a reason for hiding this comment

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

Yeah, I think I get what you mean. I have to admit, the setup is quite complex and can be a bit error-prone when it comes to special cases.
I honestly didn’t expect that I’d ever be able to run your setup with the VS Code extension for debugging. That’s quite a unique setup, but it actually works — and I think that’s pretty impressive!
So maybe that’s a good argument in favor of Nix ;).

Comment thread docs/dev/nix-setup.md Outdated
## References
- [Official Nix Website](https://nixos.org/)
- [NixOS configuration templates](https://nixos.wiki/wiki/Configuration_Collection)
- [my personal minimal NixOS config](https://github.com/Purschke/machines) No newline at end of file
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this repo is not public, i can't access it

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

sorry, I´ve made it public now

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.

2 participants