home: add lsfg-vk module
This commit is contained in:
parent
ef01024a9f
commit
3156f59c26
8 changed files with 120 additions and 12 deletions
36
user/lsfg-vk/default.nix
Normal file
36
user/lsfg-vk/default.nix
Normal 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";
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue