mirror of
				https://github.com/pabloaul/lsfg-vk-flake.git
				synced 2025-11-03 23:27:36 -03:00 
			
		
		
		
	Package Git versions of lsfg-vk
This commit is contained in:
		
							parent
							
								
									66f70e571a
								
							
						
					
					
						commit
						1e875f1d9a
					
				
					 5 changed files with 58 additions and 106 deletions
				
			
		| 
						 | 
				
			
			@ -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/``
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										19
									
								
								flake.lock
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										19
									
								
								flake.lock
									
										
									
										generated
									
									
									
								
							| 
						 | 
				
			
			@ -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"
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										40
									
								
								flake.nix
									
										
									
									
									
								
							
							
						
						
									
										40
									
								
								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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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";
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										44
									
								
								lsfg-vk.nix
									
										
									
									
									
								
							
							
						
						
									
										44
									
								
								lsfg-vk.nix
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -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 ];
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue