virtualbox service: add support for vboxsf guest filesystem

Closes #9358

Signed-off-by: Jaka Hudoklin <jakahudoklin@gmail.com>
Fix reference to bin/mount.vboxsf.
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
wip/yesman
Jaka Hudoklin 9 years ago committed by aszlig
parent 7ab8dde511
commit 74209a4ca8
No known key found for this signature in database
GPG Key ID: D0EBD0EC8C2DC961
  1. 1
      nixos/modules/module-list.nix
  2. 23
      nixos/modules/tasks/filesystems/vboxsf.nix
  3. 3
      nixos/modules/virtualisation/virtualbox-guest.nix

@ -472,6 +472,7 @@
./tasks/filesystems/ntfs.nix
./tasks/filesystems/reiserfs.nix
./tasks/filesystems/unionfs-fuse.nix
./tasks/filesystems/vboxsf.nix
./tasks/filesystems/vfat.nix
./tasks/filesystems/xfs.nix
./tasks/filesystems/zfs.nix

@ -0,0 +1,23 @@
{ config, lib, pkgs, ... }:
with lib;
let
inInitrd = any (fs: fs == "vboxsf") config.boot.initrd.supportedFilesystems;
package = pkgs.runCommand "mount.vboxsf" {} ''
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" ];
};
}

@ -32,7 +32,8 @@ in
boot.extraModulePackages = [ kernel.virtualboxGuestAdditions ];
boot.kernelModules = [ "vboxsf" ];
boot.supportedFilesystems = [ "vboxsf" ];
boot.initrd.supportedFilesystems = [ "vboxsf" ];
users.extraGroups.vboxsf.gid = config.ids.gids.vboxsf;

Loading…
Cancel
Save