diff --git a/default.nix b/default.nix index c02a220..33473bf 100644 --- a/default.nix +++ b/default.nix @@ -16,7 +16,7 @@ let }; in { - inherit types; + types = types; create = cfg: types.diskoLib.create (eval cfg).config.devices; createScript = cfg: pkgs: pkgs.writeScript "disko-create" '' #!/usr/bin/env bash diff --git a/doc.nix b/doc.nix index 63ad9e2..67b17bd 100644 --- a/doc.nix +++ b/doc.nix @@ -19,7 +19,7 @@ let ]; }; options = nixosOptionsDoc { - inherit (eval) options; + options = eval.options; }; md = (runCommand "disko-options.md" { } '' cat >$out < { }) }@args: let - inherit (pkgs) lib; - inherit ((pkgs.callPackage ./lib.nix { inherit makeTest eval-config; })) makeDiskoTest; + 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); - }; + 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") ( @@ -21,8 +23,8 @@ let ); 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; - }; + evalTest "lvm-luks-example" ../example/config.nix // { + standalone = (pkgs.nixos [ ../example/stand-alone/configuration.nix ]).config.system.build.toplevel; + }; in allTests diff --git a/tests/lib.nix b/tests/lib.nix index b4d3f37..43b6607 100644 --- a/tests/lib.nix +++ b/tests/lib.nix @@ -17,7 +17,7 @@ , testBoot ? true # if we actually want to test booting or just create/mount }: let - inherit (pkgs) lib; + lib = pkgs.lib; makeTest' = args: makeTest args { inherit pkgs; @@ -100,7 +100,7 @@ documentation.enable = false; nix.settings = { - substituters = lib.mkForce []; + substituters = lib.mkForce [ ]; hashed-mirrors = null; connect-timeout = 1; }; diff --git a/types/default.nix b/types/default.nix index 8d4d637..2c967f6 100644 --- a/types/default.nix +++ b/types/default.nix @@ -189,7 +189,7 @@ rec { internal = true; readOnly = true; type = lib.types.functionTo diskoLib.jsonType; - inherit (attrs) default; + default = attrs.default; description = "Mount script"; }; @@ -327,7 +327,7 @@ rec { }; subTypes = lib.mapAttrs (_: diskoLib.mkSubType) { - nodev = ./nodev.nix; + nodev = ./nodev.nix; btrfs = ./btrfs.nix; btrfs_subvol = ./btrfs_subvol.nix; filesystem = ./filesystem.nix; @@ -343,6 +343,6 @@ rec { mdadm = ./mdadm.nix; mdraid = ./mdraid.nix; luks = ./luks.nix; - disk = ./disk.nix; + disk = ./disk.nix; }; } diff --git a/types/lvm_vg.nix b/types/lvm_vg.nix index 9b52936..ba313e1 100644 --- a/types/lvm_vg.nix +++ b/types/lvm_vg.nix @@ -42,7 +42,7 @@ vgchange -a y ${lib.concatMapStrings (x: x.dev or "") (lib.attrValues lvMounts)} ''; - inherit (lvMounts) fs; + fs = lvMounts.fs; }; }; _config = lib.mkOption { diff --git a/types/nodev.nix b/types/nodev.nix index 9b5fcea..2700ab7 100644 --- a/types/nodev.nix +++ b/types/nodev.nix @@ -54,8 +54,8 @@ readOnly = true; default = [{ fileSystems.${config.mountpoint} = { - inherit (config) device; - inherit (config) fsType; + device = config.device; + fsType = config.fsType; options = config.mountOptions; }; }]; diff --git a/types/swap.nix b/types/swap.nix index 90c3e22..60a7aff 100644 --- a/types/swap.nix +++ b/types/swap.nix @@ -40,7 +40,7 @@ default = dev: [{ swapDevices = [{ device = dev; - inherit (config) randomEncryption; + randomEncryption = config.randomEncryption; }]; }]; description = "NixOS configuration";