mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-28 16:43:58 +00:00
4f0dadbf38
After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-builda08b3a4d19
.tar.gz \ --argstr baseRevb32a094368
result/bin/apply-formatting $NIXPKGS_PATH
73 lines
2.0 KiB
Nix
73 lines
2.0 KiB
Nix
{ lib, ... }:
|
|
{
|
|
|
|
name = "qemu-vm-store";
|
|
|
|
meta.maintainers = with lib.maintainers; [ nikstur ];
|
|
|
|
nodes = {
|
|
sharedWritable = {
|
|
virtualisation.writableStore = true;
|
|
};
|
|
|
|
sharedReadOnly = {
|
|
virtualisation.writableStore = false;
|
|
};
|
|
|
|
imageWritable = {
|
|
virtualisation.useNixStoreImage = true;
|
|
virtualisation.writableStore = true;
|
|
};
|
|
|
|
imageReadOnly = {
|
|
virtualisation.useNixStoreImage = true;
|
|
virtualisation.writableStore = false;
|
|
};
|
|
|
|
fullDisk = {
|
|
virtualisation.useBootLoader = true;
|
|
};
|
|
};
|
|
|
|
testScript = ''
|
|
build_derivation = """
|
|
nix-build --option substitute false -E 'derivation {
|
|
name = "t";
|
|
builder = "/bin/sh";
|
|
args = ["-c" "echo something > $out"];
|
|
system = builtins.currentSystem;
|
|
preferLocalBuild = true;
|
|
}'
|
|
"""
|
|
|
|
start_all()
|
|
|
|
with subtest("Nix Store is writable"):
|
|
sharedWritable.succeed(build_derivation)
|
|
imageWritable.succeed(build_derivation)
|
|
fullDisk.succeed(build_derivation)
|
|
|
|
with subtest("Nix Store is read only"):
|
|
sharedReadOnly.fail(build_derivation)
|
|
imageReadOnly.fail(build_derivation)
|
|
|
|
# Checking whether the fs type is 9P is just a proxy to test whether the
|
|
# Nix Store is shared. If we switch to a different technology (e.g.
|
|
# virtiofs) for sharing, we need to adjust these tests.
|
|
|
|
with subtest("Nix store is shared from the host via 9P"):
|
|
sharedWritable.succeed("findmnt --kernel --type 9P /nix/.ro-store")
|
|
sharedReadOnly.succeed("findmnt --kernel --type 9P /nix/.ro-store")
|
|
|
|
with subtest("Nix store is not shared via 9P"):
|
|
imageWritable.fail("findmnt --kernel --type 9P /nix/.ro-store")
|
|
imageReadOnly.fail("findmnt --kernel --type 9P /nix/.ro-store")
|
|
|
|
with subtest("Nix store is not mounted separately"):
|
|
rootDevice = fullDisk.succeed("stat -c %d /")
|
|
nixStoreDevice = fullDisk.succeed("stat -c %d /nix/store")
|
|
assert rootDevice == nixStoreDevice, "Nix store is mounted separately from the root fs"
|
|
'';
|
|
|
|
}
|