mirror of
https://github.com/nix-community/disko.git
synced 2026-12-01 21:43:29 +01:00
flake + lib + module: drop unused makeTest/eval-config/qemu-common arg threading
After the makeDiskoTest rewrite (commit 4) and the tests/ modulification
(commit 5), the `makeTest`, `eval-config`, and `qemu-common` args
threaded through
flake.nix -> diskoLib = import ./lib { … }
-> import ./tests { … }
lib/default.nix -> testLib = import ./tests.nix { … }
module.nix -> _module.args.diskoLib = import ./lib { … }
are dead — every callsite now imports
`nixos/lib/eval-config.nix` and `nixos/lib/qemu-common.nix` directly
from `pkgs.path` (see `lib/tests.nix`, `lib/install-test.nix`,
`tests/default.nix`). `makeTest` is replaced by the
`nixos-lib.evalTest` call in `module.nix`'s `installTestEval` block.
Strip the dead threading:
- `flake.nix`: drop the three args from the `diskoLib = import ./lib`
call and the `import ./tests` call.
- `lib/default.nix`: drop them from the function signature and from
the `testLib = import ./tests.nix { … }` call; drop the
`qemu-common-lib` derivation that wrapped `qemu-common`.
- `lib/tests.nix`: drop them from the function signature.
- `module.nix`: drop them from the inner `_module.args.diskoLib =
import ./lib { … }` call; drop the now-unused `modulesPath` arg
destructure (its only consumers were the three
`import "${modulesPath}/..."` lines just removed).
This commit is contained in:
1 parent
88275cedd4
commit
c431a60b34
4 files changed
+3
-41
No files matched your search
+1
-19
@@ -1,29 +1,11 @@
|
||||
{
|
||||
lib ? import <nixpkgs/lib>,
|
||||
rootMountPoint ? "/mnt",
|
||||
makeTest ? import <nixpkgs/nixos/tests/make-test-python.nix>,
|
||||
eval-config ? import <nixpkgs/nixos/lib/eval-config.nix>,
|
||||
qemu-common ? import <nixpkgs/nixos/lib/qemu-common.nix>,
|
||||
}:
|
||||
let
|
||||
# qemu-common is a function that takes { lib, stdenv } and returns QEMU utilities
|
||||
qemu-common-lib =
|
||||
pkgs:
|
||||
qemu-common {
|
||||
inherit lib;
|
||||
inherit (pkgs) stdenv;
|
||||
};
|
||||
|
||||
outputs = import ../default.nix { inherit lib diskoLib; };
|
||||
diskoLib = {
|
||||
testLib = import ./tests.nix {
|
||||
inherit
|
||||
lib
|
||||
makeTest
|
||||
eval-config
|
||||
qemu-common-lib
|
||||
;
|
||||
};
|
||||
testLib = import ./tests.nix { inherit lib; };
|
||||
# like lib.types.oneOf but instead of a list takes an attrset
|
||||
# uses the field "type" to find the correct type in the attrset
|
||||
subType =
|
||||
|
||||
Reference in new issue
Block a user