11 cfg = config.virtualisation.lxc.lxcfs;
15 maintainers = lib.teams.lxc.members;
19 options.virtualisation.lxc.lxcfs = {
20 enable = lib.mkOption {
21 type = lib.types.bool;
24 This enables LXCFS, a FUSE filesystem for LXC.
25 To use lxcfs in include the following configuration in your
26 container configuration:
28 virtualisation.lxc.defaultConfig = "lxc.include = ''${pkgs.lxcfs}/share/lxc/config/common.conf.d/00-lxcfs.conf";
35 config = lib.mkIf cfg.enable {
36 systemd.services.lxcfs = {
37 description = "FUSE filesystem for LXC";
38 wantedBy = [ "multi-user.target" ];
39 before = [ "lxc.service" ];
40 restartIfChanged = false;
42 ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p /var/lib/lxcfs";
43 ExecStart = "${pkgs.lxcfs}/bin/lxcfs /var/lib/lxcfs";
44 ExecStopPost = "-${pkgs.fuse}/bin/fusermount -u /var/lib/lxcfs";
46 Restart = "on-failure";