Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is there a give I to do this easily and is does it work on m1 MacBooks? I love asdf but the idea of what you said sounds great! How painless is it?


It does work on m1, you might run into more issues compared to intel based Macs though. I wouldn't call nix painless. It might take some time to figure out the packages required, proper env variables to setup etc. But, once somebody in the team figures out the details, it will likely work for everyone in the team and others don't have to go through same pain. The whole setup is isolated to a single project and will not affect other projects. The setup for a old rails project pinned to a ruby version with few dependencies might look like below

    let
      pkgs = import (builtins.fetchTarball {
        url =
          "https://github.com/NixOS/nixpkgs/archive/c92ca95afb5043bc6faa0d526460584eccff2277.tar.gz";
      }) { };
    in pkgs.mkShell {
      nativeBuildInputs = [
        pkgs.ruby_2_6
        pkgs.shared-mime-info
        pkgs.mysql
        pkgs.libmysqlclient
        pkgs.imagemagick6.dev
        pkgs.pkg-config
        pkgs.cmake
      ];

      PKG_CONFIG_PATH = "${pkgs.imagemagick6.dev}/lib/pkgconfig";

      FREEDESKTOP_MIME_TYPES_PATH =
        "${pkgs.shared_mime_info}/share/mime/packages/freedesktop.org.xml";
    }




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: