mirror of
https://github.com/TECHNOFAB11/disko.git
synced 2025-12-12 16:10:03 +01:00
As discussed in [this comment](https://github.com/nix-community/disko/pull/143#discussion_r1097912402), as a blanket rule converting everything possible to `inherit` like statements can hurt readability. Add config file for statix to disable these checks and fixes, then rerun the autofix with these options.
28 lines
1.1 KiB
Nix
28 lines
1.1 KiB
Nix
{ makeTest ? import <nixpkgs/nixos/tests/make-test-python.nix>
|
|
, eval-config ? import <nixpkgs/nixos/lib/eval-config.nix>
|
|
, pkgs ? (import <nixpkgs> { })
|
|
}@args:
|
|
let
|
|
lib = pkgs.lib;
|
|
makeDiskoTest = (pkgs.callPackage ./lib.nix { inherit makeTest eval-config; }).makeDiskoTest;
|
|
|
|
evalTest = name: configFile: let
|
|
disko-config = import configFile;
|
|
in {
|
|
"${name}-tsp-create" = pkgs.writeScript "create" ((pkgs.callPackage ../. { }).create disko-config);
|
|
"${name}-tsp-mount" = pkgs.writeScript "mount" ((pkgs.callPackage ../. { }).mount disko-config);
|
|
};
|
|
|
|
allTestFilenames =
|
|
builtins.map (lib.removeSuffix ".nix") (
|
|
builtins.filter
|
|
(x: lib.hasSuffix ".nix" x && x != "default.nix" && x != "lib.nix")
|
|
(lib.attrNames (builtins.readDir ./.))
|
|
);
|
|
|
|
allTests = lib.genAttrs allTestFilenames (test: import (./. + "/${test}.nix") { inherit makeDiskoTest pkgs; }) //
|
|
evalTest "lvm-luks-example" ../example/config.nix // {
|
|
standalone = (pkgs.nixos [ ../example/stand-alone/configuration.nix ]).config.system.build.toplevel;
|
|
};
|
|
in
|
|
allTests
|