diff --git a/.gitignore b/.gitignore index 3cb44c3..69a098c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ # ---> Nix # Ignore build outputs from performing a nix-build or `nix build` command -result -result-* +**/result +**/result-* # Ignore automatically generated direnv output -.direnv +**/.direnv diff --git a/looking-glass/client.nix b/looking-glass/client.nix new file mode 100644 index 0000000..4e50854 --- /dev/null +++ b/looking-glass/client.nix @@ -0,0 +1,59 @@ +{ + stdenv, + fetchFromGitHub, + cmake, + pkg-config, + wayland-scanner, + fontconfig, + expat, + wayland, + libxkbcommon, + libGL, + pipewire, + libsamplerate, + spice-protocol, + nettle, + libffi, + libx11, +}: + +stdenv.mkDerivation { + pname = "looking-glass"; + version = "4bb2c58fb6d0df9e863ad45924dd4decc7e9cf4e"; + + src = fetchFromGitHub { + owner = "gnif"; + repo = "LookingGlass"; + rev = "4bb2c58fb6d0df9e863ad45924dd4decc7e9cf4e"; + hash = "sha256-Dc0sFnJVM0xJ0FfIQqGQKxFUj6mhp3qgB772h3Dgowc"; + fetchSubmodules = true; + leaveDotGit = false; + }; + + + nativeBuildInputs = [ cmake pkg-config wayland-scanner ]; + buildInputs = [ + fontconfig + expat + wayland + libxkbcommon + libGL + pipewire + libsamplerate + spice-protocol + nettle + libffi + libx11 + ]; + + cmakeDir = "../client"; + + cmakeFlags = [ + "-DENABLE_BACKTRACE=no" + "-DENABLE_WAYLAND=yes" + "-DENABLE_PIPEWIRE=yes" + "-DENABLE_PULSEAUDIO=no" + "-DENABLE_X11=no" + "-DOPTIMIZE_FOR_NATIVE=x86-64-v3" + ]; +} diff --git a/looking-glass/default.nix b/looking-glass/default.nix new file mode 100644 index 0000000..00b2970 --- /dev/null +++ b/looking-glass/default.nix @@ -0,0 +1,7 @@ +let + nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-26.05"; + pkgs = import nixpkgs { config = {}; overlays = []; }; +in +{ + client = pkgs.callPackage ./client.nix { }; +}