diff --git a/systems/PC-Fixe/configuration.nix b/systems/PC-Fixe/configuration.nix index 3b15ac1..19bd782 100644 --- a/systems/PC-Fixe/configuration.nix +++ b/systems/PC-Fixe/configuration.nix @@ -22,6 +22,15 @@ boot.tmpOnTmpfs = true; boot.supportedFilesystems = [ "zfs" ]; + services.zfs = { + trim.enable = true; + autoSnapshot = { + enable = true; + monthly = 6; + }; + autoScrub.enable = true; + }; + hardware.bluetooth.enable = true; # Logitech G920 @@ -81,5 +90,20 @@ services.openssh.enable = true; services.openssh.passwordAuthentication = false; + systemd.services.iscsid = { + description = "iscsid daemon"; + wantedBy = [ "network-online.target" ]; + preStart = "${pkgs.kmod}/bin/modprobe iscsi_tcp"; + postStart = '' + ${pkgs.openiscsi}/bin/iscsiadm -m discovery -t st -p 10.30.0.1 + ${pkgs.openiscsi}/bin/iscsiadm -m node -T iqn.2019-11.nyanlout.re:steam -l + ''; + serviceConfig = { + ExecStart = "${pkgs.openiscsi}/bin/iscsid -f -c ${pkgs.openiscsi}/etc/iscsi/iscsid.conf -i ${pkgs.openiscsi}/etc/iscsi/initiatorname.iscsi"; + KillMode = "process"; + Restart = "on-success"; + }; + }; + system.stateVersion = "20.03"; } diff --git a/systems/PC-Fixe/hardware-configuration.nix b/systems/PC-Fixe/hardware-configuration.nix index 4c1ba89..348f992 100644 --- a/systems/PC-Fixe/hardware-configuration.nix +++ b/systems/PC-Fixe/hardware-configuration.nix @@ -62,9 +62,9 @@ options = [ "bind" ]; }; - fileSystems."/mnt/steam" = - { device = "10.30.0.1:/exports/steam"; - fsType = "nfs"; + fileSystems."/mnt/steam-lun" = + { device = "/dev/disk/by-path/ip-10.30.0.1:3260-iscsi-iqn.2019-11.nyanlout.re:steam-lun-1"; + fsType = "ext4"; options = ["x-systemd.automount" "noauto"]; };