]> Git — Sourcephile - sourcephile-nix.git/blob - network/mermet/system/zfs.nix
nix: revamp the hierarchy
[sourcephile-nix.git] / network / 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, the recommended elevator with zfs.
14 boot.kernelParams = [
15 "elevator=noop"
16 ];
17
18 # FIXME: Uncomment [on a working system] to 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 /*
29 # Enable the (OpenSolaris-compatible) ZFS auto-snapshotting service.
30 services.zfs.autoSnapshot = {
31 enable = true;
32 frequent = ;
33 hourly = ;
34 daily = ;
35 weekly = ;
36 monthly = ;
37 };
38 */
39 /*
40 fileSystems."/boot" =
41 { device = "bpool/boot";
42 fsType = "zfs";
43 };
44 */
45 fileSystems."/" =
46 { device = "rpool/root";
47 fsType = "zfs";
48 };
49
50 fileSystems."/home" =
51 { device = "rpool/home";
52 fsType = "zfs";
53 };
54
55 fileSystems."/nix" =
56 { device = "rpool/nix";
57 fsType = "zfs";
58 };
59
60 fileSystems."/nix/var" =
61 { device = "rpool/nix/var";
62 fsType = "zfs";
63 };
64
65 fileSystems."/var" =
66 { device = "rpool/var";
67 fsType = "zfs";
68 };
69
70 fileSystems."/var/cache" =
71 { device = "rpool/var/cache";
72 fsType = "zfs";
73 };
74
75 fileSystems."/var/log" =
76 { device = "rpool/var/log";
77 fsType = "zfs";
78 };
79
80 fileSystems."/var/mail" =
81 { device = "rpool/var/mail";
82 fsType = "zfs";
83 };
84
85 fileSystems."/var/tmp" =
86 { device = "rpool/var/tmp";
87 fsType = "zfs";
88 };
89
90 fileSystems."/var/www" =
91 { device = "rpool/var/www";
92 fsType = "zfs";
93 };
94
95 }