module.nix: init

This commit is contained in:
Nojus 2025-07-15 00:24:57 +02:00
parent f24d8fe371
commit 585a398dbc
2 changed files with 27 additions and 0 deletions

View file

@ -6,5 +6,6 @@
pkgs = import nixpkgs { inherit system; };
in {
packages.${system}.default = pkgs.callPackage ./default.nix {};
nixosModules.default = import ./module.nix;
};
}

26
module.nix Normal file
View file

@ -0,0 +1,26 @@
{ config, lib, pkgs, ... }:
let
cfg = config.services.lsfg-vk;
lsfg-vk = pkgs.callPackage ./default.nix {};
in
{
options = {
services.lsfg-vk = {
enable = lib.mkEnableOption "Lossless Scaling Frame Generation Vulkan layer";
package = lib.mkOption {
type = lib.types.package;
description = "The lsfg-vk package to use";
default = lsfg-vk;
};
};
};
config = lib.mkIf cfg.enable {
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";
};
}