Skip to content

[Discussion] Nix Packaging #162

@snoweuph

Description

@snoweuph

If any other nixer stumbles other this.
How would you approach wrapping this?

{
  lib,
  fetchFromGitHub,
  buildNpmPackage,
}:
buildNpmPackage {
  pname = "sable";
  version = "1.6.0";

  src = fetchFromGitHub {
    owner = "SableClient";
    repo = "Sable";
    rev = "v1.6.0";
    sha256 = "sha256-q4POD5YQFPwfg79O3dzidU20wUmUNz6933l6RGH3/Eg=";
  };
  npmDepsHash = "sha256-EZr37RQuDCWCK0lBQPTa2knZ3x1jhK6Fr/SQwgiulG0=";
  npmFlags = ["--ignore-scripts"];
  buildNpmPackage = "build";

  installPhase = ''
    mkdir -p $out/lib/sable
    cp -r dist/. $out/lib/sable

    mkdir -p $out/bin
    cat > $out/bin/sable << 'EOF'
    #!/bin/sh
    echo "TODO: write some wrapper :/"
    EOF
    chmod +x $out/bin/sable
  '';

  meta = with lib; {
    description = "Sable Matrix Client";
    homepage = "https://github.com/SableClient/Sable";
    license = licenses.agpl3Only;
    platforms = platforms.all;
  };
}

Prolly should use electron or tauri 👀

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions