2022-07-13 19:01:16 +00: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)
|
|
|
|
|
|
|
|
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 17:23:30 +00:00
|
|
|
nixosModules.foo = assert false; {
|
2022-07-13 19:01:16 +00:00
|
|
|
a.b.c = 123;
|
2023-01-05 17:23:30 +00:00
|
|
|
foo = true;
|
2022-07-13 19:01:16 +00: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
|
|
|
|
|
|
|
|
checkRes=$(nix flake check --keep-going $flakeDir 2>&1 && fail "nix flake check should have failed" || true)
|
2021-12-09 15:26:46 +00:00
|
|
|
echo "$checkRes" | grepQuiet "packages.system-1.default"
|
|
|
|
echo "$checkRes" | grepQuiet "packages.system-2.default"
|