Unverified Commit 4433bbfd authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

Merge pull request #304773 from acid-bong/no-libs

treewide: remove file-wide `with lib;` uses in nixos/modules/programs
parents 7047535b 49f6869f
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
{ config, pkgs, lib, ... }:

with lib;

let

  cfg = config.programs._1password-gui;
@@ -9,25 +7,25 @@ let
in
{
  imports = [
    (mkRemovedOptionModule [ "programs" "_1password-gui" "gid" ] ''
    (lib.mkRemovedOptionModule [ "programs" "_1password-gui" "gid" ] ''
      A preallocated GID will be used instead.
    '')
  ];

  options = {
    programs._1password-gui = {
      enable = mkEnableOption "the 1Password GUI application";
      enable = lib.mkEnableOption "the 1Password GUI application";

      polkitPolicyOwners = mkOption {
        type = types.listOf types.str;
      polkitPolicyOwners = lib.mkOption {
        type = lib.types.listOf lib.types.str;
        default = [ ];
        example = literalExpression ''["user1" "user2" "user3"]'';
        example = lib.literalExpression ''["user1" "user2" "user3"]'';
        description = ''
          A list of users who should be able to integrate 1Password with polkit-based authentication mechanisms.
        '';
      };

      package = mkPackageOption pkgs "1Password GUI" {
      package = lib.mkPackageOption pkgs "1Password GUI" {
        default = [ "_1password-gui" ];
      };
    };
@@ -39,7 +37,7 @@ in
        polkitPolicyOwners = cfg.polkitPolicyOwners;
      };
    in
    mkIf cfg.enable {
    lib.mkIf cfg.enable {
      environment.systemPackages = [ package ];
      users.groups.onepassword.gid = config.ids.gids.onepassword;

+4 −6
Original line number Diff line number Diff line
{ config, pkgs, lib, ... }:

with lib;

let

  cfg = config.programs._1password;
@@ -9,22 +7,22 @@ let
in
{
  imports = [
    (mkRemovedOptionModule [ "programs" "_1password" "gid" ] ''
    (lib.mkRemovedOptionModule [ "programs" "_1password" "gid" ] ''
      A preallocated GID will be used instead.
    '')
  ];

  options = {
    programs._1password = {
      enable = mkEnableOption "the 1Password CLI tool";
      enable = lib.mkEnableOption "the 1Password CLI tool";

      package = mkPackageOption pkgs "1Password CLI" {
      package = lib.mkPackageOption pkgs "1Password CLI" {
        default = [ "_1password" ];
      };
    };
  };

  config = mkIf cfg.enable {
  config = lib.mkIf cfg.enable {
    environment.systemPackages = [ cfg.package ];
    users.groups.onepassword-cli.gid = config.ids.gids.onepassword-cli;

+4 −6
Original line number Diff line number Diff line
{ config, lib, pkgs, ... }:

with lib;

{
  meta.maintainers = [ maintainers.mic92 ];
  meta.maintainers = [ lib.maintainers.mic92 ];

  ###### interface
  options = {
    programs.adb = {
      enable = mkOption {
      enable = lib.mkOption {
        default = false;
        type = types.bool;
        type = lib.types.bool;
        description = ''
          Whether to configure system to use Android Debug Bridge (adb).
          To grant access to a user, it must be part of adbusers group:
@@ -21,7 +19,7 @@ with lib;
  };

  ###### implementation
  config = mkIf config.programs.adb.enable {
  config = lib.mkIf config.programs.adb.enable {
    services.udev.packages = [ pkgs.android-udev-rules ];
    environment.systemPackages = [ pkgs.android-tools ];
    users.groups.adbusers = {};
+7 −9
Original line number Diff line number Diff line
{ config, pkgs, lib, ... }:

with lib;

let
  cfg = config.programs.alvr;
in
{
  options = {
    programs.alvr = {
      enable = mkEnableOption "ALVR, the VR desktop streamer";
      enable = lib.mkEnableOption "ALVR, the VR desktop streamer";

      package = mkPackageOption pkgs "alvr" { };
      package = lib.mkPackageOption pkgs "alvr" { };

      openFirewall = mkOption {
        type = types.bool;
      openFirewall = lib.mkOption {
        type = lib.types.bool;
        default = false;
        description = ''
          Whether to open the default ports in the firewall for the ALVR server.
@@ -22,14 +20,14 @@ in
    };
  };

  config = mkIf cfg.enable {
  config = lib.mkIf cfg.enable {
    environment.systemPackages = [ cfg.package ];

    networking.firewall = mkIf cfg.openFirewall {
    networking.firewall = lib.mkIf cfg.openFirewall {
      allowedTCPPorts = [ 9943 9944 ];
      allowedUDPPorts = [ 9943 9944 ];
    };
  };

  meta.maintainers = with maintainers; [ passivelemon ];
  meta.maintainers = with lib.maintainers; [ passivelemon ];
}
+2 −4
Original line number Diff line number Diff line
{ config, pkgs, lib, ... }:

with lib;

{
  options = {
    programs.appgate-sdp = {
      enable = mkEnableOption "the AppGate SDP VPN client";
      enable = lib.mkEnableOption "the AppGate SDP VPN client";
    };
  };

  config = mkIf config.programs.appgate-sdp.enable {
  config = lib.mkIf config.programs.appgate-sdp.enable {
    boot.kernelModules = [ "tun" ];
    environment.systemPackages = [ pkgs.appgate-sdp ];
    services.dbus.packages = [ pkgs.appgate-sdp ];
Loading