nixos-config/config/services/iscsi.nix

18 lines
521 B
Nix
Raw Normal View History

2022-06-21 13:48:31 +01:00
{
config,
pkgs,
...
}: {
systemd.packages = [pkgs.tgt];
systemd.services."tgtd".wantedBy = ["multi-user.target"];
2023-06-19 16:09:14 +01: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 19:15:47 +01:00
networking.firewall.interfaces."br0".allowedTCPPorts = [860 3260];
2022-06-20 21:11:25 +01:00
environment.etc."tgt/targets.conf".text = ''
default-driver iscsi
2023-06-19 16:09:14 +01:00
<target iqn.2023-06.rs.chir:rs.chir.int.nas.vf2>
backing-store /expport/vf2.img
2022-06-20 21:11:25 +01:00
</target>
'';
2022-06-20 19:15:47 +01:00
}