From af27d7917d4d4fd06cade863c6df00e8c0767521 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 12 May 2023 17:20:14 +0200 Subject: [PATCH] run nix fmt --- linux-testing-bcachefs.nix | 2 +- types/lvm_vg.nix | 38 +++++++++++++++++++++++--------------- types/table.nix | 32 ++++++++++++++++++++------------ types/zfs_fs.nix | 2 +- types/zpool.nix | 2 +- 5 files changed, 46 insertions(+), 30 deletions(-) diff --git a/linux-testing-bcachefs.nix b/linux-testing-bcachefs.nix index ac8d828..0d3050b 100644 --- a/linux-testing-bcachefs.nix +++ b/linux-testing-bcachefs.nix @@ -8,7 +8,7 @@ buildLinux (args // { # NOTE: bcachefs-tools should be updated simultaneously to preserve compatibility version = "6.3.0-2023-05-02"; - + modDirVersion = "6.3.0"; src = fetchFromGitHub { diff --git a/types/lvm_vg.nix b/types/lvm_vg.nix index ea573f1..2d7a551 100644 --- a/types/lvm_vg.nix +++ b/types/lvm_vg.nix @@ -44,9 +44,11 @@ readOnly = true; type = diskoLib.jsonType; default = - diskoLib.deepMergeMap (lv: - lib.optionalAttrs (lv.content != null) (lv.content._meta [ "lvm_vg" config.name ]) - ) (lib.attrValues config.lvs); + diskoLib.deepMergeMap + (lv: + lib.optionalAttrs (lv.content != null) (lv.content._meta [ "lvm_vg" config.name ]) + ) + (lib.attrValues config.lvs); description = "Metadata"; }; _create = diskoLib.mkCreateOption { @@ -71,9 +73,11 @@ inherit config options; default = _: let - lvMounts = diskoLib.deepMergeMap (lv: - lib.optionalAttrs (lv.content != null) (lv.content._mount { dev = "/dev/${config.name}/${lv.name}"; }) - ) (lib.attrValues config.lvs); + lvMounts = diskoLib.deepMergeMap + (lv: + lib.optionalAttrs (lv.content != null) (lv.content._mount { dev = "/dev/${config.name}/${lv.name}"; }) + ) + (lib.attrValues config.lvs); in { dev = '' @@ -87,21 +91,25 @@ internal = true; readOnly = true; default = - map (lv: [ - (lib.optional (lv.content != null) (lv.content._config "/dev/${config.name}/${lv.name}")) - (lib.optional (lv.lvm_type != null) { - boot.initrd.kernelModules = [ "dm-${lv.lvm_type}" ]; - }) - ]) (lib.attrValues config.lvs); + map + (lv: [ + (lib.optional (lv.content != null) (lv.content._config "/dev/${config.name}/${lv.name}")) + (lib.optional (lv.lvm_type != null) { + boot.initrd.kernelModules = [ "dm-${lv.lvm_type}" ]; + }) + ]) + (lib.attrValues config.lvs); description = "NixOS configuration"; }; _pkgs = lib.mkOption { internal = true; readOnly = true; type = lib.types.functionTo (lib.types.listOf lib.types.package); - default = pkgs: lib.flatten (map (lv: - lib.optional (lv.content != null) (lv.content._pkgs pkgs) - ) (lib.attrValues config.lvs)); + default = pkgs: lib.flatten (map + (lv: + lib.optional (lv.content != null) (lv.content._pkgs pkgs) + ) + (lib.attrValues config.lvs)); description = "Packages"; }; }; diff --git a/types/table.nix b/types/table.nix index 0d9fb14..eb8121a 100644 --- a/types/table.nix +++ b/types/table.nix @@ -65,9 +65,11 @@ readOnly = true; type = lib.types.functionTo diskoLib.jsonType; default = dev: - lib.foldr lib.recursiveUpdate {} (lib.imap (index: partition: - lib.optionalAttrs (partition.content != null) (partition.content._meta dev) - ) config.partitions); + lib.foldr lib.recursiveUpdate { } (lib.imap + (index: partition: + lib.optionalAttrs (partition.content != null) (partition.content._meta dev) + ) + config.partitions); description = "Metadata"; }; _create = diskoLib.mkCreateOption { @@ -99,9 +101,11 @@ inherit config options; default = { dev }: let - partMounts = lib.foldr lib.recursiveUpdate {} (lib.imap (index: partition: - lib.optionalAttrs (partition.content != null) (partition.content._mount { dev = diskoLib.deviceNumbering dev index; }) - ) config.partitions); + partMounts = lib.foldr lib.recursiveUpdate { } (lib.imap + (index: partition: + lib.optionalAttrs (partition.content != null) (partition.content._mount { dev = diskoLib.deviceNumbering dev index; }) + ) + config.partitions); in { dev = partMounts.dev or ""; @@ -112,9 +116,11 @@ internal = true; readOnly = true; default = dev: - lib.imap (index: partition: - lib.optional (partition.content != null) (partition.content._config (diskoLib.deviceNumbering dev index)) - ) config.partitions; + lib.imap + (index: partition: + lib.optional (partition.content != null) (partition.content._config (diskoLib.deviceNumbering dev index)) + ) + config.partitions; description = "NixOS configuration"; }; _pkgs = lib.mkOption { @@ -122,9 +128,11 @@ readOnly = true; type = lib.types.functionTo (lib.types.listOf lib.types.package); default = pkgs: - [ pkgs.parted pkgs.systemdMinimal ] ++ lib.flatten (map (partition: - lib.optional (partition.content != null) (partition.content._pkgs pkgs) - ) config.partitions); + [ pkgs.parted pkgs.systemdMinimal ] ++ lib.flatten (map + (partition: + lib.optional (partition.content != null) (partition.content._pkgs pkgs) + ) + config.partitions); description = "Packages"; }; }; diff --git a/types/zfs_fs.nix b/types/zfs_fs.nix index 1a4813b..ae0bf2f 100644 --- a/types/zfs_fs.nix +++ b/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/types/zpool.nix b/types/zpool.nix index a8f9ccb..b3965a3 100644 --- a/types/zpool.nix +++ b/types/zpool.nix @@ -85,7 +85,7 @@ zpool import -l -R ${config.mountRoot} '${config.name}' ${lib.concatMapStrings (x: x.dev or "") (lib.attrValues datasetMounts)} ''; - fs = (datasetMounts.fs or {}) // lib.optionalAttrs (config.mountpoint != null) { + fs = (datasetMounts.fs or { }) // lib.optionalAttrs (config.mountpoint != null) { ${config.mountpoint} = '' if ! findmnt ${config.name} "${rootMountPoint}${config.mountpoint}" > /dev/null 2>&1; then mount ${config.name} "${rootMountPoint}${config.mountpoint}" \