feat: introduce treefmt and fmt all

This commit is contained in:
steveej 2024-11-15 10:17:56 +01:00
parent 80250b0179
commit 27c6c4f9fa
237 changed files with 5440 additions and 5214 deletions

View file

@ -1,10 +1,10 @@
{
lib,
config,
}: let
{ lib, config }:
let
keys = import ../../variables/keys.nix;
in {
mkUser = args:
in
{
mkUser =
args:
lib.mkMerge [
{
isNormalUser = true;
@ -45,7 +45,7 @@ in {
# LVM doesn't allow most characters in VG names
# TODO: replace this with a whitelist for: [a-zA-Z0-9.-_+]
volumeGroup = diskId: builtins.replaceStrings [":"] [""] diskId;
volumeGroup = diskId: builtins.replaceStrings [ ":" ] [ "" ] diskId;
# This is important at install-time
bootGrubDevice = diskId: "/dev/disk/by-id/" + diskId;
@ -56,15 +56,10 @@ in {
# Cannot use the disk ID here because might be different at install vs. runtime.
# Example: MMC card which is used in the internal reader vs. USB reader
bootFsDevice = diskId:
"/dev/disk/by-partlabel/" + (shortenGptPartlabel ("2-" + diskId));
bootLuksDevice = diskId:
"/dev/disk/by-partlabel/" + (shortenGptPartlabel ("3-" + diskId));
bootFsDevice = diskId: "/dev/disk/by-partlabel/" + (shortenGptPartlabel ("2-" + diskId));
bootLuksDevice = diskId: "/dev/disk/by-partlabel/" + (shortenGptPartlabel ("3-" + diskId));
luksName = diskId: (volumeGroup diskId) + "pv";
luksPhysicalVolume = diskId: "/dev/mapper/" + (luksName diskId);
lvmPv = diskId: encrypted:
if encrypted == true
then luksPhysicalVolume diskId
else bootLuksDevice diskId;
lvmPv = diskId: encrypted: if encrypted then luksPhysicalVolume diskId else bootLuksDevice diskId;
};
}