scroll-boost: convert to module

This commit is contained in:
Sean Buckley 2020-12-29 16:31:36 -05:00
parent dcb1e17982
commit 32e0d516a6
2 changed files with 20 additions and 20 deletions

View file

@ -4,16 +4,10 @@ let
cfg = config.sconfig; cfg = config.sconfig;
in in
{ {
options.sconfig = { options.sconfig.profile = mkOption {
profile = mkOption {
type = types.enum [ "server" "desktop-gnome" "desktop-sway" ]; type = types.enum [ "server" "desktop-gnome" "desktop-sway" ];
}; };
scroll-boost = mkEnableOption "Patch libinput scroll speed";
};
config = mkMerge [ config = mkMerge [
(mkIf (cfg.profile == "server") (mkMerge [ (mkIf (cfg.profile == "server") (mkMerge [
@ -29,14 +23,13 @@ in
(import ./modules/graphical.nix { inherit pkgs; }) (import ./modules/graphical.nix { inherit pkgs; })
])) ]))
(mkIf cfg.scroll-boost (import ./modules/scroll-boost { }))
]; ];
imports = [ imports = [
./modules/alacritty.nix ./modules/alacritty.nix
./modules/baseline.nix ./modules/baseline.nix
./modules/cli.nix ./modules/cli.nix
./modules/scroll-boost
./modules/status-on-console.nix ./modules/status-on-console.nix
]; ];
} }

View file

@ -1,5 +1,11 @@
{ ... }: { config, lib, ... }:
let
cfg = config.sconfig.scroll-boost;
in
{ {
options.sconfig.scroll-boost = lib.mkEnableOption "Patch xf86-libinput scroll speed";
config = lib.mkIf cfg {
nixpkgs.overlays = [ nixpkgs.overlays = [
(self: super: { (self: super: {
xorg = super.xorg.overrideScope' (selfB: superB: { xorg = super.xorg.overrideScope' (selfB: superB: {
@ -10,4 +16,5 @@
}); });
}) })
]; ];
};
} }