2022-07-13 22:01:16 +03:00
|
|
|
source common.sh
|
|
|
|
|
|
|
|
flakeDir=$TEST_ROOT/flake3
|
|
|
|
mkdir -p $flakeDir
|
|
|
|
|
|
|
|
cat > $flakeDir/flake.nix <<EOF
|
|
|
|
{
|
|
|
|
outputs = { self }: {
|
|
|
|
overlay = final: prev: {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
nix flake check $flakeDir
|
|
|
|
|
|
|
|
cat > $flakeDir/flake.nix <<EOF
|
|
|
|
{
|
|
|
|
outputs = { self }: {
|
|
|
|
overlay = finalll: prev: {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
(! nix flake check $flakeDir)
|
|
|
|
|
2023-06-27 15:58:29 +03:00
|
|
|
cat > $flakeDir/flake.nix <<EOF
|
|
|
|
{
|
|
|
|
outputs = { self, ... }: {
|
|
|
|
overlays.x86_64-linux.foo = final: prev: {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
checkRes=$(nix flake check $flakeDir 2>&1 && fail "nix flake check --all-systems should have failed" || true)
|
|
|
|
echo "$checkRes" | grepQuiet "error: overlay is not a function, but a set instead"
|
|
|
|
|
2022-07-13 22:01:16 +03:00
|
|
|
cat > $flakeDir/flake.nix <<EOF
|
|
|
|
{
|
|
|
|
outputs = { self }: {
|
|
|
|
nixosModules.foo = {
|
|
|
|
a.b.c = 123;
|
|
|
|
foo = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
nix flake check $flakeDir
|
|
|
|
|
|
|
|
cat > $flakeDir/flake.nix <<EOF
|
|
|
|
{
|
|
|
|
outputs = { self }: {
|
2023-01-05 19:23:30 +02:00
|
|
|
nixosModules.foo = assert false; {
|
2022-07-13 22:01:16 +03:00
|
|
|
a.b.c = 123;
|
2023-01-05 19:23:30 +02:00
|
|
|
foo = true;
|
2022-07-13 22:01:16 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
(! nix flake check $flakeDir)
|
|
|
|
|
|
|
|
cat > $flakeDir/flake.nix <<EOF
|
|
|
|
{
|
|
|
|
outputs = { self }: {
|
|
|
|
nixosModule = { config, pkgs, ... }: {
|
|
|
|
a.b.c = 123;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
nix flake check $flakeDir
|
|
|
|
|
|
|
|
cat > $flakeDir/flake.nix <<EOF
|
|
|
|
{
|
|
|
|
outputs = { self }: {
|
|
|
|
packages.system-1.default = "foo";
|
|
|
|
packages.system-2.default = "bar";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
2023-05-23 07:59:44 +03:00
|
|
|
nix flake check $flakeDir
|
|
|
|
|
|
|
|
checkRes=$(nix flake check --all-systems --keep-going $flakeDir 2>&1 && fail "nix flake check --all-systems should have failed" || true)
|
2021-12-09 17:26:46 +02:00
|
|
|
echo "$checkRes" | grepQuiet "packages.system-1.default"
|
|
|
|
echo "$checkRes" | grepQuiet "packages.system-2.default"
|