@@ -28,33 +28,30 @@ Note: this is for installing ZFS on an existing
28
28
NixOS installation. To use ZFS as root file system,
29
29
see below.
30
30
31
- Live image ships with ZFS support by default.
31
+ NixOS live image ships with ZFS support by default.
32
32
33
33
Note that you need to apply these settings even if you don't need
34
34
to boot from ZFS. The kernel module 'zfs.ko' will not be available
35
35
to modprobe until you make these changes and reboot.
36
36
37
- #. Import separate configration file for ZFS options::
37
+ #. Edit ``/etc/nixos/configuration.nix `` and add the following
38
+ options::
38
39
39
- vim /etc/nixos/configuration.nix
40
- ##add './ zfs.nix' to 'imports'
41
- # imports = [ ./zfs.nix ] ;
40
+ boot.supportedFilesystems = [ "zfs" ];
41
+ boot. zfs.forceImportRoot = false;
42
+ networking.hostId = "yourHostId" ;
42
43
43
- #. Configure ZFS options ::
44
+ Where hostID can be generated with ::
44
45
45
- tee -a /etc/nixos/zfs.nix <<EOF
46
- { config, pkgs, ... }:
47
-
48
- {
49
- boot.supportedFilesystems = [ "zfs" ];
50
- networking.hostId = "$(head -c4 /dev/urandom | od -A none -t x4 | sed 's| ||g')";
51
- boot.zfs.forceImportRoot = false;
52
- }
53
- EOF
46
+ head -c4 /dev/urandom | od -A none -t x4
54
47
55
48
#. Apply configuation changes::
56
49
57
- nixos-rebuild switch
50
+ nixos-rebuild boot
51
+
52
+ #. Reboot::
53
+
54
+ reboot
58
55
59
56
Root on ZFS
60
57
-----------
@@ -63,3 +60,27 @@ Root on ZFS
63
60
:glob:
64
61
65
62
*
63
+
64
+ Contribute
65
+ ----------
66
+
67
+ You can contribute to this documentation. Fork this repo, edit the
68
+ documentation, then opening a pull request.
69
+
70
+ #. To test your changes locally, use the devShell in this repo::
71
+
72
+ git clone https://github.com/ne9z/nixos-live openzfs-docs-dev
73
+ cd openzfs-docs-dev
74
+ nix develop ./openzfs-docs-dev/#docs
75
+
76
+ #. Inside the openzfs-docs repo, build pages::
77
+
78
+ make html
79
+
80
+ #. Look for errors and warnings in the make output. If there is no
81
+ errors::
82
+
83
+ xdg-open _build/html/index.html
84
+
85
+ #. ``git commit --signoff `` to a branch, ``git push ``, and create a
86
+ pull request. Mention @ne9z.
0 commit comments