mirror of
https://github.com/pabloaul/lsfg-vk-flake.git
synced 2025-08-27 19:06:28 -03:00
NixOS module: Remove
With an instruction on how to migrate usage over to `systemPackages`.
This commit is contained in:
parent
081cd66b13
commit
66f70e571a
3 changed files with 27 additions and 78 deletions
18
README.md
18
README.md
|
@ -6,10 +6,10 @@ Nix flake for using [Lossless Scaling's frame generation on Linux](https://githu
|
||||||
> In case it is not installed on the default Steam drive, you may want to consider setting the correct path in the lsfg-vk config.
|
> In case it is not installed on the default Steam drive, you may want to consider setting the correct path in the lsfg-vk config.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
### System-wide (NixOS module)
|
### System-wide (NixOS)
|
||||||
This approach will install an implicit layer to ``/etc/vulkan/implicit_layer.d/``
|
This approach will install an implicit layer to ``/etc/vulkan/implicit_layer.d/``
|
||||||
|
|
||||||
Add this to your flake inputs, output function and modules list:
|
Add this to your flake inputs, output function and configuration:
|
||||||
```nix
|
```nix
|
||||||
inputs = {
|
inputs = {
|
||||||
...
|
...
|
||||||
|
@ -21,22 +21,14 @@ outputs = {nixpkgs, lsfg-vk-flake, ...}: {
|
||||||
|
|
||||||
nixosConfigurations.hostname = nixpkgs.lib.nixosSystem {
|
nixosConfigurations.hostname = nixpkgs.lib.nixosSystem {
|
||||||
...
|
...
|
||||||
modules = [
|
environment.systemPackages = [
|
||||||
...
|
lsfg-vk-flake.packages.${system}.lsfg-vk
|
||||||
lsfg-vk-flake.nixosModules.default
|
lsfg-vk-flake.packages.${system}.lsfg-vk-ui
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
And then enable this in your system config:
|
|
||||||
```nix
|
|
||||||
services.lsfg-vk = {
|
|
||||||
enable = true;
|
|
||||||
ui.enable = true; # installs gui for configuring lsfg-vk
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
### User install (manual)
|
### User install (manual)
|
||||||
1. Build the library:
|
1. Build the library:
|
||||||
```bash
|
```bash
|
||||||
|
|
6
flake.lock
generated
6
flake.lock
generated
|
@ -2,11 +2,11 @@
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1753694789,
|
"lastModified": 1754498491,
|
||||||
"narHash": "sha256-cKgvtz6fKuK1Xr5LQW/zOUiAC0oSQoA9nOISB0pJZqM=",
|
"narHash": "sha256-erbiH2agUTD0Z30xcVSFcDHzkRvkRXOQ3lb887bcVrs=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "dc9637876d0dcc8c9e5e22986b857632effeb727",
|
"rev": "c2ae88e026f9525daf89587f3cbee584b92b6134",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
77
module.nix
77
module.nix
|
@ -1,69 +1,26 @@
|
||||||
{
|
{
|
||||||
config,
|
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.services.lsfg-vk;
|
inherit (lib.modules) mkRemovedOptionModule;
|
||||||
lsfg-vk = pkgs.callPackage ./lsfg-vk.nix { };
|
|
||||||
lsfg-vk-ui = pkgs.callPackage ./lsfg-vk-ui.nix { };
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options = {
|
imports = [
|
||||||
services.lsfg-vk = {
|
(mkRemovedOptionModule
|
||||||
enable = lib.mkEnableOption "Lossless Scaling Frame Generation Vulkan layer";
|
[
|
||||||
|
"services"
|
||||||
|
"lsfg-vk"
|
||||||
|
]
|
||||||
|
''
|
||||||
|
The lsfg-vk-flake NixOS module has been removed as adding packages to the environment is already sufficient.
|
||||||
|
|
||||||
ui.enable = lib.mkEnableOption "Enables a GUI for configuring lsfg-vk";
|
Simply add lsfg-vk & lsfg-vk-ui to your environment.systemPackages:
|
||||||
|
environment.systemPackages = [
|
||||||
package = lib.mkOption {
|
pkgs.lsfg-vk
|
||||||
type = lib.types.package;
|
pkgs.lsfg-vk-ui
|
||||||
description = "The lsfg-vk package to use";
|
];
|
||||||
default = lsfg-vk;
|
''
|
||||||
};
|
)
|
||||||
|
];
|
||||||
losslessDLLFile = lib.mkOption {
|
|
||||||
type = with lib.types; nullOr str;
|
|
||||||
default = null;
|
|
||||||
example = "/home/user/games/Lossless Scaling/Lossless.dll";
|
|
||||||
description = ''
|
|
||||||
Sets the LSFG_DLL_PATH environment variable.
|
|
||||||
Required if Lossless Scaling isn't installed in a standard location
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
configFile = lib.mkOption {
|
|
||||||
type = with lib.types; nullOr str;
|
|
||||||
default = null;
|
|
||||||
example = "/home/user/.config/lsfg-vk/conf.toml";
|
|
||||||
description = ''
|
|
||||||
Sets the LSFG_CONFIG environment variable.
|
|
||||||
Required if the lsfg-vk configuration file isn't stored at the standard location
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
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";
|
|
||||||
}
|
|
||||||
(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."
|
|
||||||
cfg.losslessDLLFile;
|
|
||||||
})
|
|
||||||
(lib.mkIf (cfg.configFile != null) {
|
|
||||||
environment.sessionVariables.LSFG_CONFIG = cfg.configFile;
|
|
||||||
})
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue