]> Git — Sourcephile - sourcephile-nix.git/blob - servers/mermet/apu2e4.nix
mermet: add postfix
[sourcephile-nix.git] / servers / mermet / apu2e4.nix
1 { pkgs, lib, config, ... }:
2 {
3 imports =
4 [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
5 ];
6
7 hardware.cpu.amd.updateMicrocode = true;
8
9 boot.kernel = {
10 sysctl = {
11 "vm.swappiness" = 10;
12 "vm.vfs_cache_pressure" = 50;
13 };
14 };
15
16 boot.loader = {
17 grub = {
18 enable = true;
19 version = 2;
20 copyKernels = true;
21 # efiSupport = true;
22 devices = [
23 "/dev/disk/by-id/ata-Samsung_SSD_840_EVO_250GB_S1DBNSAF340110R"
24 ];
25 /*
26 mirroredBoots = [
27 { devices = [ "${disk_id}" ];
28 path = "/boot${bootnum}";
29 }
30 ];
31 */
32 };
33 /*
34 efi = {
35 canTouchEfiVariables = true;
36 efiSysMountPoint = "/boot/efi";
37 efiInstallAsRemovable = false;
38 };
39 */
40 };
41
42 boot.initrd = {
43 availableKernelModules = [
44 "ahci"
45 "ehci_pci"
46 "sd_mod"
47 "uas"
48 # Ethernet driver
49 "igb"
50 # Made the AES modules available at initrd,
51 # to speedup the deciphering of the root.
52 "aes_x86_64"
53 "aesni_intel"
54 "cryptd"
55 ];
56 kernelModules = [ ];
57
58 };
59 boot.kernelModules = [ ];
60 boot.extraModulePackages = [ ];
61 boot.kernelParams = [
62 "gfxpayload=text"
63 #"console=tty0"
64 "console=ttyS0,115200n8"
65 "zfs.zfs_arc_max=262144000" # 250Mo
66 ];
67
68 fileSystems."/boot" =
69 { device = "/dev/disk/by-uuid/dc3c5387-17d2-43b3-bfa2-bf73afacca07";
70 fsType = "ext2";
71 };
72
73 fileSystems."/boot/efi" =
74 { device = "/dev/disk/by-uuid/62E6-E65F";
75 fsType = "vfat";
76 };
77
78 swapDevices =
79 [ { device = "/dev/disk/by-partuuid/6b1eaa35-776b-4e60-b21e-7bcee535dd8b";
80 randomEncryption = {
81 enable = true;
82 cipher = "aes-xts-plain64";
83 source = "/dev/urandom";
84 };
85 }
86 ];
87
88 nix.maxJobs = lib.mkDefault 4;
89 powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
90
91 environment = {
92 systemPackages = with pkgs; [
93 pciutils
94 flashrom
95 ];
96 };
97 }