2023-06-24 13:07:42 +07:00
|
|
|
# device-specific non-portable config
|
2023-12-09 00:38:25 +07:00
|
|
|
{ pkgs
|
|
|
|
, ...
|
|
|
|
}:
|
2023-06-24 13:07:42 +07:00
|
|
|
|
2023-12-09 00:38:25 +07:00
|
|
|
let
|
|
|
|
uuids.efi = "D97E-A4D5";
|
|
|
|
uuids.encroot = "a2c3c9ea-2c73-4786-bff7-5f0aa7097912";
|
|
|
|
uuids.root = "dc669123-d6d3-447f-9ce3-c22587e5fa6a";
|
|
|
|
uuids.encdata = "f1447692-fa7c-4bd6-9cb5-e44c13fddfe3";
|
|
|
|
uuids.data = "fa754b1e-ac83-4851-bf16-88efcd40b657";
|
|
|
|
uuids.swap = "01c21ed8-0f40-4892-825d-81f5ddb9a0a2";
|
|
|
|
parts = builtins.mapAttrs (k: v: "/dev/disk/by-uuid/${v}") uuids;
|
|
|
|
in
|
2023-06-24 13:07:42 +07:00
|
|
|
|
2023-12-09 00:38:25 +07:00
|
|
|
{
|
2023-06-24 13:07:42 +07:00
|
|
|
imports = [
|
2023-08-24 18:27:05 +07:00
|
|
|
../hardware/msi-delta-15
|
2023-06-24 13:07:42 +07:00
|
|
|
../hosts/nixmsi.nix
|
|
|
|
];
|
|
|
|
|
2023-12-09 00:38:25 +07:00
|
|
|
boot.initrd.systemd.enable = false;
|
2023-06-24 13:07:42 +07:00
|
|
|
boot.initrd = {
|
2023-12-09 00:38:25 +07:00
|
|
|
luks.devices.cryptroot = {
|
|
|
|
device = parts.encroot;
|
2023-06-24 13:07:42 +07:00
|
|
|
# see https://asalor.blogspot.de/2011/08/trim-dm-crypt-problems.html before enabling
|
|
|
|
allowDiscards = true;
|
|
|
|
};
|
2023-12-09 00:38:25 +07:00
|
|
|
luks.devices.dataroot = {
|
|
|
|
device = parts.encdata;
|
2023-06-24 13:07:42 +07:00
|
|
|
allowDiscards = true;
|
|
|
|
};
|
|
|
|
};
|
2023-12-09 00:38:25 +07:00
|
|
|
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
|
|
|
|
boot.kernelPackages = pkgs.linuxPackages_testing;
|
|
|
|
boot.kernelParams = [ "boot.shell_on_fail" ];
|
|
|
|
|
|
|
|
fileSystems = {
|
|
|
|
"/" = { device = "none"; fsType = "tmpfs"; neededForBoot = true;
|
2023-06-24 13:07:42 +07:00
|
|
|
options = [ "defaults" "size=2G" "mode=755" ]; };
|
|
|
|
"/persist" =
|
2023-12-09 00:38:25 +07:00
|
|
|
{ device = parts.root; fsType = "bcachefs"; neededForBoot = true;
|
|
|
|
options = [ "discard=1" ]; };
|
|
|
|
"/boot" = { device = parts.efi; fsType = "vfat"; neededForBoot = true; };
|
|
|
|
"/data" = { device = parts.data; fsType = "btrfs";
|
|
|
|
options = [ "discard=async" "compress=zstd:15" ]; };
|
2023-06-24 13:07:42 +07:00
|
|
|
};
|
2023-12-09 00:38:25 +07:00
|
|
|
impermanence.directories = [
|
|
|
|
/root
|
|
|
|
/home
|
|
|
|
/nix
|
|
|
|
];
|
2023-06-24 13:07:42 +07:00
|
|
|
|
|
|
|
impermanence = {
|
|
|
|
enable = true;
|
|
|
|
path = /persist;
|
|
|
|
};
|
|
|
|
|
|
|
|
# fix for my realtek usb ethernet adapter
|
|
|
|
services.tlp.settings.USB_DENYLIST = "0bda:8156";
|
|
|
|
|
2023-12-09 00:38:25 +07:00
|
|
|
swapDevices = [ { device = parts.swap; } ];
|
|
|
|
boot.resumeDevice = parts.swap;
|
2023-06-24 13:07:42 +07:00
|
|
|
|
|
|
|
# dedupe
|
|
|
|
services.beesd = {
|
|
|
|
filesystems.dataroot = {
|
2023-12-09 00:38:25 +07:00
|
|
|
spec = "UUID=${uuids.data}";
|
2023-06-24 13:07:42 +07:00
|
|
|
hashTableSizeMB = 256;
|
|
|
|
extraOptions = [ "--loadavg-target" "8.0" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|