]> Git — Sourcephile - sourcephile-nix.git/blob - servers/mermet/system/zfs.nix
nix: add mem and swaplist
[sourcephile-nix.git] / servers / mermet / system / zfs.nix
1 { pkgs, lib, config, ... }:
2
3 {
4 imports = [];
5
6 boot.supportedFilesystems = [ "zfs" ];
7
8 # The 32-bit host id of the machine, formatted as 8 hexadecimal characters.
9 # You should try to make this id unique among your machines.
10 # Manually generated with : head -c4 /dev/urandom | od -A none -t x4 | cut -d ' ' -f 2
11 networking.hostId = "69c40b03";
12
13 # noop is the recommended elevator with zfs.
14 boot.kernelParams = [
15 "elevator=noop"
16 ];
17
18 # Ensure extra safeguards are active that zfs uses to protect zfs pools.
19 boot.zfs.forceImportAll = false;
20 boot.zfs.forceImportRoot = false;
21
22 boot.zfs.enableUnstable = true;
23 boot.zfs.requestEncryptionCredentials = true;
24
25 # Enables periodic scrubbing of ZFS pools.
26 services.zfs.autoScrub.enable = true;
27
28 environment = {
29 systemPackages = [
30 pkgs.mbuffer
31 pkgs.zfs
32 ];
33 };
34
35 /*
36 # Enable the (OpenSolaris-compatible) ZFS auto-snapshotting service.
37 services.zfs.autoSnapshot = {
38 enable = true;
39 frequent = ;
40 hourly = ;
41 daily = ;
42 weekly = ;
43 monthly = ;
44 };
45 */
46
47 /*
48 fileSystems."/boot" =
49 { device = "bpool/boot";
50 fsType = "zfs";
51 };
52 */
53 fileSystems."/" =
54 { device = "rpool/root";
55 fsType = "zfs";
56 };
57
58 fileSystems."/home" =
59 { device = "rpool/home";
60 fsType = "zfs";
61 };
62
63 fileSystems."/nix" =
64 { device = "rpool/nix";
65 fsType = "zfs";
66 };
67
68 fileSystems."/nix/var" =
69 { device = "rpool/nix/var";
70 fsType = "zfs";
71 };
72
73 fileSystems."/var" =
74 { device = "rpool/var";
75 fsType = "zfs";
76 };
77
78 fileSystems."/var/cache" =
79 { device = "rpool/var/cache";
80 fsType = "zfs";
81 };
82
83 fileSystems."/var/log" =
84 { device = "rpool/var/log";
85 fsType = "zfs";
86 };
87
88 fileSystems."/var/mail" =
89 { device = "rpool/var/mail";
90 fsType = "zfs";
91 };
92
93 fileSystems."/var/tmp" =
94 { device = "rpool/var/tmp";
95 fsType = "zfs";
96 };
97
98 fileSystems."/var/www" =
99 { device = "rpool/var/www";
100 fsType = "zfs";
101 };
102 }