mirror of
https://github.com/pabloaul/lsfg-vk-flake.git
synced 2025-08-27 10:56:29 -03:00
lsfg-vk-ui: init
This commit is contained in:
parent
0b57544e47
commit
a796344ac2
4 changed files with 82 additions and 24 deletions
|
@ -6,9 +6,11 @@
|
|||
forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ];
|
||||
in
|
||||
{
|
||||
packages = forAllSystems (system:
|
||||
{ default = nixpkgs.legacyPackages.${system}.callPackage ./default.nix { }; }
|
||||
);
|
||||
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 { };
|
||||
});
|
||||
|
||||
nixosModules.default = import ./module.nix;
|
||||
};
|
||||
|
|
47
lsfg-vk-ui.nix
Normal file
47
lsfg-vk-ui.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
rustPlatform,
|
||||
pkg-config,
|
||||
glib,
|
||||
pango,
|
||||
gdk-pixbuf,
|
||||
gtk4,
|
||||
libadwaita
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "lsfg-vk-ui";
|
||||
version = "unstable-2025-07-25-e8f8056";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "PancakeTAS";
|
||||
repo = "lsfg-vk";
|
||||
rev = "e8f805632307ab526a989b33dcf9653c5679d374";
|
||||
hash = "sha256-3EmH8skhpa0ELYE3UoV2SanGUqjC9nu8IPE3JPny+V4=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-EMVDcThepj8Lq42NBxROPUin94TikUdwR/wTVXn2tI0=";
|
||||
|
||||
sourceRoot = "source/ui";
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
glib
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
pango
|
||||
gdk-pixbuf
|
||||
gtk4
|
||||
libadwaita
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Graphical interface for lsfg-vk";
|
||||
homepage = "https://github.com/PancakeTAS/lsfg-vk/";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.linux;
|
||||
mainProgram = "lsfg-vk-ui";
|
||||
};
|
||||
}
|
|
@ -18,6 +18,11 @@ llvmPackages.stdenv.mkDerivation {
|
|||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace VkLayer_LS_frame_generation.json \
|
||||
--replace "liblsfg-vk.so" "$out/lib/liblsfg-vk.so"
|
||||
'';
|
||||
|
||||
cmakeFlags = [
|
||||
"-DCMAKE_BUILD_TYPE=Release"
|
||||
];
|
14
module.nix
14
module.nix
|
@ -6,21 +6,23 @@
|
|||
}:
|
||||
let
|
||||
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
|
||||
{
|
||||
options = {
|
||||
services.lsfg-vk = {
|
||||
enable = lib.mkEnableOption "Lossless Scaling Frame Generation Vulkan layer";
|
||||
|
||||
ui.enable = lib.mkEnableOption "Enables a GUI for configuring lsfg-vk";
|
||||
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
description = "The lsfg-vk package to use";
|
||||
default = lsfg-vk;
|
||||
};
|
||||
|
||||
losslessDLLFile = lib.mkOption
|
||||
{
|
||||
losslessDLLFile = lib.mkOption {
|
||||
type = with lib.types; nullOr str;
|
||||
default = null;
|
||||
example = "/home/user/games/Lossless Scaling/Lossless.dll";
|
||||
|
@ -30,8 +32,7 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
configFile = lib.mkOption
|
||||
{
|
||||
configFile = lib.mkOption {
|
||||
type = with lib.types; nullOr str;
|
||||
default = null;
|
||||
example = "/home/user/.config/lsfg-vk/conf.toml";
|
||||
|
@ -52,6 +53,9 @@ in
|
|||
environment.etc."vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json".source =
|
||||
"${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) {
|
||||
environment.sessionVariables.LSFG_DLL_PATH =
|
||||
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