Unverified Commit 5195ca23 authored by figsoda's avatar figsoda Committed by GitHub
Browse files

Merge pull request #203826 from figsoda/lint

nixos/*: apply some lints from statix and nil
parents 6065d768 b865b96b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -618,7 +618,7 @@ in {
    # Install all the user shells
    environment.systemPackages = systemShells;

    environment.etc = (mapAttrs' (_: { packages, name, ... }: {
    environment.etc = mapAttrs' (_: { packages, name, ... }: {
      name = "profiles/per-user/${name}";
      value.source = pkgs.buildEnv {
        name = "user-environment";
@@ -626,7 +626,7 @@ in {
        inherit (config.environment) pathsToLink extraOutputsToInstall;
        inherit (config.system.path) ignoreCollisions postBuild;
      };
    }) (filterAttrs (_: u: u.packages != []) cfg.users));
    }) (filterAttrs (_: u: u.packages != []) cfg.users);

    environment.profiles = [
      "$HOME/.nix-profile"
+2 −7
Original line number Diff line number Diff line
@@ -23,12 +23,12 @@ let
    optionalAttrs (lhs ? packageOverrides) {
      packageOverrides = pkgs:
        optCall lhs.packageOverrides pkgs //
        optCall (attrByPath ["packageOverrides"] ({}) rhs) pkgs;
        optCall (attrByPath [ "packageOverrides" ] { } rhs) pkgs;
    } //
    optionalAttrs (lhs ? perlPackageOverrides) {
      perlPackageOverrides = pkgs:
        optCall lhs.perlPackageOverrides pkgs //
        optCall (attrByPath ["perlPackageOverrides"] ({}) rhs) pkgs;
        optCall (attrByPath [ "perlPackageOverrides" ] { } rhs) pkgs;
    };

  configType = mkOptionType {
@@ -67,11 +67,6 @@ let
  # Context for messages
  hostPlatformLine = optionalString hasHostPlatform "${showOptionWithDefLocs opt.hostPlatform}";
  buildPlatformLine = optionalString hasBuildPlatform "${showOptionWithDefLocs opt.buildPlatform}";
  platformLines = optionalString hasPlatform ''
    Your system configuration configures nixpkgs with platform parameters:
    ${hostPlatformLine
    }${buildPlatformLine
    }'';

  legacyOptionsDefined =
    optional (opt.localSystem.highestPrio < (mkDefault {}).priority) opt.system
+5 −6
Original line number Diff line number Diff line
{ config, lib, pkgs, ... }:

with lib;

let inherit (pkgs) writeScript; in

let
 pkgs2storeContents = l : map (x: { object = x; symlink = "none"; }) l;
  inherit (pkgs) writeScript;

in {
  pkgs2storeContents = map (x: { object = x; symlink = "none"; });
in

{
  # Docker image config.
  imports = [
    ../installer/cd-dvd/channel.nix
+4 −4
Original line number Diff line number Diff line
@@ -141,9 +141,9 @@ in

      services.hadoop.hbaseSiteInternal."hbase.rootdir" = cfg.hbase.rootdir;

      networking.firewall.allowedTCPPorts = (mkIf cfg.hbase.master.openFirewall [
      networking.firewall.allowedTCPPorts = mkIf cfg.hbase.master.openFirewall [
        16000 16010
      ]);
      ];

    })

@@ -168,9 +168,9 @@ in
      services.hadoop.hbaseSiteInternal."hbase.rootdir" = cfg.hbase.rootdir;

      networking = {
        firewall.allowedTCPPorts = (mkIf cfg.hbase.regionServer.openFirewall [
        firewall.allowedTCPPorts = mkIf cfg.hbase.regionServer.openFirewall [
          16020 16030
        ]);
        ];
        hosts = mkIf cfg.hbase.regionServer.overrideHosts {
          "127.0.0.2" = mkForce [ ];
          "::1" = mkForce [ ];
+2 −4
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ let

  python = cfg.package.pythonModule;

  escapeStr = s: escape ["'"] s;
  escapeStr = escape [ "'" ];

  defaultMasterCfg = pkgs.writeText "master.cfg" ''
    from buildbot.plugins import *
@@ -245,9 +245,7 @@ in {
        description = "Buildbot User.";
        isNormalUser = true;
        createHome = true;
        home = cfg.home;
        group = cfg.group;
        extraGroups = cfg.extraGroups;
        inherit (cfg) home group extraGroups;
        useDefaultShell = true;
      };
    };
Loading