summaryrefslogtreecommitdiff
path: root/archetypes/profiles/zfs
diff options
context:
space:
mode:
Diffstat (limited to 'archetypes/profiles/zfs')
-rw-r--r--archetypes/profiles/zfs/default.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/archetypes/profiles/zfs/default.nix b/archetypes/profiles/zfs/default.nix
new file mode 100644
index 0000000..a3ca2e1
--- /dev/null
+++ b/archetypes/profiles/zfs/default.nix
@@ -0,0 +1,24 @@
+{ lib, pkgs, ... }: let
+ mkZfs = lib.mkOverride 810;
+
+ # https://wiki.nixos.org/wiki/ZFS
+ nixosConfig = {
+ boot._loader = {
+ grub.zfsSupport = mkZfs true;
+ mode = mkZfs "efi";
+ };
+
+ services.zfs = {
+ trim.enable = mkZfs true;
+ autoSnapshot.enable = mkZfs true;
+ autoScrub.enable = mkZfs true;
+ };
+
+ # Make docker work with zfs
+ virtualisation.docker.storageDriver = mkZfs "zfs";
+ };
+
+ homeConfig = {};
+in {
+ imports = [ (lib._mkProfileArchetype "zfs" nixosConfig homeConfig) ];
+}