2022-06-21 12:48:31 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: {
|
|
|
|
systemd.packages = [pkgs.tgt];
|
|
|
|
systemd.services."tgtd".wantedBy = ["multi-user.target"];
|
2023-06-19 15:09:14 +00:00
|
|
|
systemd.services.tgtd.serviceConfig.execStartPost = "${pkgs.tgt}/bin/tgtadm --op new --mode logicalunit --tid 1 --lun 1 -b /export/vf2.img";
|
2022-06-20 18:15:47 +00:00
|
|
|
networking.firewall.interfaces."br0".allowedTCPPorts = [860 3260];
|
2022-06-20 20:11:25 +00:00
|
|
|
environment.etc."tgt/targets.conf".text = ''
|
|
|
|
default-driver iscsi
|
|
|
|
|
2023-06-19 15:09:14 +00:00
|
|
|
<target iqn.2023-06.rs.chir:rs.chir.int.nas.vf2>
|
|
|
|
backing-store /expport/vf2.img
|
2022-06-20 20:11:25 +00:00
|
|
|
</target>
|
|
|
|
'';
|
2022-06-20 18:15:47 +00:00
|
|
|
}
|