diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-09-10 16:03:03 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2019-09-10 16:03:03 +0200 |
commit | f3f854dac15d5e5318cd0398fd50a8d8db4f6fd0 (patch) | |
tree | e1aa3268393500f5c094eff92f8d79915c44b396 /tests/flakes.sh | |
parent | 4b9dee6bcca48bd60f341cb07273a33e632bafc2 (diff) |
nix flake check: Add some tests
Diffstat (limited to 'tests/flakes.sh')
-rw-r--r-- | tests/flakes.sh | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/tests/flakes.sh b/tests/flakes.sh index 8594a4c55..7f41d5d7e 100644 --- a/tests/flakes.sh +++ b/tests/flakes.sh @@ -344,3 +344,88 @@ nix flake --flake-registry $registry check $flake3Dir rm -rf $TEST_ROOT/flake1-v2 nix flake clone --flake-registry $registry flake1 $TEST_ROOT/flake1-v2 + +# More 'nix flake check' tests. +cat > $flake3Dir/flake.nix <<EOF +{ + edition = 201909; + + outputs = { flake1, self }: { + overlay = final: prev: { + }; + }; +} +EOF + +nix flake check --flake-registry $registry $flake3Dir + +cat > $flake3Dir/flake.nix <<EOF +{ + edition = 201909; + + outputs = { flake1, self }: { + overlay = finalll: prev: { + }; + }; +} +EOF + +(! nix flake check --flake-registry $registry $flake3Dir) + +cat > $flake3Dir/flake.nix <<EOF +{ + edition = 201909; + + outputs = { flake1, self }: { + nixosModules.foo = { + a.b.c = 123; + foo = true; + }; + }; +} +EOF + +nix flake check --flake-registry $registry $flake3Dir + +cat > $flake3Dir/flake.nix <<EOF +{ + edition = 201909; + + outputs = { flake1, self }: { + nixosModules.foo = { + a.b.c = 123; + foo = assert false; true; + }; + }; +} +EOF + +(! nix flake check --flake-registry $registry $flake3Dir) + +cat > $flake3Dir/flake.nix <<EOF +{ + edition = 201909; + + outputs = { flake1, self }: { + nixosModule = { config, pkgs, ... }: { + a.b.c = 123; + }; + }; +} +EOF + +nix flake check --flake-registry $registry $flake3Dir + +cat > $flake3Dir/flake.nix <<EOF +{ + edition = 201909; + + outputs = { flake1, self }: { + nixosModule = { config, pkgs }: { + a.b.c = 123; + }; + }; +} +EOF + +(! nix flake check --flake-registry $registry $flake3Dir) |