From 585a398dbcfe215a9345612b127510a121fdd656 Mon Sep 17 00:00:00 2001 From: Nojus Date: Tue, 15 Jul 2025 00:24:57 +0200 Subject: [PATCH] module.nix: init --- flake.nix | 1 + module.nix | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 module.nix diff --git a/flake.nix b/flake.nix index 7e14bb7..58093a4 100644 --- a/flake.nix +++ b/flake.nix @@ -6,5 +6,6 @@ pkgs = import nixpkgs { inherit system; }; in { packages.${system}.default = pkgs.callPackage ./default.nix {}; + nixosModules.default = import ./module.nix; }; } diff --git a/module.nix b/module.nix new file mode 100644 index 0000000..d91ad93 --- /dev/null +++ b/module.nix @@ -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"; + }; +}