nixos-config/machines/cherry/hardware-configuration/default.nix

27 lines
984 B
Nix
Raw Permalink Normal View History

2024-06-08 23:17:42 +02:00
{ lib, config, factsGenerator, ... }:
2024-03-03 14:56:49 +01:00
{
imports = [
./disko-config.nix
./hardware-configuration.nix
];
boot.loader.efi.canTouchEfiVariables = true;
2024-05-29 20:16:04 +02:00
boot.loader.systemd-boot.enable = true;
boot.tmp.useTmpfs = true;
2024-03-03 14:56:49 +01:00
# ZFS stuff
# ---------
boot.supportedFilesystems = [ "zfs" ];
2024-06-19 13:19:55 +02:00
clan.core.facts.services.zfs = factsGenerator.zfs { };
networking.hostId = config.clan.core.facts.services.zfs.public."zfs.hostId".value;
2024-03-03 14:56:49 +01:00
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"
'';
}