Joey Hafner 1b610bc9eb
Fix (Huge): Re-enable desktop.
- Enable desktop system in flake with all modules imported in flake file, and arguments for those modules passed via specialArgs.
  - Disable fileSystems mounts for iscsi.
  - Refactor smb.nix to define all working shares. (TODO: Figure out how to enable a subset of shares by arguments passed to module).
  - Roll cloudflare_stream.token.
  - Extract all module calls out of configuration.nix for desktop. Remove configuration nodes duplicated in system.nix.
  - Fix dependence on deprecated "sys" subattributes in desktop-environment.nix.
  - Remove iscsi configuration from filesystems.nix. Using iscsi module instead.
  - Update terminal-environment.nix to use git attrset where appropriate.
  - Hardcode wallpaper file in theme.nix.
  -
2025-02-16 15:14:46 -08:00

32 lines
1.0 KiB
Nix

{ iscsi, sys, pkgs, ... }: {
services.openiscsi = {
enable = true;
name = sys.hostname;
discoverPortal = "${iscsi.portalIP}";
};
systemd.services = {
iscsi-autoconnect = {
description = "Log into iSCSI target ${iscsi.iqn}";
after = [ "network.target" "iscsid.service" ];
wants = [ "iscsid.service" ];
serviceConfig = {
ExecStartPre = "${pkgs.openiscsi}/bin/iscsiadm -m discovery -t sendtargets -p ${iscsi.portalIP}";
ExecStart = "${pkgs.openiscsi}/bin/iscsiadm -m node -T ${iscsi.iqn} -p ${iscsi.portalIP} --login";
ExecStop = "${pkgs.openiscsi}/bin/iscsiadm -m node -T ${iscsi.iqn} -p ${iscsi.portalIP} --logout";
Restart = "on-failure";
RemainAfterExit = true;
};
};
};
# fileSystems."${iscsi.mountPath}" = {
# device = "/dev/disk/by-path/ip-${iscsi.portalIP}-iscsi-${iscsi.iqn}-lun-0-part1";
# fsType = "${iscsi.fsType}";
# options = [
# "x-systemd.requires=iscsi.service"
# "_netdev"
# "users"
# ];
# };
}