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