diff --git a/nixos/modules/hardware/i2c.nix b/nixos/modules/hardware/i2c.nix index b1e5cfd9e025..4dd7a8ccc531 100644 --- a/nixos/modules/hardware/i2c.nix +++ b/nixos/modules/hardware/i2c.nix @@ -1,21 +1,18 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.hardware.i2c; in { options.hardware.i2c = { - enable = mkEnableOption '' + enable = lib.mkEnableOption '' i2c devices support. By default access is granted to users in the "i2c" group (will be created if non-existent) and any user with a seat, meaning logged on the computer locally ''; - group = mkOption { - type = types.str; + group = lib.mkOption { + type = lib.types.str; default = "i2c"; description = '' Grant access to i2c devices (/dev/i2c-*) to users in this group. @@ -23,11 +20,11 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { boot.kernelModules = [ "i2c-dev" ]; - users.groups = mkIf (cfg.group == "i2c") { + users.groups = lib.mkIf (cfg.group == "i2c") { i2c = { }; }; @@ -42,6 +39,6 @@ in }; - meta.maintainers = [ maintainers.rnhmjoj ]; + meta.maintainers = [ lib.maintainers.rnhmjoj ]; }