From 059a9acc25852fcfd72812214e47baf26b7659c8 Mon Sep 17 00:00:00 2001 From: Ales Tanglmajer Date: Fri, 26 Jun 2026 16:47:08 +0200 Subject: [PATCH] initial commit --- .gitignore | 1 + flake.lock | 27 ++++++++++++++++++++++ flake.nix | 14 ++++++++++++ package.nix | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 106 insertions(+) create mode 100644 .gitignore create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 package.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2be92b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..2efb005 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1782233679, + "narHash": "sha256-QyuGP5+QOtmXpy4i2X4DhBVBaySBdDKQEhqKcphcp34=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "667d5cf1c59585031d743c78b394b0a647537c35", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-26.05", + "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..ce90906 --- /dev/null +++ b/flake.nix @@ -0,0 +1,14 @@ +{ + description = "Oryxis - A modern SSH client built entirely in Rust. Fast, encrypted, native."; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05"; + }; + + outputs = { self, nixpkgs }: { + packages.x86_64-linux.oryxis = + nixpkgs.legacyPackages.x86_64-linux.callPackage ./package.nix {}; + + packages.x86_64-linux.default = self.packages.x86_64-linux.oryxis; + }; +} diff --git a/package.nix b/package.nix new file mode 100644 index 0000000..c8d9cc9 --- /dev/null +++ b/package.nix @@ -0,0 +1,64 @@ +{ lib +, rustPlatform +, fetchFromGitHub +, pkg-config +, makeWrapper +, openssl +, gtk3 +, wayland +, libxkbcommon +, libGL +, vulkan-loader +, libx11 +, libxcursor +, libxrandr +, libxi +}: + +let + runtimeLibs = [ + wayland + libxkbcommon + libGL + vulkan-loader + libx11 + libxcursor + libxrandr + libxi + ]; +in +rustPlatform.buildRustPackage rec { + pname = "oryxis"; + version = "0.8.2"; + + src = fetchFromGitHub { + owner = "wilsonglasser"; + repo = "oryxis"; + rev = "v${version}"; + hash = "sha256-lc8tUUiH6DzGgKQHFPA7WkuCaOGQTSzddUeAwyazK+c="; + }; + + cargoHash = "sha256-6PWrHvXU9r9b3/4LZtYgHmg+5qBz6IDriLf8Kc5xhLE="; + + nativeBuildInputs = [ + pkg-config + makeWrapper + ]; + + buildInputs = [ + openssl + gtk3 + wayland + libxkbcommon + ]; + + # Use the system openssl (from buildInputs) rather than vendoring it. + OPENSSL_NO_VENDOR = 1; + + postFixup = '' + for bin in $out/bin/*; do + wrapProgram "$bin" \ + --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeLibs}" + done + ''; +}