mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-27 02:34:53 +00:00
Remove optional builtins prefixes from prelude functions by running:
builtins=(
abort
baseNameOf
break
derivation
derivationStrict
dirOf
false
fetchGit
fetchMercurial
fetchTarball
fetchTree
fromTOML
import
isNull
map
null
placeholder
removeAttrs
scopedImport
throw
toString
true
)
fd \
--exclude doc/manual/release-notes \
--type file \
. \
nixos \
--exec-batch sed --in-place --regexp-extended "
s/\<builtins\.($(
printf '%s\n' "${builtins[@]}" |
paste --delimiter '|' --serial -
))\>/\1/g
"
nix fmt
43 lines
1.0 KiB
Nix
43 lines
1.0 KiB
Nix
{ systemdStage1, ... }:
|
|
|
|
{
|
|
name = "fsck";
|
|
|
|
nodes.machine = {
|
|
virtualisation.emptyDiskImages = [ 1 ];
|
|
|
|
virtualisation.fileSystems = {
|
|
"/mnt" = {
|
|
device = "/dev/vdb";
|
|
fsType = "ext4";
|
|
autoFormat = true;
|
|
};
|
|
};
|
|
|
|
boot.initrd.systemd.enable = systemdStage1;
|
|
};
|
|
|
|
testScript =
|
|
{ nodes, ... }:
|
|
let
|
|
rootDevice = nodes.machine.virtualisation.rootDevice;
|
|
in
|
|
''
|
|
machine.wait_for_unit("default.target")
|
|
|
|
with subtest("root fs is fsckd"):
|
|
machine.succeed("journalctl -b | grep '${
|
|
if systemdStage1 then "fsck.*${baseNameOf rootDevice}.*clean" else "fsck.ext4.*${rootDevice}"
|
|
}'")
|
|
|
|
with subtest("mnt fs is fsckd"):
|
|
machine.succeed("journalctl -b | grep 'fsck.*vdb.*clean'")
|
|
machine.succeed(
|
|
"grep 'Requires=systemd-fsck@dev-vdb.service' /run/systemd/generator/mnt.mount"
|
|
)
|
|
machine.succeed(
|
|
"grep 'After=systemd-fsck@dev-vdb.service' /run/systemd/generator/mnt.mount"
|
|
)
|
|
'';
|
|
}
|