From 8f8cea0ab2690a80e895758575c5cbeb21aa3fc0 Mon Sep 17 00:00:00 2001 From: Leyla Becker Date: Sun, 15 Sep 2024 10:12:32 -0500 Subject: [PATCH] added zfs disks to defiant --- hosts/defiant/configuration.nix | 1 - hosts/defiant/disko-config.nix | 130 ++++++++++++++++---------------- hosts/horizon/configuration.nix | 2 +- 3 files changed, 66 insertions(+), 67 deletions(-) diff --git a/hosts/defiant/configuration.nix b/hosts/defiant/configuration.nix index bff81ea..bc6c34c 100644 --- a/hosts/defiant/configuration.nix +++ b/hosts/defiant/configuration.nix @@ -63,7 +63,6 @@ systemd.targets.hibernate.enable = false; systemd.targets.hybrid-sleep.enable = false; - # temp enable password auth over ssh for setup services.openssh = { enable = true; ports = [ 22 ]; diff --git a/hosts/defiant/disko-config.nix b/hosts/defiant/disko-config.nix index 3a113eb..7fd2427 100644 --- a/hosts/defiant/disko-config.nix +++ b/hosts/defiant/disko-config.nix @@ -20,14 +20,14 @@ let mountpoint = "/boot"; }; }; - root = { - size = "100%"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; - }; + # root = { + # size = "100%"; + # content = { + # type = "filesystem"; + # format = "ext4"; + # mountpoint = "/"; + # }; + # }; }; }; }; @@ -52,69 +52,69 @@ in { disk = { boot = bootDisk "/dev/sda"; # "/dev/disk/by-path/pci-0000:23:00.3-usb-0:1:1.0-scsi-0:0:0:0"; - # hd_13_tb_a = zfsDisk "/dev/disk/by-id/ata-ST18000NE000-3G6101_ZVTCXVEB"; - # hd_13_tb_b = zfsDisk "/dev/disk/by-id/ata-ST18000NE000-3G6101_ZVTCXWSC"; - # hd_13_tb_c = zfsDisk "/dev/disk/by-id/ata-ST18000NE000-3G6101_ZVTD10EH"; + hd_13_tb_a = zfsDisk "/dev/disk/by-id/ata-ST18000NE000-3G6101_ZVTCXVEB"; + hd_13_tb_b = zfsDisk "/dev/disk/by-id/ata-ST18000NE000-3G6101_ZVTCXWSC"; + hd_13_tb_c = zfsDisk "/dev/disk/by-id/ata-ST18000NE000-3G6101_ZVTD10EH"; # ssd_2_tb_a = zfsDisk "/dev/disk/by-id/XXX"; }; - # zpool = { - # zpool = { - # type = "zpool"; - # mode = { - # topology = { - # type = "topology"; - # vdev = [ - # { - # # should this only mirror for this inital config with 3 drives we will used raidz2 for future configs??? - # mode = "mirror"; - # members = [ - # "hd_13_tb_a" "hd_13_tb_b" "hd_13_tb_c" - # ]; - # } - # ]; - # cache = [ ]; - # # cache = [ "ssd_2_tb_a" ]; - # }; - # }; + zpool = { + zpool = { + type = "zpool"; + mode = { + topology = { + type = "topology"; + vdev = [ + { + # should this only mirror for this inital config with 3 drives we will used raidz2 for future configs??? + mode = "mirror"; + members = [ + "hd_13_tb_a" "hd_13_tb_b" "hd_13_tb_c" + ]; + } + ]; + cache = [ ]; + # cache = [ "ssd_2_tb_a" ]; + }; + }; - # options = { - # ashift = "12"; - # }; + options = { + ashift = "12"; + }; - # rootFsOptions = { - # encryption = "on"; - # keyformat = "hex"; - # keylocation = "prompt"; - # compression = "lz4"; - # xattr = "sa"; - # acltype = "posixacl"; - # "com.sun:auto-snapshot" = "false"; - # }; + rootFsOptions = { + encryption = "on"; + keyformat = "hex"; + keylocation = "prompt"; + compression = "lz4"; + xattr = "sa"; + acltype = "posixacl"; + "com.sun:auto-snapshot" = "false"; + }; - # datasets = { - # "root" = { - # type = "zfs_fs"; - # mountpoint = "/"; - # }; - # "nix" = { - # type = "zfs_fs"; - # mountpoint = "/nix"; - # }; - # "home" = { - # type = "zfs_fs"; - # mountpoint = "/home"; - # options = { - # "com.sun:auto-snapshot" = "true"; - # }; - # }; - # "var" = { - # type = "zfs_fs"; - # mountpoint = "/var"; - # }; - # }; - # }; - # }; + datasets = { + "root" = { + type = "zfs_fs"; + mountpoint = "/"; + }; + "nix" = { + type = "zfs_fs"; + mountpoint = "/nix"; + }; + "home" = { + type = "zfs_fs"; + mountpoint = "/home"; + options = { + "com.sun:auto-snapshot" = "true"; + }; + }; + "var" = { + type = "zfs_fs"; + mountpoint = "/var"; + }; + }; + }; + }; }; } diff --git a/hosts/horizon/configuration.nix b/hosts/horizon/configuration.nix index d28ca5b..18d4348 100644 --- a/hosts/horizon/configuration.nix +++ b/hosts/horizon/configuration.nix @@ -71,7 +71,7 @@ # }; # Enable the OpenSSH daemon. - # services.openssh.enable = true; + services.openssh.enable = true; # Open ports in the firewall. # networking.firewall.allowedTCPPorts = [ ... ];