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 ]; + }); }); - }); - }) - ]; + }) + ]; + }; }