home: add lsfg-vk module

This commit is contained in:
Leonardo Eugênio 2025-07-14 19:38:20 -03:00
parent ef01024a9f
commit 3156f59c26
No known key found for this signature in database
GPG key ID: 2F8F21CE8721456B
8 changed files with 120 additions and 12 deletions

36
user/lsfg-vk/default.nix Normal file
View file

@ -0,0 +1,36 @@
{ pkgs, config, ... }:
let
LosslessDllPath = config.home.homeDirectory + "/.local/lib/Lossless.dll";
in
{
home.file = {
".local/share/vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json".source =
"${pkgs.lsfg-vk}/share/vulkan/implicit_layer.d/VkLayer_LS_frame_generation.json";
".local/lib/liblsfg-vk.so".source = "${pkgs.lsfg-vk}/lib/liblsfg-vk.so";
};
home.sessionVariables = {
# ENABLE_LSFG = 1; # Don't enable session wide, to avoid bugs
LSFG_MULTIPLIER = 2;
LSFG_DLL_PATH = LosslessDllPath;
};
# Put the dll in a reachable location for steam games
# Secrets normally are a symlink to /run/user/1000/secrets.d/
# Every time sops-nix.service runs, we copy the dll
systemd.user.services.copy-lsfg-dll = {
Service = {
ExecStart = pkgs.writeShellScript "copy-lsfg-dll" ''
cp -fv "${config.sops.secrets."lsfg.dll".path}" "${LosslessDllPath}"
'';
Type = "oneshot";
};
Unit.After = [ "sops-nix.service" ];
Install.WantedBy = [ "sops-nix.service" ];
};
sops.secrets."lsfg.dll" = {
sopsFile = ../../secrets/lsfg.dll.gpg;
format = "binary";
};
}