From 6dfedac316807f545b6151b7ece776f3e318164d Mon Sep 17 00:00:00 2001 From: illuc Date: Sun, 15 Mar 2026 23:44:51 +0200 Subject: [PATCH] files! --- default.nix | 46 ++++++++++++++++++++++++++++++++++++++++++++++ flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 30 ++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 default.nix create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..7e45cde --- /dev/null +++ b/default.nix @@ -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"; + }; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..729409a --- /dev/null +++ b/flake.lock @@ -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 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..4d9c2ec --- /dev/null +++ b/flake.nix @@ -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 { }; + } + ); + }; +}