mirror of
https://github.com/nix-community/disko.git
synced 2026-11-30 13:03:28 +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
@@ -24,9 +24,6 @@
|
||||
|
||||
diskoLib = import ./lib {
|
||||
inherit (nixpkgs) lib;
|
||||
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");
|
||||
};
|
||||
in
|
||||
{
|
||||
@@ -62,14 +59,7 @@
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
# FIXME: aarch64-linux seems to hang on boot
|
||||
nixosTests = lib.optionalAttrs pkgs.stdenv.hostPlatform.isx86_64 (
|
||||
import ./tests {
|
||||
inherit pkgs;
|
||||
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");
|
||||
}
|
||||
);
|
||||
nixosTests = lib.optionalAttrs pkgs.stdenv.hostPlatform.isx86_64 (import ./tests { inherit pkgs; });
|
||||
|
||||
disko-install = pkgs.callPackage ./tests/disko-install {
|
||||
inherit self;
|
||||
|
||||
+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 =
|
||||
|
||||
+1
-7
@@ -1,10 +1,4 @@
|
||||
{
|
||||
lib,
|
||||
makeTest,
|
||||
eval-config,
|
||||
qemu-common-lib,
|
||||
...
|
||||
}:
|
||||
{ lib, ... }:
|
||||
|
||||
let
|
||||
testLib = {
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
pkgs,
|
||||
extendModules,
|
||||
diskoLib,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
let
|
||||
@@ -282,9 +281,6 @@ in
|
||||
_module.args.diskoLib = import ./lib {
|
||||
inherit lib;
|
||||
rootMountPoint = config.disko.rootMountPoint;
|
||||
makeTest = import "${modulesPath}/../tests/make-test-python.nix";
|
||||
eval-config = import "${modulesPath}/../lib/eval-config.nix";
|
||||
qemu-common = import "${modulesPath}/../lib/qemu-common.nix";
|
||||
};
|
||||
|
||||
system.build =
|
||||
|
||||
Reference in new issue
Block a user