From c88ac624f0e1b5fd3ba28bb63e89c3b075c618dc Mon Sep 17 00:00:00 2001 From: adisbladis Date: Mon, 21 Jul 2025 16:00:26 +1200 Subject: [PATCH 1/2] module.nix: Don't warn when declaring option The option is _always_ evaluated and therefore the warning is always output, even if your configuration is unaffected. This refactors the module to: - Only create env vars if their config is actually declared - Stick the warning in the config declaration instead of the option --- module.nix | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/module.nix b/module.nix index 92ab300..19bc424 100644 --- a/module.nix +++ b/module.nix @@ -19,9 +19,7 @@ in default = lsfg-vk; }; - losslessDLLFile = - lib.warn "losslessDLLFile is deprecated and will only be used by lsfg-vk if LSFG_LEGACY is set." - lib.mkOption + losslessDLLFile = lib.mkOption { type = with lib.types; nullOr str; default = null; @@ -45,15 +43,23 @@ in }; }; - config = lib.mkIf cfg.enable { - environment.systemPackages = [ cfg.package ]; + config = lib.mkIf cfg.enable ( + lib.mkMerge [ + { + environment.systemPackages = [ cfg.package ]; - # Installs the Vulkan implicit layer system-wide - environment.etc."vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json".source = - "${cfg.package}/share/vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json"; - - environment.sessionVariables.LSFG_DLL_PATH = lib.mkIf (cfg.losslessDLLFile != null) cfg.losslessDLLFile; - - environment.sessionVariables.LSFG_CONFIG = lib.mkIf (cfg.configFile != null) cfg.configFile; - }; + # Installs the Vulkan implicit layer system-wide + 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.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." + cfg.losslessDLLFile; + }) + (lib.mkIf (cfg.configFile != null) { + environment.sessionVariables.LSFG_CONFIG = cfg.configFile; + }) + ] + ); } From 12763fb704c4d5dc24661eb4be8d3ffde04bea2e Mon Sep 17 00:00:00 2001 From: Nojus Date: Mon, 21 Jul 2025 14:15:42 +0200 Subject: [PATCH 2/2] default.nix: update lsfg-vk to e67fcd3 spirv-headers got vendored? huh --- default.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/default.nix b/default.nix index 07fa9d5..124b747 100644 --- a/default.nix +++ b/default.nix @@ -6,7 +6,6 @@ vulkan-headers, vulkan-loader, llvmPackages, - spirv-headers, libX11, libXrandr, libXinerama, @@ -21,13 +20,13 @@ llvmPackages.stdenv.mkDerivation { pname = "lsfg-vk"; - version = "unstable-2025-07-19-dd5190a"; + version = "unstable-2025-07-20-e67fcd3"; src = fetchFromGitHub { owner = "PancakeTAS"; repo = "lsfg-vk"; - rev = "dd5190aa680a7543143e724a100bd5d6e9898dd7"; - hash = "sha256-2WrUtjUG8l3tSElDYfhvi4lrFUG1Oh5M7DAEX2mFh5s="; + rev = "e67fcd3dd832c9d177ad2be780e5dd0e47810bdf"; + hash = "sha256-c0anP3lWJ2GcjJNGIHcY/sS86AS1tFk0t7vXbaEGTQg="; fetchSubmodules = true; }; @@ -49,7 +48,6 @@ llvmPackages.stdenv.mkDerivation { buildInputs = [ vulkan-headers vulkan-loader - spirv-headers libX11 libXrandr libXinerama