stack VS nixpkgs

Compare stack vs nixpkgs and see what are their differences.

stack

The Haskell Tool Stack (by commercialhaskell)

nixpkgs

Nix Packages collection (by NixOS)
Our great sponsors
  • Nanos - Run Linux Software Faster and Safer than Linux with Unikernels
  • Scout APM - A developer's best friend. Try free for 14-days
  • SaaSHub - Software Alternatives and Reviews
stack nixpkgs
16 328
3,634 8,169
0.7% 4.1%
7.7 10.0
23 days ago 3 days ago
Haskell Nix
BSD 3-clause "New" or "Revised" License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

stack

Posts with mentions or reviews of stack. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-10-26.

nixpkgs

Posts with mentions or reviews of nixpkgs. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-12-01.
  • Tvix: We Are Rewriting Nix
    5 projects | news.ycombinator.com | 1 Dec 2021
    As sibling comments mention, this would struggle with edge-cases, and require too much buy-in from packagers.

    A less ambitious approach would be creating/extending a static analyser/linter for Nix (there are already a few out there). This could nudge packagers towards certain styles, which language implementations could optimise for.

    For example, an interpreter could have multiple implementations of the attrset interface (key/value mappings) with different performance characteristics, using some default for literals like '{ foo = "bar"; }' and a specialised version for known use-cases like nixpkgs.lib.nameValuePair ( https://github.com/NixOS/nixpkgs/blob/e9e53499b26ad98ac97f97... ) (mentioned in a sibling)

    Linters could then spot when such functions are appropriate, e.g.

        Found literal name/value pair on line 123:
  • How should one get started with Nix and NixOS?
    3 projects | reddit.com/r/NixOS | 1 Dec 2021
    Cross-posting from https://www.reddit.com/r/NixOS/comments/r4jj6o/comment/hmkk4q2/: - Read my small guide about nix language https://github.com/rofrol/nix-for-javascript-developers - Use sourcegraph for searching. Github isn't too good for that. Example https://sourcegraph.com/search?q=context:global+file:%5C.nix%24+minecraft&patternType=literal - Read/ask questions here or at http://discourse.nixos.org/ - search for issues here https://github.com/NixOS/nixpkgs/issues - At the beginning try to use as little as possible additional abstraction layers like home-manager, devos etc. - You may look at my config https://github.com/rofrol/nixos-config there are other documentation sources listed at https://nixos.org/learn.html Be aware that those sources maybe outdated.
  • Will Nix Overtake Docker
    15 projects | news.ycombinator.com | 29 Nov 2021
    which would likely be copy-pasted from the project README. The yml file specifies version numbers for dependencies. The SAT solver is deterministic. For other languages like C maybe the project didn't specify dependency version. So you need to figure them out when you first get a successful build, then specify their versions in apt. You can specify version numbers in the apt-get install line.

    Yes, this is reproducible. Definitely good enough for most business use cases. When I say reproducible I do not mean ivory tower math proof reproducible. I just mean that the code will run on the relevant machines they are targeting. As I wrote in my initial comment. And as I defined at the top of this comment.

    Also Nix provides a worse experience for pinning dependency versions since it does not have a native concept of version numbers [0]. Instead people have to grep through the Nixpkgs repo to find the correct hash of their dependency version.

    > This is even more true for Nix, which has the largest and most up-to-date package repositories out there

    No, Docker has the closure (to borrow Nix's terminology) of all of the package managers in that graph. If you add the height of the Debian packages with Pypi and Hackage you already have Nix beat. You can keep adding - cargo, ruby gems, etc all in their native package managers. If Nix were better off then people would be adapting Nix packages to other ecosystems. But the reality is the other way around.

    > Plus, with Nix, you can easily make a new package based on existing packages with a mere few lines of code if the existing packages doesn't fit your needs. Other package managers besides Guix doesn't offer you that flexibility so you'd have to compile from scratch

    With Nix, you are forced to make new packages based on existing packages. That is not a benefit. Regarding "if the existing packages doesn't fit your needs", compiling from source is not a big deal since Docker caches output artifacts.

    [0]: https://github.com/NixOS/nixpkgs/issues/93327

  • NixOS as a daily driver
    3 projects | reddit.com/r/NixOS | 29 Nov 2021
    search for issues here https://github.com/NixOS/nixpkgs/issues
  • Smoking a turkey with Prometheus, Home Assistant, and Grafana
    1 project | reddit.com/r/programmingcirclejerk | 28 Nov 2021
    I think I found a github: https://github.com/NixOS/nixpkgs/pull/126326
  • Shall updatedb be run as a service by default?
    1 project | reddit.com/r/NixOS | 27 Nov 2021
    From nixos/modules/misc/locate.nix:
  • Can I install this application manually?
    3 projects | reddit.com/r/NixOS | 26 Nov 2021
    How can I "build wkhtmltopdf with patched Qt4" mentioned in https://github.com/NixOS/nixpkgs/pull/96379 ?
    3 projects | reddit.com/r/NixOS | 26 Nov 2021
    nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/pull/96379/head.tar.gz -p wkhtmltopdf
  • Linus Torvalds on why desktop Linux sucks
    9 projects | reddit.com/r/programming | 25 Nov 2021
    Yes, to add to what MaybeAStonedGuy is saying: Here's a recent (somewhat naive) check for the various rust crates that are packaged in nixpkgs: https://github.com/NixOS/nixpkgs/issues/141368
    9 projects | reddit.com/r/programming | 25 Nov 2021

What are some alternatives?

When comparing stack and nixpkgs you can also consider the following projects:

Cabal - Official upstream development repository for Cabal and cabal-install

asdf - Extendable version manager with support for Ruby, Node.js, Elixir, Erlang & more

Home Manager using Nix - Manage a user environment using Nix [[email protected]]

daedalus - The open source cryptocurrency wallet for ada, built to grow with the community

youtube-dl-gui - A cross-platform GUI for youtube-dl made in Electron and node.js

nonguix

HomeBrew - 🍺 The missing package manager for macOS (or Linux)

spack - A flexible package manager that supports multiple versions, configurations, platforms, and compilers.

devshell - Per project developer environments

git-lfs - Git extension for versioning large files

ghcid - Very low feature GHCi based IDE

bcachefs-script - Installs Ubuntu to a new disk using bcachefs as the root partition