diff --git a/README.md b/README.md index e5218cb..f99b4ff 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,16 @@ # lsfg-vk-flake -Nix flake for using [Lossless Scaling's frame generation on Linux](https://github.com/PancakeTAS/lsfg-vk) +Nix flake for using bleeding edge [Lossless Scaling's frame generation on Linux](https://github.com/PancakeTAS/lsfg-vk) >[!IMPORTANT] > You need to have Lossless Scaling installed on Steam! > In case it is not installed on the default Steam drive, you may want to consider setting the correct path in the lsfg-vk config. ## Installation + +>[!NOTE] +> Nixpgks has packages for lsfg-vk & lsfg-vk-ui. This Flake provides packaging of the lsfg-vk Git repository. +> It's recommended to use the packages from nixpkgs. + ### System-wide (NixOS) This approach will install an implicit layer to ``/etc/vulkan/implicit_layer.d/`` diff --git a/flake.lock b/flake.lock index 483d30d..b5ed688 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,23 @@ { "nodes": { + "lsfg-vk": { + "flake": false, + "locked": { + "lastModified": 1754586429, + "narHash": "sha256-4kEl+N2f4TSNw4QsRT4hFEN3zRREaeZdnD9ksG4uCPY=", + "ref": "refs/heads/develop", + "rev": "2f488a42efb1ab2188b04c41ee558c0989f5afed", + "revCount": 266, + "submodules": true, + "type": "git", + "url": "https://github.com/PancakeTAS/lsfg-vk.git" + }, + "original": { + "submodules": true, + "type": "git", + "url": "https://github.com/PancakeTAS/lsfg-vk.git" + } + }, "nixpkgs": { "locked": { "lastModified": 1754498491, @@ -18,6 +36,7 @@ }, "root": { "inputs": { + "lsfg-vk": "lsfg-vk", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 663cf94..17452d9 100644 --- a/flake.nix +++ b/flake.nix @@ -1,15 +1,41 @@ { - inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - outputs = { nixpkgs, ... }: + lsfg-vk = { + url = "git+https://github.com/PancakeTAS/lsfg-vk.git?submodules=1"; + flake = false; + }; + }; + + outputs = { nixpkgs, lsfg-vk, ... }@inputs: let forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ]; - in + in { - packages = forAllSystems (system: { - default = nixpkgs.legacyPackages.${system}.callPackage ./lsfg-vk.nix { }; - lsfg-vk = nixpkgs.legacyPackages.${system}.callPackage ./lsfg-vk.nix { }; - lsfg-vk-ui = nixpkgs.legacyPackages.${system}.callPackage ./lsfg-vk-ui.nix { }; + packages = forAllSystems (system: let + pkgs = nixpkgs.legacyPackages.${system}; + inherit (nixpkgs) lib; + + version = lib.substring 0 8 inputs.lsfg-vk.lastModifiedDate; + + lsfg-vk = pkgs.lsfg-vk.overrideAttrs(old: { + inherit version; + src = inputs.lsfg-vk; + }); + + lsfg-vk-ui = pkgs.lsfg-vk-ui.overrideAttrs(old: { + inherit version; + src = inputs.lsfg-vk; + cargoHash = ""; + cargoDeps = pkgs.rustPlatform.importCargoLock { + lockFile = "${inputs.lsfg-vk}/ui/Cargo.lock"; + }; + }); + in { + default = lsfg-vk; + lsfg-vk = lsfg-vk; + lsfg-vk-ui = lsfg-vk-ui; }); nixosModules.default = import ./module.nix; diff --git a/lsfg-vk-ui.nix b/lsfg-vk-ui.nix deleted file mode 100644 index 700eb7a..0000000 --- a/lsfg-vk-ui.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ - lib, - fetchFromGitHub, - rustPlatform, - pkg-config, - glib, - pango, - gdk-pixbuf, - gtk4, - libadwaita, -}: - -rustPlatform.buildRustPackage rec { - pname = "lsfg-vk-ui"; - version = "1.0.0"; - - src = fetchFromGitHub { - owner = "PancakeTAS"; - repo = "lsfg-vk"; - tag = "v${version}"; - hash = "sha256-nIyVOil/gHC+5a+sH3vMlcqVhixjJaGWqXbyoh2Nqyw="; - }; - - cargoHash = "sha256-hIQRS/egIDU5Vu/1KWHtpt4S26h+9GadVr+lBAG2LDg="; - - sourceRoot = "source/ui"; - - nativeBuildInputs = [ - pkg-config - glib - ]; - - buildInputs = [ - pango - gdk-pixbuf - gtk4 - libadwaita - ]; - - postInstall = '' - install -Dm444 $src/ui/rsc/gay.pancake.lsfg-vk-ui.desktop $out/share/applications/gay.pancake.lsfg-vk-ui.desktop - install -Dm444 $src/ui/rsc/icon.png $out/share/icons/hicolor/256x256/apps/gay.pancake.lsfg-vk-ui.png - ''; - - meta = { - description = "Graphical configuration interface for lsfg-vk"; - homepage = "https://github.com/PancakeTAS/lsfg-vk/"; - changelog = "https://github.com/PancakeTAS/lsfg-vk/releases/tag/${src.tag}"; - license = lib.licenses.mit; - platforms = lib.platforms.linux; - maintainers = with lib.maintainers; [ pabloaul ]; - mainProgram = "lsfg-vk-ui"; - }; -} \ No newline at end of file diff --git a/lsfg-vk.nix b/lsfg-vk.nix deleted file mode 100644 index 63e494c..0000000 --- a/lsfg-vk.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ - lib, - fetchFromGitHub, - cmake, - vulkan-headers, - llvmPackages, -}: - -llvmPackages.stdenv.mkDerivation rec { - pname = "lsfg-vk"; - version = "1.0.0"; - - src = fetchFromGitHub { - owner = "PancakeTAS"; - repo = "lsfg-vk"; - tag = "v${version}"; - hash = "sha256-hWpuPH7mKbeMaLaRUwtlkNLy4lOnJEe+yd54L7y2kV0="; - fetchSubmodules = true; - }; - - postPatch = '' - substituteInPlace VkLayer_LS_frame_generation.json \ - --replace-fail "liblsfg-vk.so" "$out/lib/liblsfg-vk.so" - ''; - - nativeBuildInputs = [ - llvmPackages.clang-tools - llvmPackages.libllvm - cmake - ]; - - buildInputs = [ - vulkan-headers - ]; - - meta = { - description = "Vulkan layer for frame generation (Requires owning Lossless Scaling)"; - homepage = "https://github.com/PancakeTAS/lsfg-vk/"; - changelog = "https://github.com/PancakeTAS/lsfg-vk/releases/tag/${src.tag}"; - license = lib.licenses.mit; - platforms = lib.platforms.linux; - maintainers = with lib.maintainers; [ pabloaul ]; - }; -} \ No newline at end of file