2015-08-19 23:29:20 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
inInitrd = any (fs: fs == "vboxsf") config.boot.initrd.supportedFilesystems;
|
|
|
|
|
2018-11-08 10:59:03 +00:00
|
|
|
package = pkgs.runCommand "mount.vboxsf" { preferLocalBuild = true; } ''
|
2015-08-19 23:29:20 +01:00
|
|
|
mkdir -p $out/bin
|
|
|
|
cp ${pkgs.linuxPackages.virtualboxGuestAdditions}/bin/mount.vboxsf $out/bin
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
config = mkIf (any (fs: fs == "vboxsf") config.boot.supportedFilesystems) {
|
|
|
|
|
|
|
|
system.fsPackages = [ package ];
|
|
|
|
|
|
|
|
boot.initrd.kernelModules = mkIf inInitrd [ "vboxsf" ];
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|