nixos-config/machines/cherry/hardware-configuration/default.nix
Ingolf Wagner 7a6510a4e6
nix fmt
2024-08-29 08:26:04 +07:00

32 lines
1,011 B
Nix

{
lib,
config,
factsGenerator,
...
}:
{
imports = [
./disko-config.nix
./hardware-configuration.nix
./graphics.nix
];
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.systemd-boot.enable = true;
boot.tmp.useTmpfs = true;
# ZFS stuff
# ---------
boot.supportedFilesystems = [ "zfs" ];
clan.core.facts.services.zfs = factsGenerator.zfs { };
networking.hostId = config.clan.core.facts.services.zfs.public."zfs.hostId".value;
services.zfs.autoSnapshot.enable = true;
# todo not needed anymore if srvos is used
# ZFS already has its own scheduler. Without this my(@Artturin) computer froze for a second when i nix build something.
# copied from : https://github.com/numtide/srvos/blob/main/nixos/common/zfs.nix
services.udev.extraRules = lib.optionalString (config.boot.zfs.enabled) ''
ACTION=="add|change", KERNEL=="sd[a-z]*[0-9]*|mmcblk[0-9]*p[0-9]*|nvme[0-9]*n[0-9]*p[0-9]*", ENV{ID_FS_TYPE}=="zfs_member", ATTR{../queue/scheduler}="none"
'';
}