diff --git a/doc.nix b/doc.nix index e171058..745686a 100644 --- a/doc.nix +++ b/doc.nix @@ -27,7 +27,7 @@ let EOF cat ${options.optionsCommonMark} >>$out - '').overrideAttrs (o: { + '').overrideAttrs (_o: { # Work around https://github.com/hercules-ci/hercules-ci-agent/issues/168 allowSubstitutes = true; }); diff --git a/lib/default.nix b/lib/default.nix index 0b760c8..be96594 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -11,7 +11,7 @@ let name = "subType"; description = "one of ${concatStringsSep "," (attrNames typeAttr)}"; check = x: if x ? type then typeAttr.${x.type}.check x else throw "No type option set in:\n${generators.toPretty {} x}"; - merge = loc: foldl' (res: def: typeAttr.${def.value.type}.merge loc [ def ]) { }; + merge = loc: foldl' (_res: def: typeAttr.${def.value.type}.merge loc [ def ]) { }; nestedTypes = typeAttr; }; @@ -171,10 +171,6 @@ let readOnly = true; type = lib.types.functionTo lib.types.str; default = args: - let - name = "format"; - test = lib.optionalString (config ? name) "${config.${name}}"; - in '' ( # ${config.type} ${concatMapStringsSep " " (n: toString (config.${n} or "")) ["name" "device" "format" "mountpoint"]} ${diskoLib.defineHookVariables { inherit config options; }} diff --git a/lib/types/btrfs.nix b/lib/types/btrfs.nix index b95fb80..88f207a 100644 --- a/lib/types/btrfs.nix +++ b/lib/types/btrfs.nix @@ -59,7 +59,7 @@ internal = true; readOnly = true; type = lib.types.functionTo diskoLib.jsonType; - default = dev: { }; + default = _dev: { }; description = "Metadata"; }; _create = diskoLib.mkCreateOption { diff --git a/lib/types/filesystem.nix b/lib/types/filesystem.nix index afe0ebe..c604938 100644 --- a/lib/types/filesystem.nix +++ b/lib/types/filesystem.nix @@ -29,7 +29,7 @@ internal = true; readOnly = true; type = lib.types.functionTo diskoLib.jsonType; - default = dev: { }; + default = _dev: { }; description = "Metadata"; }; _create = diskoLib.mkCreateOption { diff --git a/lib/types/lvm_pv.nix b/lib/types/lvm_pv.nix index 1bf1c10..bc988dc 100644 --- a/lib/types/lvm_pv.nix +++ b/lib/types/lvm_pv.nix @@ -34,7 +34,7 @@ _config = lib.mkOption { internal = true; readOnly = true; - default = dev: [ ]; + default = _dev: [ ]; description = "NixOS configuration"; }; _pkgs = lib.mkOption { diff --git a/lib/types/mdraid.nix b/lib/types/mdraid.nix index 52b7b03..1c7a0d0 100644 --- a/lib/types/mdraid.nix +++ b/lib/types/mdraid.nix @@ -34,7 +34,7 @@ _config = lib.mkOption { internal = true; readOnly = true; - default = dev: [ ]; + default = _dev: [ ]; description = "NixOS configuration"; }; _pkgs = lib.mkOption { diff --git a/lib/types/nodev.nix b/lib/types/nodev.nix index aa6a2ef..69ea6c2 100644 --- a/lib/types/nodev.nix +++ b/lib/types/nodev.nix @@ -65,7 +65,7 @@ internal = true; readOnly = true; type = lib.types.functionTo (lib.types.listOf lib.types.package); - default = pkgs: [ ]; + default = _pkgs: [ ]; description = "Packages"; }; }; diff --git a/lib/types/swap.nix b/lib/types/swap.nix index 60a7aff..e886453 100644 --- a/lib/types/swap.nix +++ b/lib/types/swap.nix @@ -15,7 +15,7 @@ internal = true; readOnly = true; type = lib.types.functionTo diskoLib.jsonType; - default = dev: { }; + default = _dev: { }; description = "Metadata"; }; _create = diskoLib.mkCreateOption { diff --git a/lib/types/table.nix b/lib/types/table.nix index 6d5e390..0009990 100644 --- a/lib/types/table.nix +++ b/lib/types/table.nix @@ -12,7 +12,7 @@ description = "The kind of partition table"; }; partitions = lib.mkOption { - type = lib.types.listOf (lib.types.submodule ({ config, ... }: { + type = lib.types.listOf (lib.types.submodule ({ ... }: { options = { part-type = lib.mkOption { type = lib.types.enum [ "primary" "logical" "extended" ]; @@ -60,7 +60,7 @@ type = lib.types.functionTo diskoLib.jsonType; default = dev: lib.foldr lib.recursiveUpdate { } (lib.imap - (index: partition: + (_index: partition: lib.optionalAttrs (partition.content != null) (partition.content._meta dev) ) config.partitions); diff --git a/lib/types/zfs.nix b/lib/types/zfs.nix index 26e53ab..257afa9 100644 --- a/lib/types/zfs.nix +++ b/lib/types/zfs.nix @@ -33,7 +33,7 @@ _config = lib.mkOption { internal = true; readOnly = true; - default = dev: [ ]; + default = _dev: [ ]; description = "NixOS configuration"; }; _pkgs = lib.mkOption { diff --git a/lib/types/zfs_fs.nix b/lib/types/zfs_fs.nix index c943794..6c53852 100644 --- a/lib/types/zfs_fs.nix +++ b/lib/types/zfs_fs.nix @@ -33,7 +33,7 @@ internal = true; readOnly = true; type = lib.types.functionTo diskoLib.jsonType; - default = dev: { }; + default = _dev: { }; description = "Metadata"; }; _create = diskoLib.mkCreateOption { diff --git a/lib/types/zfs_volume.nix b/lib/types/zfs_volume.nix index 6eb3848..f0cd849 100644 --- a/lib/types/zfs_volume.nix +++ b/lib/types/zfs_volume.nix @@ -1,4 +1,4 @@ -{ config, options, lib, diskoLib, rootMountPoint, ... }: +{ config, options, lib, diskoLib, ... }: { options = { name = lib.mkOption { diff --git a/tests/bcachefs.nix b/tests/bcachefs.nix index c5b073f..609165a 100644 --- a/tests/bcachefs.nix +++ b/tests/bcachefs.nix @@ -16,7 +16,7 @@ makeDiskoTest { boot.supportedFilesystems = [ "bcachefs" ]; # disable zfs so we can support latest kernel nixpkgs.overlays = [ - (final: super: { + (_final: super: { zfs = super.zfs.overrideAttrs (_: { meta.platforms = [ ]; }); diff --git a/tests/default.nix b/tests/default.nix index a365e61..4a19137 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -1,20 +1,11 @@ { makeTest ? import , eval-config ? import , pkgs ? (import { }) -}@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.callPackage ../. { checked = true; }).createScript disko-config pkgs; - "${name}-tsp-mount" = (pkgs.callPackage ../. { checked = true; }).mountScript disko-config pkgs; - }; - allTestFilenames = builtins.map (lib.removeSuffix ".nix") ( builtins.filter diff --git a/tests/lib.nix b/tests/lib.nix index 50c41d0..f4cd232 100644 --- a/tests/lib.nix +++ b/tests/lib.nix @@ -74,7 +74,7 @@ name = "disko-${name}"; inherit enableOCR; - nodes.machine = { config, pkgs, modulesPath, ... }: { + nodes.machine = { pkgs, modulesPath, ... }: { imports = [ (lib.optionalAttrs (testMode == "module") { imports = [