3 { config, lib, pkgs, ... }:
6 cfg = config.virtualisation.lxc.lxcfs;
9 maintainers = lib.teams.lxc.members;
13 options.virtualisation.lxc.lxcfs = {
16 type = lib.types.bool;
19 This enables LXCFS, a FUSE filesystem for LXC.
20 To use lxcfs in include the following configuration in your
21 container configuration:
23 virtualisation.lxc.defaultConfig = "lxc.include = ''${pkgs.lxcfs}/share/lxc/config/common.conf.d/00-lxcfs.conf";
30 config = lib.mkIf cfg.enable {
31 systemd.services.lxcfs = {
32 description = "FUSE filesystem for LXC";
33 wantedBy = [ "multi-user.target" ];
34 before = [ "lxc.service" ];
35 restartIfChanged = false;
37 ExecStartPre="${pkgs.coreutils}/bin/mkdir -p /var/lib/lxcfs";
38 ExecStart="${pkgs.lxcfs}/bin/lxcfs /var/lib/lxcfs";
39 ExecStopPost="-${pkgs.fuse}/bin/fusermount -u /var/lib/lxcfs";