diff --git a/hosts/vergil/configuration.nix b/hosts/vergil/configuration.nix index 918db13..bacdff9 100644 --- a/hosts/vergil/configuration.nix +++ b/hosts/vergil/configuration.nix @@ -11,5 +11,24 @@ in ../shared/nixos-server.nix ]; + systemd.services.mount-vm-disk = { + description = "Mount Proxmox VM disk via kpartx"; + after = [ "storage-vm--100--disk--0.device" ]; + wants = [ "storage-vm--100--disk--0.device" ]; + + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + ExecStart = "${pkgs.multipath-tools}/sbin/kpartx -av /dev/storage/vm-100-disk-0"; + ExecStop = "${pkgs.multipath-tools}/sbin/kpartx -dv /dev/storage/vm-100-disk-0"; + }; + + wantedBy = [ "multi-user.target" ]; + }; + + environment.systemPackages = with pkgs; [ + multipath-tools + ]; + networking.hostName = "vergil"; } diff --git a/hosts/vergil/hardware.nix b/hosts/vergil/hardware.nix index 38b448b..e34c29d 100644 --- a/hosts/vergil/hardware.nix +++ b/hosts/vergil/hardware.nix @@ -55,6 +55,16 @@ "dmask=0077" ]; }; + + "/mnt" = { + device = "/dev/disk/by-uuid/1432aeae-71e9-4f34-97dc-cf0fe74a4e00"; + fsType = "xfs"; + options = [ + "noauto" + "x-systemd.automount" + "x-systemd.after=mount-vm-disk.service" + ]; + }; }; swapDevices = [ ];