8ac5e011d6
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
23 lines
499 B
Nix
23 lines
499 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
inInitrd = any (fs: fs == "vboxsf") config.boot.initrd.supportedFilesystems;
|
|
|
|
package = pkgs.runCommand "mount.vboxsf" { preferLocalBuild = true; } ''
|
|
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" ];
|
|
|
|
};
|
|
}
|