mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 03:56:01 +01:00
flake: Apply nixfmt 1.0.0
This commit is contained in:
parent
fc33681583
commit
1d943f5819
19 changed files with 243 additions and 248 deletions
|
|
@ -55,9 +55,7 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
# Done in a pre-configure hook, because $NIX_BUILD_TOP needs to be substituted.
|
# Done in a pre-configure hook, because $NIX_BUILD_TOP needs to be substituted.
|
||||||
preConfigure =
|
preConfigure = prevAttrs.preConfigure or "" + ''
|
||||||
prevAttrs.preConfigure or ""
|
|
||||||
+ ''
|
|
||||||
mappingFlag=" -fcoverage-prefix-map=$NIX_BUILD_TOP/${finalAttrs.src.name}=${finalAttrs.src}"
|
mappingFlag=" -fcoverage-prefix-map=$NIX_BUILD_TOP/${finalAttrs.src.name}=${finalAttrs.src}"
|
||||||
CFLAGS+="$mappingFlag"
|
CFLAGS+="$mappingFlag"
|
||||||
CXXFLAGS+="$mappingFlag"
|
CXXFLAGS+="$mappingFlag"
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,7 @@ mkMesonDerivation (finalAttrs: {
|
||||||
];
|
];
|
||||||
|
|
||||||
# Hack for sake of the dev shell
|
# Hack for sake of the dev shell
|
||||||
passthru.externalNativeBuildInputs =
|
passthru.externalNativeBuildInputs = [
|
||||||
[
|
|
||||||
meson
|
meson
|
||||||
ninja
|
ninja
|
||||||
(lib.getBin lowdown-unsandboxed)
|
(lib.getBin lowdown-unsandboxed)
|
||||||
|
|
|
||||||
|
|
@ -65,10 +65,10 @@ let
|
||||||
iana-etc
|
iana-etc
|
||||||
gitMinimal
|
gitMinimal
|
||||||
openssh
|
openssh
|
||||||
] ++ extraPkgs;
|
]
|
||||||
|
++ extraPkgs;
|
||||||
|
|
||||||
users =
|
users = {
|
||||||
{
|
|
||||||
|
|
||||||
root = {
|
root = {
|
||||||
uid = 0;
|
uid = 0;
|
||||||
|
|
@ -111,8 +111,7 @@ let
|
||||||
}) (lib.lists.range 1 32)
|
}) (lib.lists.range 1 32)
|
||||||
);
|
);
|
||||||
|
|
||||||
groups =
|
groups = {
|
||||||
{
|
|
||||||
root.gid = 0;
|
root.gid = 0;
|
||||||
nixbld.gid = 30000;
|
nixbld.gid = 30000;
|
||||||
nobody.gid = 65534;
|
nobody.gid = 65534;
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,8 @@ let
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
meson
|
meson
|
||||||
ninja
|
ninja
|
||||||
] ++ prevAttrs.nativeBuildInputs or [ ];
|
]
|
||||||
|
++ prevAttrs.nativeBuildInputs or [ ];
|
||||||
mesonCheckFlags = prevAttrs.mesonCheckFlags or [ ] ++ [
|
mesonCheckFlags = prevAttrs.mesonCheckFlags or [ ] ++ [
|
||||||
"--print-errorlogs"
|
"--print-errorlogs"
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,7 @@ pkgs.nixComponents2.nix-util.overrideAttrs (
|
||||||
# We use this shell with the local checkout, not unpackPhase.
|
# We use this shell with the local checkout, not unpackPhase.
|
||||||
src = null;
|
src = null;
|
||||||
|
|
||||||
env =
|
env = {
|
||||||
{
|
|
||||||
# For `make format`, to work without installing pre-commit
|
# For `make format`, to work without installing pre-commit
|
||||||
_NIX_PRE_COMMIT_HOOKS_CONFIG = "${(pkgs.formats.yaml { }).generate "pre-commit-config.yaml"
|
_NIX_PRE_COMMIT_HOOKS_CONFIG = "${(pkgs.formats.yaml { }).generate "pre-commit-config.yaml"
|
||||||
modular.pre-commit.settings.rawConfig
|
modular.pre-commit.settings.rawConfig
|
||||||
|
|
@ -126,8 +125,9 @@ pkgs.nixComponents2.nix-util.overrideAttrs (
|
||||||
)
|
)
|
||||||
++ lib.optional stdenv.hostPlatform.isLinux pkgs.buildPackages.mold-wrapped;
|
++ lib.optional stdenv.hostPlatform.isLinux pkgs.buildPackages.mold-wrapped;
|
||||||
|
|
||||||
buildInputs =
|
buildInputs = [
|
||||||
[ pkgs.gbenchmark ]
|
pkgs.gbenchmark
|
||||||
|
]
|
||||||
++ attrs.buildInputs or [ ]
|
++ attrs.buildInputs or [ ]
|
||||||
++ pkgs.nixComponents2.nix-util.buildInputs
|
++ pkgs.nixComponents2.nix-util.buildInputs
|
||||||
++ pkgs.nixComponents2.nix-store.buildInputs
|
++ pkgs.nixComponents2.nix-store.buildInputs
|
||||||
|
|
|
||||||
|
|
@ -47,8 +47,7 @@
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
libs =
|
libs = {
|
||||||
{
|
|
||||||
inherit
|
inherit
|
||||||
nix-util
|
nix-util
|
||||||
nix-util-c
|
nix-util-c
|
||||||
|
|
@ -65,7 +64,8 @@ let
|
||||||
nix-cmd
|
nix-cmd
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
// lib.optionalAttrs
|
//
|
||||||
|
lib.optionalAttrs
|
||||||
(!stdenv.hostPlatform.isStatic && stdenv.buildPlatform.canExecute stdenv.hostPlatform)
|
(!stdenv.hostPlatform.isStatic && stdenv.buildPlatform.canExecute stdenv.hostPlatform)
|
||||||
{
|
{
|
||||||
# Currently fails in static build
|
# Currently fails in static build
|
||||||
|
|
@ -127,8 +127,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
*/
|
*/
|
||||||
dontFixup = true;
|
dontFixup = true;
|
||||||
|
|
||||||
checkInputs =
|
checkInputs = [
|
||||||
[
|
|
||||||
# Make sure the unit tests have passed
|
# Make sure the unit tests have passed
|
||||||
nix-util-tests.tests.run
|
nix-util-tests.tests.run
|
||||||
nix-store-tests.tests.run
|
nix-store-tests.tests.run
|
||||||
|
|
@ -139,8 +138,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
# Make sure the functional tests have passed
|
# Make sure the functional tests have passed
|
||||||
nix-functional-tests
|
nix-functional-tests
|
||||||
]
|
]
|
||||||
++ lib.optionals
|
++
|
||||||
(!stdenv.hostPlatform.isStatic && stdenv.buildPlatform.canExecute stdenv.hostPlatform)
|
lib.optionals (!stdenv.hostPlatform.isStatic && stdenv.buildPlatform.canExecute stdenv.hostPlatform)
|
||||||
[
|
[
|
||||||
# Perl currently fails in static build
|
# Perl currently fails in static build
|
||||||
# TODO: Split out tests into a separate derivation?
|
# TODO: Split out tests into a separate derivation?
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,8 @@ mkMesonLibrary (finalAttrs: {
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
({ inherit editline readline; }.${readlineFlavor})
|
({ inherit editline readline; }.${readlineFlavor})
|
||||||
] ++ lib.optional enableMarkdown lowdown;
|
]
|
||||||
|
++ lib.optional enableMarkdown lowdown;
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
nix-util
|
nix-util
|
||||||
|
|
|
||||||
|
|
@ -70,13 +70,15 @@ mkMesonLibrary (finalAttrs: {
|
||||||
nix-util
|
nix-util
|
||||||
nix-store
|
nix-store
|
||||||
nix-fetchers
|
nix-fetchers
|
||||||
] ++ finalAttrs.passthru.externalPropagatedBuildInputs;
|
]
|
||||||
|
++ finalAttrs.passthru.externalPropagatedBuildInputs;
|
||||||
|
|
||||||
# Hack for sake of the dev shell
|
# Hack for sake of the dev shell
|
||||||
passthru.externalPropagatedBuildInputs = [
|
passthru.externalPropagatedBuildInputs = [
|
||||||
boost
|
boost
|
||||||
nlohmann_json
|
nlohmann_json
|
||||||
] ++ lib.optional enableGC boehmgc;
|
]
|
||||||
|
++ lib.optional enableGC boehmgc;
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
(lib.mesonEnable "gc" enableGC)
|
(lib.mesonEnable "gc" enableGC)
|
||||||
|
|
|
||||||
|
|
@ -43,8 +43,7 @@ mkMesonExecutable (finalAttrs: {
|
||||||
];
|
];
|
||||||
|
|
||||||
# Hack for sake of the dev shell
|
# Hack for sake of the dev shell
|
||||||
passthru.externalBuildInputs =
|
passthru.externalBuildInputs = [
|
||||||
[
|
|
||||||
sqlite
|
sqlite
|
||||||
rapidcheck
|
rapidcheck
|
||||||
gtest
|
gtest
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,7 @@ mkMesonLibrary (finalAttrs: {
|
||||||
|
|
||||||
nativeBuildInputs = lib.optional embeddedSandboxShell unixtools.hexdump;
|
nativeBuildInputs = lib.optional embeddedSandboxShell unixtools.hexdump;
|
||||||
|
|
||||||
buildInputs =
|
buildInputs = [
|
||||||
[
|
|
||||||
boost
|
boost
|
||||||
curl
|
curl
|
||||||
sqlite
|
sqlite
|
||||||
|
|
@ -74,8 +73,7 @@ mkMesonLibrary (finalAttrs: {
|
||||||
nlohmann_json
|
nlohmann_json
|
||||||
];
|
];
|
||||||
|
|
||||||
mesonFlags =
|
mesonFlags = [
|
||||||
[
|
|
||||||
(lib.mesonEnable "seccomp-sandboxing" stdenv.hostPlatform.isLinux)
|
(lib.mesonEnable "seccomp-sandboxing" stdenv.hostPlatform.isLinux)
|
||||||
(lib.mesonBool "embedded-sandbox-shell" embeddedSandboxShell)
|
(lib.mesonBool "embedded-sandbox-shell" embeddedSandboxShell)
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,8 @@ mkMesonLibrary (finalAttrs: {
|
||||||
libblake3
|
libblake3
|
||||||
libsodium
|
libsodium
|
||||||
openssl
|
openssl
|
||||||
] ++ lib.optional stdenv.hostPlatform.isx86_64 libcpuid;
|
]
|
||||||
|
++ lib.optional stdenv.hostPlatform.isx86_64 libcpuid;
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
boost
|
boost
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,8 @@ perl.pkgs.toPerlModule (
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
nix-store
|
nix-store
|
||||||
] ++ finalAttrs.passthru.externalBuildInputs;
|
]
|
||||||
|
++ finalAttrs.passthru.externalBuildInputs;
|
||||||
|
|
||||||
# Hack for sake of the dev shell
|
# Hack for sake of the dev shell
|
||||||
passthru.externalBuildInputs = [
|
passthru.externalBuildInputs = [
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,7 @@ with import ./lib.nix;
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
attrs =
|
attrs = {
|
||||||
{
|
|
||||||
y = "y";
|
y = "y";
|
||||||
x = "x";
|
x = "x";
|
||||||
foo = "foo";
|
foo = "foo";
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
let {
|
let {
|
||||||
as =
|
as = {
|
||||||
{
|
|
||||||
x = 123;
|
x = 123;
|
||||||
y = 456;
|
y = 456;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
let {
|
let {
|
||||||
as =
|
as = {
|
||||||
{
|
|
||||||
x = 123;
|
x = 123;
|
||||||
y = 456;
|
y = 456;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,8 @@ let
|
||||||
scopedImport = attrs: fn: scopedImport (overrides // attrs) fn;
|
scopedImport = attrs: fn: scopedImport (overrides // attrs) fn;
|
||||||
|
|
||||||
builtins = builtins // overrides;
|
builtins = builtins // overrides;
|
||||||
} // import ./lib.nix;
|
}
|
||||||
|
// import ./lib.nix;
|
||||||
|
|
||||||
in
|
in
|
||||||
scopedImport overrides ./imported.nix
|
scopedImport overrides ./imported.nix
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,7 @@ mkDerivation {
|
||||||
name = "nested-sandboxing";
|
name = "nested-sandboxing";
|
||||||
busybox = builtins.getEnv "busybox";
|
busybox = builtins.getEnv "busybox";
|
||||||
EXTRA_SANDBOX = builtins.getEnv "EXTRA_SANDBOX";
|
EXTRA_SANDBOX = builtins.getEnv "EXTRA_SANDBOX";
|
||||||
buildCommand =
|
buildCommand = ''
|
||||||
''
|
|
||||||
set -x
|
set -x
|
||||||
set -eu -o pipefail
|
set -eu -o pipefail
|
||||||
''
|
''
|
||||||
|
|
|
||||||
|
|
@ -47,8 +47,7 @@ mkMesonDerivation (
|
||||||
];
|
];
|
||||||
|
|
||||||
# Hack for sake of the dev shell
|
# Hack for sake of the dev shell
|
||||||
passthru.externalNativeBuildInputs =
|
passthru.externalNativeBuildInputs = [
|
||||||
[
|
|
||||||
meson
|
meson
|
||||||
ninja
|
ninja
|
||||||
pkg-config
|
pkg-config
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,8 @@ let
|
||||||
nix.settings.sandbox = true;
|
nix.settings.sandbox = true;
|
||||||
services.openssh.ports = [
|
services.openssh.ports = [
|
||||||
22
|
22
|
||||||
] ++ lib.optional supportsCustomPort 2222;
|
]
|
||||||
|
++ lib.optional supportsCustomPort 2222;
|
||||||
|
|
||||||
# Regression test for use of PID namespaces when /proc has
|
# Regression test for use of PID namespaces when /proc has
|
||||||
# filesystems mounted on top of it
|
# filesystems mounted on top of it
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue