From 69f1337980756fe4ac001cadce7760e7b06c75da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 26 Aug 2022 08:41:58 +0200 Subject: fix inconsistent indentation with nixpkgs-fmt --- tests/lib.nix | 75 ++++++++++++++++++++++++++++++----------------------------- 1 file changed, 38 insertions(+), 37 deletions(-) (limited to 'tests/lib.nix') diff --git a/tests/lib.nix b/tests/lib.nix index b98be69..2ec42e6 100644 --- a/tests/lib.nix +++ b/tests/lib.nix @@ -1,47 +1,48 @@ -{ pkgs ? (import {}) +{ pkgs ? (import { }) , makeTest ? import , ... }: { - makeDiskoTest = { - disko-config, - extraTestScript, - extraConfig ? {} - }: - let - lib = pkgs.lib; - makeTest' = args: - makeTest args { - inherit pkgs; - inherit (pkgs) system; - }; - tsp-create = pkgs.writeScript "create" ((pkgs.callPackage ../. {}).create disko-config); - tsp-mount = pkgs.writeScript "mount" ((pkgs.callPackage ../. {}).mount disko-config); - num-disks = builtins.length (builtins.filter (x: builtins.match "vd." x == []) (lib.attrNames disko-config.content)); - in makeTest' { - name = "disko"; + makeDiskoTest = + { disko-config + , extraTestScript + , extraConfig ? { } + }: + let + lib = pkgs.lib; + makeTest' = args: + makeTest args { + inherit pkgs; + inherit (pkgs) system; + }; + tsp-create = pkgs.writeScript "create" ((pkgs.callPackage ../. { }).create disko-config); + tsp-mount = pkgs.writeScript "mount" ((pkgs.callPackage ../. { }).mount disko-config); + num-disks = builtins.length (builtins.filter (x: builtins.match "vd." x == [ ]) (lib.attrNames disko-config.content)); + in + makeTest' { + name = "disko"; - nodes.machine = - { config, pkgs, modulesPath, ... }: + nodes.machine = + { config, pkgs, modulesPath, ... }: - { - imports = [ - (modulesPath + "/profiles/installation-device.nix") - (modulesPath + "/profiles/base.nix") - ]; + { + imports = [ + (modulesPath + "/profiles/installation-device.nix") + (modulesPath + "/profiles/base.nix") + ]; - # speed-up eval - documentation.enable = false; + # speed-up eval + documentation.enable = false; - virtualisation.emptyDiskImages = builtins.genList (_: 512) num-disks; - } // extraConfig; + virtualisation.emptyDiskImages = builtins.genList (_: 512) num-disks; + } // extraConfig; - testScript = '' - machine.succeed("echo 'secret' > /tmp/secret.key"); - machine.succeed("${tsp-create}"); - machine.succeed("${tsp-mount}"); - machine.succeed("${tsp-mount}"); # verify that the command is idempotent - ${extraTestScript} - ''; - }; + testScript = '' + machine.succeed("echo 'secret' > /tmp/secret.key"); + machine.succeed("${tsp-create}"); + machine.succeed("${tsp-mount}"); + machine.succeed("${tsp-mount}"); # verify that the command is idempotent + ${extraTestScript} + ''; + }; } -- cgit v1.2.3