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>
This commit is contained in:
Jaka Hudoklin 2015-08-20 00:29:20 +02:00 committed by aszlig
parent 7ab8dde511
commit 74209a4ca8
No known key found for this signature in database
GPG key ID: D0EBD0EC8C2DC961
3 changed files with 26 additions and 1 deletions

View file

@ -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

View file

@ -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" ];
};
}

View file

@ -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;