mirror of
https://github.com/pabloaul/lsfg-vk-flake.git
synced 2025-08-27 19:06:28 -03:00
Compare commits
9 commits
unstable-2
...
main
Author | SHA1 | Date | |
---|---|---|---|
|
081cd66b13 | ||
|
cdcec1d2be | ||
|
754f64f7e4 | ||
|
caeeaf5b6d | ||
|
6e5f2362dc | ||
|
0fa0918ada | ||
|
dfdc7159e1 | ||
|
a796344ac2 | ||
|
0b57544e47 |
7 changed files with 135 additions and 91 deletions
|
@ -31,7 +31,10 @@ outputs = {nixpkgs, lsfg-vk-flake, ...}: {
|
||||||
|
|
||||||
And then enable this in your system config:
|
And then enable this in your system config:
|
||||||
```nix
|
```nix
|
||||||
services.lsfg-vk.enable = true;
|
services.lsfg-vk = {
|
||||||
|
enable = true;
|
||||||
|
ui.enable = true; # installs gui for configuring lsfg-vk
|
||||||
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
### User install (manual)
|
### User install (manual)
|
||||||
|
|
63
default.nix
63
default.nix
|
@ -1,63 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
fetchFromGitHub,
|
|
||||||
cmake,
|
|
||||||
ninja,
|
|
||||||
vulkan-headers,
|
|
||||||
vulkan-loader,
|
|
||||||
llvmPackages,
|
|
||||||
libXrandr,
|
|
||||||
libXinerama,
|
|
||||||
libXcursor,
|
|
||||||
libXi,
|
|
||||||
libglvnd,
|
|
||||||
libxkbcommon,
|
|
||||||
wayland-scanner,
|
|
||||||
pkg-config,
|
|
||||||
wayland,
|
|
||||||
}:
|
|
||||||
|
|
||||||
llvmPackages.stdenv.mkDerivation {
|
|
||||||
pname = "lsfg-vk";
|
|
||||||
version = "unstable-2025-07-24-c959c8f";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "PancakeTAS";
|
|
||||||
repo = "lsfg-vk";
|
|
||||||
rev = "c959c8f542e416a63d5436e47e1762e8c8074285";
|
|
||||||
hash = "sha256-/JS97I6OgzLAPzC1CbilQAx9B1T765aMa5Pr4dVyKzk=";
|
|
||||||
fetchSubmodules = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
cmakeFlags = [
|
|
||||||
"-DCMAKE_BUILD_TYPE=Release"
|
|
||||||
];
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
llvmPackages.clang-tools
|
|
||||||
llvmPackages.libllvm # needed for release builds
|
|
||||||
cmake
|
|
||||||
ninja
|
|
||||||
wayland-scanner
|
|
||||||
pkg-config
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
vulkan-headers
|
|
||||||
vulkan-loader
|
|
||||||
libXrandr
|
|
||||||
libXinerama
|
|
||||||
libXcursor
|
|
||||||
libXi
|
|
||||||
libglvnd
|
|
||||||
libxkbcommon
|
|
||||||
wayland
|
|
||||||
];
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "Vulkan layer for frame generation (Requires owning Lossless Scaling)";
|
|
||||||
homepage = "https://github.com/PancakeTAS/lsfg-vk/";
|
|
||||||
license = licenses.mit;
|
|
||||||
platforms = platforms.linux;
|
|
||||||
};
|
|
||||||
}
|
|
6
flake.lock
generated
6
flake.lock
generated
|
@ -2,11 +2,11 @@
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1752687322,
|
"lastModified": 1753694789,
|
||||||
"narHash": "sha256-RKwfXA4OZROjBTQAl9WOZQFm7L8Bo93FQwSJpAiSRvo=",
|
"narHash": "sha256-cKgvtz6fKuK1Xr5LQW/zOUiAC0oSQoA9nOISB0pJZqM=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "6e987485eb2c77e5dcc5af4e3c70843711ef9251",
|
"rev": "dc9637876d0dcc8c9e5e22986b857632effeb727",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -6,9 +6,11 @@
|
||||||
forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ];
|
forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
packages = forAllSystems (system:
|
packages = forAllSystems (system: {
|
||||||
{ default = nixpkgs.legacyPackages.${system}.callPackage ./default.nix { }; }
|
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 { };
|
||||||
|
});
|
||||||
|
|
||||||
nixosModules.default = import ./module.nix;
|
nixosModules.default = import ./module.nix;
|
||||||
};
|
};
|
||||||
|
|
54
lsfg-vk-ui.nix
Normal file
54
lsfg-vk-ui.nix
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
{
|
||||||
|
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
Normal file
44
lsfg-vk.nix
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
{
|
||||||
|
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 ];
|
||||||
|
};
|
||||||
|
}
|
46
module.nix
46
module.nix
|
@ -6,40 +6,41 @@
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.services.lsfg-vk;
|
cfg = config.services.lsfg-vk;
|
||||||
lsfg-vk = pkgs.callPackage ./default.nix { };
|
lsfg-vk = pkgs.callPackage ./lsfg-vk.nix { };
|
||||||
|
lsfg-vk-ui = pkgs.callPackage ./lsfg-vk-ui.nix { };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
services.lsfg-vk = {
|
services.lsfg-vk = {
|
||||||
enable = lib.mkEnableOption "Lossless Scaling Frame Generation Vulkan layer";
|
enable = lib.mkEnableOption "Lossless Scaling Frame Generation Vulkan layer";
|
||||||
|
|
||||||
|
ui.enable = lib.mkEnableOption "Enables a GUI for configuring lsfg-vk";
|
||||||
|
|
||||||
package = lib.mkOption {
|
package = lib.mkOption {
|
||||||
type = lib.types.package;
|
type = lib.types.package;
|
||||||
description = "The lsfg-vk package to use";
|
description = "The lsfg-vk package to use";
|
||||||
default = lsfg-vk;
|
default = lsfg-vk;
|
||||||
};
|
};
|
||||||
|
|
||||||
losslessDLLFile = lib.mkOption
|
losslessDLLFile = lib.mkOption {
|
||||||
{
|
type = with lib.types; nullOr str;
|
||||||
type = with lib.types; nullOr str;
|
default = null;
|
||||||
default = null;
|
example = "/home/user/games/Lossless Scaling/Lossless.dll";
|
||||||
example = "/home/user/games/Lossless Scaling/Lossless.dll";
|
description = ''
|
||||||
description = ''
|
Sets the LSFG_DLL_PATH environment variable.
|
||||||
Sets the LSFG_DLL_PATH environment variable.
|
Required if Lossless Scaling isn't installed in a standard location
|
||||||
Required if Lossless Scaling isn't installed in a standard location
|
'';
|
||||||
'';
|
};
|
||||||
};
|
|
||||||
|
|
||||||
configFile = lib.mkOption
|
configFile = lib.mkOption {
|
||||||
{
|
type = with lib.types; nullOr str;
|
||||||
type = with lib.types; nullOr str;
|
default = null;
|
||||||
default = null;
|
example = "/home/user/.config/lsfg-vk/conf.toml";
|
||||||
example = "/home/user/.config/lsfg-vk/conf.toml";
|
description = ''
|
||||||
description = ''
|
Sets the LSFG_CONFIG environment variable.
|
||||||
Sets the LSFG_CONFIG environment variable.
|
Required if the lsfg-vk configuration file isn't stored at the standard location
|
||||||
Required if the lsfg-vk configuration file isn't stored at the standard location
|
'';
|
||||||
'';
|
};
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -52,6 +53,9 @@ in
|
||||||
environment.etc."vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json".source =
|
environment.etc."vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json".source =
|
||||||
"${cfg.package}/share/vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json";
|
"${cfg.package}/share/vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json";
|
||||||
}
|
}
|
||||||
|
(lib.mkIf cfg.ui.enable {
|
||||||
|
environment.systemPackages = [ lsfg-vk-ui ];
|
||||||
|
})
|
||||||
(lib.mkIf (cfg.losslessDLLFile != null) {
|
(lib.mkIf (cfg.losslessDLLFile != null) {
|
||||||
environment.sessionVariables.LSFG_DLL_PATH =
|
environment.sessionVariables.LSFG_DLL_PATH =
|
||||||
lib.warn "losslessDLLFile is deprecated and will only be used by lsfg-vk if LSFG_LEGACY is set."
|
lib.warn "losslessDLLFile is deprecated and will only be used by lsfg-vk if LSFG_LEGACY is set."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue