添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
刚毅的围巾  ·  Collabra online not ...·  3 月前    · 
飞奔的柚子  ·  GuzzleHttp\Exception\C ...·  3 月前    · 
爱笑的帽子  ·  api_hangup_hook=system ...·  3 月前    · 
气宇轩昂的热水瓶  ·  Who can help me ...·  1 月前    · 
玩滑板的黄花菜  ·  测试 CORS - Amazon ...·  2 周前    · 
刚分手的鸡蛋  ·  Página de buscas do ...·  7 月前    · 
坐怀不乱的椰子  ·  书法字体_百度百科·  2 年前    · 

I am aware of the security issues and general flaws.

Anyways, what is the best way to package such a software?
I am generally new to packaging things and would love to learn it for once.

Specifically, I want to package https://ollama.ai

For ollama, you can see from https://github.com/jmorganca/ollama/blob/325cfcd9ffa8c5e19c7258471a864dcd8508d49a/docs/linux.md that it can be installed by downloading a binary and putting that binary in the right directory. So something like the derivation below should work for a quick trial. (But it’s probably better to try and build it from source.)

{ fetchurl, lib, stdenv, autoPatchelfHook }:
stdenv.mkDerivation rec {
  pname = "ollama";
  version = "0.1"; #Change this!
  src = fetchurl {
    url = "https://ollama.ai/download/ollama-linux-amd64";
    hash = "sha256-WxRimPMHV2qbePUu9EVniApXy2NrLK97LsXO+Burdkk=";
  nativeBuildInputs = [
    autoPatchelfHook
  dontUnpack = true;
  dontBuild = true;
  dontConfigure = true;
  installPhase = ''
    mkdir -p $out/bin
    install -m755 -D $src $out/bin/ollama
  meta = with lib; {
    homepage = "https://ollama.ai/";
    description = "Enter Something Here";
    platforms = platforms.linux;

You may have to add some libraries to buildInputs, though. For packaging binaries, you can also consult this: Packaging/Binaries - NixOS Wiki

It might still be useful to create an ollama-bin package, though! As you can see in this update request, it is sometimes difficult to build a project properly, which can delay updates. Having a binary package that doesn’t use nix to build the program but just ships the exact binary that the maintainer built can be useful as a workaround in such cases. Additionally, it can be helpful when debugging problems in the from-source package by comparing its behavior to the binary package.

So if you want to still have a go at this, feel free to do so!

Speaking of ollama, as I wanted to try this soon. I believe the binary package does not come with support for AMD ROCm built it. I think it would be nice, at least for me, to have an ollama-rocm version ready as well.

Edit: Could you @maixnor link your PR maybe?