2025-01-11 03:55:19 +01:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
{
|
2025-01-02 19:32:39 +00:00
|
|
|
services.fstrim.enable = true;
|
|
|
|
services.zfs = {
|
|
|
|
autoSnapshot.enable = true;
|
|
|
|
trim.enable = true;
|
|
|
|
autoScrub = {
|
|
|
|
enable = true;
|
|
|
|
pools = [ "zpool" ];
|
2025-01-09 22:26:07 +01:00
|
|
|
interval = "weekly";
|
|
|
|
randomizedDelaySec = "6h";
|
2025-01-02 19:32:39 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
networking.hostId = "41ba28ff";
|
|
|
|
boot = {
|
2025-01-21 17:15:17 +01:00
|
|
|
kernelPackages = pkgs.linuxKernel.packages.linux_6_12;
|
|
|
|
zfs.package = pkgs.zfs_2_3;
|
2025-01-02 19:32:39 +00:00
|
|
|
supportedFilesystems = [ "zfs" ];
|
|
|
|
kernelParams = [ "nohibernate" ];
|
|
|
|
plymouth.enable = false;
|
|
|
|
tmp.useTmpfs = true;
|
|
|
|
};
|
2025-01-02 20:02:48 +00:00
|
|
|
|
|
|
|
# unlock over ssh
|
|
|
|
boot.initrd.network = {
|
|
|
|
enable = true;
|
|
|
|
ssh = {
|
|
|
|
enable = true;
|
|
|
|
port = 2222;
|
|
|
|
hostKeys = [ /etc/secrets/initrd/ssh_host_rsa_key ];
|
2025-01-11 03:55:19 +01:00
|
|
|
authorizedKeys = [
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJl9iYG5oHBq/poBn7Jf1/FGWWbAnbx+NKjs7qtT3uAK 0xa@toaster 2024-12-31"
|
|
|
|
];
|
2025-01-02 20:02:48 +00:00
|
|
|
};
|
|
|
|
postCommands = ''
|
2025-01-11 03:55:19 +01:00
|
|
|
zpool import -a
|
|
|
|
echo "zfs load-key -a; killall zfs" >> /root/.profile
|
2025-01-02 20:02:48 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
# support for network
|
2025-01-11 03:55:19 +01:00
|
|
|
boot.initrd.kernelModules = [
|
|
|
|
"igc"
|
|
|
|
"i40e"
|
|
|
|
"mt7921e"
|
|
|
|
];
|
|
|
|
boot.kernelModules = [
|
|
|
|
"igc"
|
|
|
|
"i40e"
|
|
|
|
"mt7921e"
|
|
|
|
];
|
2025-01-02 19:32:39 +00:00
|
|
|
}
|