From 32e0d516a6ea2224b46867f3a05678c83302eb47 Mon Sep 17 00:00:00 2001 From: Sean Buckley Date: Tue, 29 Dec 2020 16:31:36 -0500 Subject: [PATCH] scroll-boost: convert to module --- default.nix | 13 +++---------- modules/scroll-boost/default.nix | 27 +++++++++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/default.nix b/default.nix index 6871d88..422b3c3 100644 --- a/default.nix +++ b/default.nix @@ -4,14 +4,8 @@ let cfg = config.sconfig; in { - options.sconfig = { - - profile = mkOption { - type = types.enum [ "server" "desktop-gnome" "desktop-sway" ]; - }; - - scroll-boost = mkEnableOption "Patch libinput scroll speed"; - + options.sconfig.profile = mkOption { + type = types.enum [ "server" "desktop-gnome" "desktop-sway" ]; }; config = mkMerge [ @@ -29,14 +23,13 @@ in (import ./modules/graphical.nix { inherit pkgs; }) ])) - (mkIf cfg.scroll-boost (import ./modules/scroll-boost { })) - ]; imports = [ ./modules/alacritty.nix ./modules/baseline.nix ./modules/cli.nix + ./modules/scroll-boost ./modules/status-on-console.nix ]; } diff --git a/modules/scroll-boost/default.nix b/modules/scroll-boost/default.nix index 133da16..85c04ae 100644 --- a/modules/scroll-boost/default.nix +++ b/modules/scroll-boost/default.nix @@ -1,13 +1,20 @@ -{ ... }: +{ config, lib, ... }: +let + cfg = config.sconfig.scroll-boost; +in { - nixpkgs.overlays = [ - (self: super: { - xorg = super.xorg.overrideScope' (selfB: superB: { - inherit (super.xorg) xlibsWrapper; - xf86inputlibinput = superB.xf86inputlibinput.overrideAttrs (attr: { - patches = [ ./libinput.patch ]; + options.sconfig.scroll-boost = lib.mkEnableOption "Patch xf86-libinput scroll speed"; + + config = lib.mkIf cfg { + nixpkgs.overlays = [ + (self: super: { + xorg = super.xorg.overrideScope' (selfB: superB: { + inherit (super.xorg) xlibsWrapper; + xf86inputlibinput = superB.xf86inputlibinput.overrideAttrs (attr: { + patches = [ ./libinput.patch ]; + }); }); - }); - }) - ]; + }) + ]; + }; }