treewide: fix lints

Arg to lib.optional is a list

build time tool in buildInputs

*Flags not a list

https://github.com/nix-community/nixpkgs-lint
This commit is contained in:
Artturin 2023-04-18 20:14:03 +03:00
parent 9984ca0504
commit eac28f38d6
14 changed files with 16 additions and 17 deletions

View File

@ -294,7 +294,7 @@ let
DynamicUser = true;
SupplementaryGroups = optional (serverCfg.useACMEHost != null) certConfig.group;
PrivateTmp = true;
AmbientCapabilities = optional (serverCfg.listen.port < 1024) [ "CAP_NET_BIND_SERVICE" ];
AmbientCapabilities = optionals (serverCfg.listen.port < 1024) [ "CAP_NET_BIND_SERVICE" ];
NoNewPrivileges = true;
RestrictNamespaces = "uts ipc pid user cgroup";
ProtectSystem = "strict";
@ -340,7 +340,7 @@ let
EnvironmentFile = optional (clientCfg.environmentFile != null) clientCfg.environmentFile;
DynamicUser = true;
PrivateTmp = true;
AmbientCapabilities = (optional (clientCfg.soMark != null) [ "CAP_NET_ADMIN" ]) ++ (optional ((clientCfg.dynamicToRemote.port or 1024) < 1024 || (any (x: x.local.port < 1024) clientCfg.localToRemote)) [ "CAP_NET_BIND_SERVICE" ]);
AmbientCapabilities = (optionals (clientCfg.soMark != null) [ "CAP_NET_ADMIN" ]) ++ (optionals ((clientCfg.dynamicToRemote.port or 1024) < 1024 || (any (x: x.local.port < 1024) clientCfg.localToRemote)) [ "CAP_NET_BIND_SERVICE" ]);
NoNewPrivileges = true;
RestrictNamespaces = "uts ipc pid user cgroup";
ProtectSystem = "strict";

View File

@ -51,7 +51,7 @@ stdenv.mkDerivation rec {
libharu
libepoxy
]
++ lib.optional (!stdenv.isAarch64) [
++ lib.optionals (!stdenv.isAarch64) [
openimagedenoise
embree
]

View File

@ -23,7 +23,7 @@ rustPlatform.buildRustPackage rec {
buildInputs =
[ openssl ]
++ lib.optional stdenv.isDarwin [ libgit2 Security ];
++ lib.optionals stdenv.isDarwin [ libgit2 Security ];
nativeBuildInputs = [ pkg-config ];
@ -36,4 +36,3 @@ rustPlatform.buildRustPackage rec {
maintainers = with maintainers; [ tmarkus ];
};
}

View File

@ -31,7 +31,7 @@ buildGo120Package rec {
'';
doCheck = true;
checkFlags = "-skip TestSetSessionHandlers";
checkFlags = [ "-skip=TestSetSessionHandlers" ];
preCheck = ''
if ! [[ $(go/bin/sessionmanagerplugin-main --version) = ${lib.escapeShellArg version} ]]; then

View File

@ -35,7 +35,7 @@ in
stdenv.mkDerivation {
inherit pname version src;
nativeBuildInputs = lib.optional stdenv.isLinux [ autoPatchelfHook ];
nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook ];
buildInputs = [ python3 perl ] ++ lib.optionals stdenv.isLinux [ zlib bzip2 glib libxml2 ];

View File

@ -69,7 +69,7 @@ stdenv.mkDerivation rec {
itstool
vala
gperf
] ++ lib.optional (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
mesonEmulatorHook
];

View File

@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
rdma-core
zlib
] ++ lib.optional enableCuda cudatoolkit
++ lib.optional enableRocm [ rocm-core rocm-runtime rocm-device-libs hip ];
++ lib.optionals enableRocm [ rocm-core rocm-runtime rocm-device-libs hip ];
configureFlags = [
"--with-rdmacm=${rdma-core}"

View File

@ -274,9 +274,9 @@ let
sha256 = "12l7ir3q29v06jx0zng5cvlbmap7p709ka3ik6x29lw334qshm9b";
};
buildInputs = [
pkgs.makeWrapper
nativeBuildInputs = [ pkgs.makeWrapper ];
buildInputs = [
# needed for GSETTINGS_SCHEMAS_PATH
pkgs.gsettings-desktop-schemas pkgs.glib pkgs.gtk3

View File

@ -43,7 +43,7 @@ buildPythonPackage rec {
"test_snitun_single_runner_throttling"
# ConnectionResetError: [Errno 54] Connection reset by peer
"test_peer_listener_timeout"
] ++ lib.optional (pythonAtLeast "3.11") [
] ++ lib.optionals (pythonAtLeast "3.11") [
# TypeError: Passing coroutines is forbidden, use tasks explicitly.
"test_snitun_runner_updown"
];

View File

@ -36,7 +36,7 @@ buildPythonPackage rec {
nativeCheckInputs = [ numpy pandas xarray nose pytestCheckHook ];
disabledTestPaths = lib.optional (lib.versionAtLeast numpy.version "1.17") [
disabledTestPaths = lib.optionals (lib.versionAtLeast numpy.version "1.17") [
# https://github.com/jupyter-widgets/traittypes/blob/master/setup.py#L86-L87
"traittypes/tests/test_traittypes.py"
];

View File

@ -18,7 +18,7 @@ buildDotnetModule rec {
};
projectFile = "Marksman/Marksman.fsproj";
dotnetBuildFlags = "-p:VersionString=${version}";
dotnetBuildFlags = [ "-p:VersionString=${version}" ];
doCheck = true;
testProjectFile = "Tests/Tests.fsproj";

View File

@ -79,6 +79,7 @@ stdenv.mkDerivation rec {
automake
autoconf
gettext
pkg-config
];
buildInputs = [
@ -88,7 +89,6 @@ stdenv.mkDerivation rec {
sasl
curl
xmlrpc_c
pkg-config
ding-libs
p11-kit
python3

View File

@ -37,7 +37,7 @@ in buildNpmPackage {
buildInputs = [ util-linux ];
dontNpmBuild = true;
npmInstallFlags = "--only-production";
npmInstallFlags = [ "--only-production" ];
npmDepsHash = "sha256-0PFeXiS8RSffhrocrHODNpb6d9+nbpulCW5qYIrytDI=";
installPhase = ''

View File

@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
};
nativeBuildInputs = [ bison flex ] ++
lib.optional stdenv.hostPlatform.isDarwin [
lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.DiskArbitration
];