2022-07-04 17:41:18 -04:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
2022-10-13 22:13:43 -04:00
|
|
|
with lib; {
|
2022-07-04 17:41:18 -04:00
|
|
|
config = mkIf config.nathan.config.windows.enable {
|
|
|
|
# Enable ntfs support
|
|
|
|
boot.supportedFilesystems = [ "ntfs" ];
|
|
|
|
# Install dislocker for mounting bitlocker encrypted partitions
|
2022-10-13 22:13:43 -04:00
|
|
|
environment.systemPackages = with pkgs; [ dislocker ];
|
2022-07-04 17:41:18 -04:00
|
|
|
|
|
|
|
systemd.services.mount-windows =
|
2022-10-13 22:13:43 -04:00
|
|
|
let mount = config.nathan.config.windows.mount;
|
|
|
|
in mkIf mount.enable {
|
2022-07-04 17:41:18 -04:00
|
|
|
description = "Mount ${mount.device} to ${mount.mountPoint}";
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
2022-10-13 22:13:43 -04:00
|
|
|
path = with pkgs; [ bash dislocker ];
|
2022-07-04 17:41:18 -04:00
|
|
|
serviceConfig = {
|
|
|
|
Type = "forking";
|
2022-10-13 22:13:43 -04:00
|
|
|
ExecStart = "${
|
|
|
|
../../scripts/windows/mount.sh
|
|
|
|
} ${mount.device} ${mount.mountPoint} ${mount.keyFile}";
|
|
|
|
ExecStop = "${
|
|
|
|
../../scripts/windows/unmount.sh
|
|
|
|
} ${mount.device} ${mount.mountPoint}";
|
2022-07-04 17:41:18 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|