commit 9026b8a5acc77337b8b15558efd9ca22b40f6232 Author: Wyatt J. Miller Date: Mon May 4 15:32:04 2026 -0400 initial commit diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..74784ff --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1777673416, + "narHash": "sha256-5c2POKPOjU40Kh0MirOdScBLG0bu9TAuPYAtPRNZMBs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "26ef669cffa904b6f6832ab57b77892a37c1a671", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "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..4aea42a --- /dev/null +++ b/flake.nix @@ -0,0 +1,15 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + }; + + outputs = { self, nixpkgs }: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { + inherit system; + }; + in { + packages.${system}.sable = pkgs.callPackage ./pkgs/sable.nix {}; + }; +} diff --git a/pkgs/sable.nix b/pkgs/sable.nix new file mode 100644 index 0000000..7c4a701 --- /dev/null +++ b/pkgs/sable.nix @@ -0,0 +1,62 @@ +{ + lib, + buildNpmPackage, + pnpm_10, + fetchPnpmDeps, + pnpmConfigHook, + nodejs_24, + fetchFromGitHub, +}: + +buildNpmPackage (finalAttrs: +let + pnpm = pnpm_10.override { + nodejs = nodejs_24; + }; +in { + pname = "sable-unwrapped"; + version = "1.14.0"; + + src = fetchFromGitHub { + owner = "SableClient"; + repo = "Sable"; + tag = "v${finalAttrs.version}"; + hash = "sha256-zoGKs0pm9m42JrTNAdU33LP139JlVz3RZnkTyY0aiqY="; + }; + + nodejs = nodejs_24; + + nativeBuildInputs = [ pnpm ]; + npmConfigHook = pnpmConfigHook; + + npmDeps = finalAttrs.pnpmDeps; + pnpmDeps = fetchPnpmDeps { + inherit (finalAttrs) pname version src; + inherit pnpm; + fetcherVersion = 3; + hash = "sha256-2GwUz0jsuVKQZyeidM0F4rDzijm9AFcAxN7x/m/b3Is="; + }; + + # Skip rebuilding native modules since they're not needed for the web app + npmInstallFlags = [ + "--ignore-scripts" + ]; + + installPhase = '' + runHook preInstall + + cp -r dist $out + + runHook postInstall + ''; + + meta = { + description = "An almost stable Matrix client"; + homepage = "https://app.sable.moe/"; + maintainers = with lib.maintainers; [ + wymillerlinux + ]; + license = lib.licenses.agpl3Only; + platforms = lib.platforms.all; + }; +})