diff --git a/.gitignore b/.gitignore index 3784c0cf..b4007885 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ dist-ssr *.sln *.sw? release/** +/result *.kiro/ # npx electron-builder --mac --win .tmp/ diff --git a/README.md b/README.md index 6895f037..db54ac60 100644 --- a/README.md +++ b/README.md @@ -177,6 +177,45 @@ https://github.com/webadderallorg/Recordly/releases --- +## Nix (flakes) + +Install the stable release packaged by this flake: + +```bash +nix profile install github:webadderallorg/Recordly#recordly +``` + +Or launch it directly: + +```bash +nix run github:webadderallorg/Recordly#recordly +``` + +The flake currently packages Recordly `v1.2.1` from release artifacts and provides packages for `aarch64-darwin`, `x86_64-darwin`, and `x86_64-linux`. + +For nix-darwin, add Recordly as an input and include the package in your system packages: + +```nix +{ + inputs.recordly.url = "github:webadderallorg/Recordly"; + + outputs = { recordly, ... }@inputs: { + darwinConfigurations.your-host = inputs.nix-darwin.lib.darwinSystem { + system = "aarch64-darwin"; + modules = [ + ({ pkgs, ... }: { + environment.systemPackages = [ + recordly.packages.${pkgs.stdenv.hostPlatform.system}.default + ]; + }) + ]; + }; + }; +} +``` + +--- + ## Arch Linux / Manjaro (yay) Install from the AUR ([recordly-bin](https://aur.archlinux.org/packages/recordly-bin)): diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..94e0bfb0 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1778869304, + "narHash": "sha256-30sZNZoA1cqF5JNO9fVX+wgiQYjB7HJqqJ4ztCDeBZE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d233902339c02a9c334e7e593de68855ad26c4cb", + "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 00000000..f7a63b5b --- /dev/null +++ b/flake.nix @@ -0,0 +1,75 @@ +{ + description = "Recordly Nix packages"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + outputs = + { self, nixpkgs }: + let + version = "1.2.1"; + + systems = [ + "aarch64-darwin" + "x86_64-darwin" + "x86_64-linux" + ]; + + forAllSystems = nixpkgs.lib.genAttrs systems; + + releaseHashes = { + aarch64-darwin = { + arch = "arm64"; + extension = "zip"; + hash = "sha256-0Mk+ha3n2RA9LtwdoCele82666a4NCLylMruTFGS7C4="; + }; + x86_64-darwin = { + arch = "x64"; + extension = "zip"; + hash = "sha256-PRG1DOX9sy9AJCC1/haEWlcNGkBiO9zicf9ng6Ix8fw="; + }; + x86_64-linux = { + arch = "linux-x64"; + extension = "AppImage"; + hash = "sha256-r+yUa1XuDnNQISSXE8AyFPC8uWlYkzPL+w85O0XaVPM="; + }; + }; + in + { + packages = forAllSystems ( + system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + recordly = pkgs.callPackage ./nix/package.nix { + inherit version releaseHashes; + }; + default = self.packages.${system}.recordly; + } + ); + + apps = forAllSystems ( + system: + let + pkgs = import nixpkgs { inherit system; }; + recordly = self.packages.${system}.recordly; + in + { + recordly = { + type = "app"; + program = + if pkgs.stdenvNoCC.hostPlatform.isDarwin then + "${pkgs.writeShellScript "recordly" '' + exec /usr/bin/open ${recordly}/Applications/Recordly.app --args "$@" + ''}" + else + "${recordly}/bin/recordly"; + meta.description = "Launch Recordly"; + }; + default = self.apps.${system}.recordly; + } + ); + }; +} diff --git a/nix/package.nix b/nix/package.nix new file mode 100644 index 00000000..56822467 --- /dev/null +++ b/nix/package.nix @@ -0,0 +1,63 @@ +{ + lib, + stdenvNoCC, + fetchurl, + unzip, + appimageTools, + version, + releaseHashes, +}: +let + source = + releaseHashes.${stdenvNoCC.hostPlatform.system} + or (throw "Recordly is packaged for aarch64-darwin, x86_64-darwin, and x86_64-linux"); + + src = fetchurl { + url = "https://github.com/webadderallorg/Recordly/releases/download/v${version}/Recordly-${source.arch}.${source.extension}"; + hash = source.hash; + }; + + meta = { + description = "Open-source screen recorder and editor for polished product demos"; + homepage = "https://www.recordly.dev"; + changelog = "https://github.com/webadderallorg/Recordly/releases/tag/v${version}"; + license = lib.licenses.agpl3Only; + platforms = [ + "aarch64-darwin" + "x86_64-darwin" + "x86_64-linux" + ]; + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; + }; +in +if stdenvNoCC.hostPlatform.isDarwin then + stdenvNoCC.mkDerivation { + pname = "recordly"; + inherit version src meta; + + nativeBuildInputs = [ + unzip + ]; + + dontConfigure = true; + dontBuild = true; + dontFixup = true; + + unpackPhase = '' + runHook preUnpack + unzip -q "$src" + runHook postUnpack + ''; + + installPhase = '' + runHook preInstall + mkdir -p "$out/Applications" + cp -R Recordly.app "$out/Applications/" + runHook postInstall + ''; + } +else + appimageTools.wrapType2 { + pname = "recordly"; + inherit version src meta; + }