feature(trim): add trim support and change partuuid to disk-labels
This commit is contained in:
@@ -51,6 +51,8 @@ in
|
|||||||
boot.initrd.luks.devices = lib.mapAttrs (name: uuid: {
|
boot.initrd.luks.devices = lib.mapAttrs (name: uuid: {
|
||||||
device = "/dev/disk/by-uuid/${uuid}";
|
device = "/dev/disk/by-uuid/${uuid}";
|
||||||
keyFile = key name;
|
keyFile = key name;
|
||||||
|
# trim for ssds, ignored by drives without discard support
|
||||||
|
allowDiscards = true;
|
||||||
}) drives;
|
}) drives;
|
||||||
fileSystems = lib.mapAttrs' (
|
fileSystems = lib.mapAttrs' (
|
||||||
name: _:
|
name: _:
|
||||||
|
|||||||
@@ -22,18 +22,21 @@
|
|||||||
"usb_storage"
|
"usb_storage"
|
||||||
"sd_mod"
|
"sd_mod"
|
||||||
];
|
];
|
||||||
boot.initrd.kernelModules = [ "dm-crypt dm-mod" ];
|
boot.initrd.luks.devices."cryptroot" = {
|
||||||
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-label/nixcrypt";
|
device = "/dev/disk/by-label/nixcrypt";
|
||||||
|
allowDiscards = true;
|
||||||
|
bypassWorkqueues = true;
|
||||||
|
};
|
||||||
boot.kernelModules = [ ];
|
boot.kernelModules = [ ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" = {
|
||||||
device = "/dev/mapper/lvmroot-root";
|
device = "/dev/disk/by-label/nixroot";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot" = {
|
fileSystems."/boot" = {
|
||||||
device = "/dev/disk/by-uuid/AC1C-20EB";
|
device = "/dev/disk/by-label/nixboot";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
options = [
|
options = [
|
||||||
"fmask=0022"
|
"fmask=0022"
|
||||||
@@ -42,12 +45,12 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/home" = {
|
fileSystems."/home" = {
|
||||||
device = "/dev/mapper/lvmroot-home";
|
device = "/dev/disk/by-label/nixhome";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices = [
|
swapDevices = [
|
||||||
{ device = "/dev/mapper/lvmroot-swap"; }
|
{ device = "/dev/disk/by-label/nixswap"; }
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
|||||||
Reference in New Issue
Block a user