mirror of
https://github.com/NixOS/nix
synced 2025-07-07 14:21:48 +02:00
Format .nix files
This does not include any automation for the release branch, but is based on the configuration of https://github.com/NixOS/nix/pull/12349 pre-commit run -a nixfmt-rfc-style
This commit is contained in:
parent
6cb17fd836
commit
32aed360b8
266 changed files with 7443 additions and 5118 deletions
|
@ -1,103 +1,110 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, mkMesonDerivation
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
mkMesonDerivation,
|
||||
|
||||
, meson
|
||||
, ninja
|
||||
, pkg-config
|
||||
meson,
|
||||
ninja,
|
||||
pkg-config,
|
||||
|
||||
, jq
|
||||
, git
|
||||
, mercurial
|
||||
, util-linux
|
||||
jq,
|
||||
git,
|
||||
mercurial,
|
||||
util-linux,
|
||||
|
||||
, nix-store
|
||||
, nix-expr
|
||||
, nix-cli
|
||||
nix-store,
|
||||
nix-expr,
|
||||
nix-cli,
|
||||
|
||||
, busybox-sandbox-shell ? null
|
||||
busybox-sandbox-shell ? null,
|
||||
|
||||
# Configuration Options
|
||||
# Configuration Options
|
||||
|
||||
, pname ? "nix-functional-tests"
|
||||
, version
|
||||
pname ? "nix-functional-tests",
|
||||
version,
|
||||
|
||||
# For running the functional tests against a different pre-built Nix.
|
||||
, test-daemon ? null
|
||||
# For running the functional tests against a different pre-built Nix.
|
||||
test-daemon ? null,
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (lib) fileset;
|
||||
in
|
||||
|
||||
mkMesonDerivation (finalAttrs: {
|
||||
inherit pname version;
|
||||
mkMesonDerivation (
|
||||
finalAttrs:
|
||||
{
|
||||
inherit pname version;
|
||||
|
||||
workDir = ./.;
|
||||
fileset = fileset.unions [
|
||||
../../scripts/nix-profile.sh.in
|
||||
../../.version
|
||||
../../tests/functional
|
||||
./.
|
||||
];
|
||||
workDir = ./.;
|
||||
fileset = fileset.unions [
|
||||
../../scripts/nix-profile.sh.in
|
||||
../../.version
|
||||
../../tests/functional
|
||||
./.
|
||||
];
|
||||
|
||||
# Hack for sake of the dev shell
|
||||
passthru.externalNativeBuildInputs = [
|
||||
meson
|
||||
ninja
|
||||
pkg-config
|
||||
# Hack for sake of the dev shell
|
||||
passthru.externalNativeBuildInputs =
|
||||
[
|
||||
meson
|
||||
ninja
|
||||
pkg-config
|
||||
|
||||
jq
|
||||
git
|
||||
mercurial
|
||||
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||
# For various sandboxing tests that needs a statically-linked shell,
|
||||
# etc.
|
||||
busybox-sandbox-shell
|
||||
# For Overlay FS tests need `mount`, `umount`, and `unshare`.
|
||||
# For `script` command (ensuring a TTY)
|
||||
# TODO use `unixtools` to be precise over which executables instead?
|
||||
util-linux
|
||||
];
|
||||
jq
|
||||
git
|
||||
mercurial
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||
# For various sandboxing tests that needs a statically-linked shell,
|
||||
# etc.
|
||||
busybox-sandbox-shell
|
||||
# For Overlay FS tests need `mount`, `umount`, and `unshare`.
|
||||
# For `script` command (ensuring a TTY)
|
||||
# TODO use `unixtools` to be precise over which executables instead?
|
||||
util-linux
|
||||
];
|
||||
|
||||
nativeBuildInputs = finalAttrs.passthru.externalNativeBuildInputs ++ [
|
||||
nix-cli
|
||||
];
|
||||
nativeBuildInputs = finalAttrs.passthru.externalNativeBuildInputs ++ [
|
||||
nix-cli
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
nix-store
|
||||
nix-expr
|
||||
];
|
||||
buildInputs = [
|
||||
nix-store
|
||||
nix-expr
|
||||
];
|
||||
|
||||
preConfigure =
|
||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
||||
# Do the meson utils, without modification.
|
||||
''
|
||||
chmod u+w ./.version
|
||||
echo ${version} > ../../../.version
|
||||
''
|
||||
# TEMP hack for Meson before make is gone, where
|
||||
# `src/nix-functional-tests` is during the transition a symlink and
|
||||
# not the actual directory directory.
|
||||
+ ''
|
||||
cd $(readlink -e $PWD)
|
||||
echo $PWD | grep tests/functional
|
||||
preConfigure =
|
||||
# "Inline" .version so it's not a symlink, and includes the suffix.
|
||||
# Do the meson utils, without modification.
|
||||
''
|
||||
chmod u+w ./.version
|
||||
echo ${version} > ../../../.version
|
||||
''
|
||||
# TEMP hack for Meson before make is gone, where
|
||||
# `src/nix-functional-tests` is during the transition a symlink and
|
||||
# not the actual directory directory.
|
||||
+ ''
|
||||
cd $(readlink -e $PWD)
|
||||
echo $PWD | grep tests/functional
|
||||
'';
|
||||
|
||||
mesonCheckFlags = [
|
||||
"--print-errorlogs"
|
||||
];
|
||||
|
||||
doCheck = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir $out
|
||||
'';
|
||||
|
||||
mesonCheckFlags = [
|
||||
"--print-errorlogs"
|
||||
];
|
||||
meta = {
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
|
||||
doCheck = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir $out
|
||||
'';
|
||||
|
||||
meta = {
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
|
||||
} // lib.optionalAttrs (test-daemon != null) {
|
||||
NIX_DAEMON_PACKAGE = test-daemon;
|
||||
})
|
||||
}
|
||||
// lib.optionalAttrs (test-daemon != null) {
|
||||
NIX_DAEMON_PACKAGE = test-daemon;
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue