This commit is contained in:
illuc 2026-03-15 23:44:51 +02:00
parent 33866c2eb9
commit 6dfedac316
3 changed files with 103 additions and 0 deletions

46
default.nix Normal file
View file

@ -0,0 +1,46 @@
{
lib,
buildNpmPackage,
fetchFromGitHub,
electron,
makeWrapper,
}:
buildNpmPackage rec {
pname = "sable-client-electron";
version = "latest";
src = fetchFromGitHub {
owner = "7w1";
repo = "Sable-Client-Electron";
rev = "master";
hash = "sha256-oI8dr8Ud5+by2oJYUZ+OS/HDFkBIcyuqDZ59M5hM118=";
};
npmDepsHash = "sha256-XawYnHHuAS4HbsQYKhRQ0qPeZom7KB/2sw4GMFq5C9s=";
nativeBuildInputs = [ makeWrapper ];
npmFlags = [ "--ignore-scripts" ];
dontNpmBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/lib/sable-client
cp -r . $out/lib/sable-client
makeWrapper ${electron}/bin/electron $out/bin/sable-client \
--add-flags $out/lib/sable-client/main.js
runHook postInstall
'';
meta = with lib; {
description = "Electron wrapper for Sable Matrix Client";
homepage = "https://github.com/7w1/Sable-Client-Electron";
platforms = platforms.linux;
mainProgram = "sable-client";
};
}

27
flake.lock generated Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1773389992,
"narHash": "sha256-wvfdLLWJ2I9oEpDd9PfMA8osfIZicoQ5MT1jIwNs9Tk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c06b4ae3d6599a672a6210b7021d699c351eebda",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

30
flake.nix Normal file
View file

@ -0,0 +1,30 @@
{
description = "Sable Client Electron";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{ self, nixpkgs }:
let
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
in
{
packages = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = pkgs.callPackage ./default.nix { };
}
);
};
}