I’m not sure if this is the right term to use, but in Nix, there’s a shell.nix file to access the shell in an isolated, pure environment. I have a repository, basically a web app that uses NodeJS. I want to be able to invoke a new shell using guix shell. What is the similar equivalent in Guix? Is it guix.scm or manifest.scm?

  • @Shareni@programming.dev
    link
    fedilink
    3
    edit-2
    2 months ago

    https://guix.gnu.org/manual/en/html_node/Invoking-guix-shell.html

    https://guix.gnu.org/manual/en/html_node/Writing-Manifests.html

    Although you’ll probably need to use npm, and for that you’ll need to simulate fhs.

    I think nix is better in this scenario. It’s got a newer node (21 vs 18), better package support, and I’ve seen some solutions to automatically convert npm packages to nix ones.

    Docker is going the be the easiest solution though.

    • @velox_vulnusOP
      link
      English
      12 months ago

      I kinda gave up on MongoDB. Too bad it isn’t packaged anywhere - not just that, my experience with MongoDB was shit on NixOS as well. FerretDB was a better substitute, but then, you’re gonna have to burden yourself with extra shell lines for configuration.

        • @velox_vulnusOP
          link
          1
          edit-2
          2 months ago

          My bad, I should have been more clear. What I should have said is that the issue with MongoDB on Nixpkgs is the SSPL license, meaning that you will have to build MongoDB on your own system. It requires at least 16GB of RAM. For someone with a low-end device, it is simply not feasible to use that as a solution.

          Btw, I should have also mentioned the context about MongoDB - I wanted to package a NodeJS app with MongoDB, but either way (Guix or Nixpkgs), I’m stuck without a proper solution.

          And docker is…I kinda find it irritating. Just picked Postgres instead.

          • @Shareni@programming.dev
            link
            fedilink
            12 months ago

            It requires at least 16GB of RAM.

            What do you mean? I just tried installing it through nix shell nixpkgs#mongodb and it used like 1gb of ram while building. It definitely doesn’t take that much to run it, as the free instances are a lot smaller. I’ve got 0 experience hosting it though, we only used the official cloud solutions at my previous job.

            If you just need a simple local DB to distribute with your app, isn’t sqlite the best?

            And docker is…I kinda find it irritating.

            Sure, but it’s the industry standard for a reason.

            • @velox_vulnusOP
              link
              English
              22 months ago

              I’m talking about this: https://github.com/NixOS/nixpkgs/issues/258489. This issue has still not been resolved.

              If you just need a simple local DB to distribute with your app, isn’t sqlite the best?

              I also want to deploy them, so SQLite isn’t ideal in that case. Honestly, I’m in favor of FerretDB, now that I’ve realized how convenient it is as a MongoDB-compatible replacement.