mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-03 13:30:36 +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
39 lines
710 B
Nix
39 lines
710 B
Nix
let
|
|
mkNode = id: {
|
|
imports = [ ../../modules/profiles/minimal.nix ];
|
|
|
|
virtualisation.interfaces.eth1.vlan = 1;
|
|
|
|
networking.ifstate = {
|
|
enable = true;
|
|
settings.interfaces.eth1 = {
|
|
addresses = [ "2001:0db8::${toString id}/64" ];
|
|
link = {
|
|
state = "up";
|
|
kind = "physical";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
in
|
|
|
|
{
|
|
name = "ifstate-ping";
|
|
|
|
nodes = {
|
|
foo = mkNode 1;
|
|
bar = mkNode 2;
|
|
};
|
|
|
|
testScript = # python
|
|
''
|
|
start_all()
|
|
|
|
foo.wait_for_unit("default.target")
|
|
bar.wait_for_unit("default.target")
|
|
|
|
foo.wait_until_succeeds("ping -c 1 2001:0db8::2")
|
|
bar.wait_until_succeeds("ping -c 1 2001:0db8::1")
|
|
'';
|
|
}
|