2020-04-24 23:36:52 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
inInitrd = config.boot.initrd.supportedFilesystems.vboxsf or false;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
package = pkgs.runCommand "mount.vboxsf" { preferLocalBuild = true; } ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp ${pkgs.linuxPackages.virtualboxGuestAdditions}/bin/mount.vboxsf $out/bin
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
2024-02-29 20:09:43 +00:00
|
|
|
config = mkIf (config.boot.supportedFilesystems.vboxsf or false) {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
system.fsPackages = [ package ];
|
|
|
|
|
|
|
|
boot.initrd.kernelModules = mkIf inInitrd [ "vboxsf" ];
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|