Merge pull request #34803 from mt-caret/lxd-partial-fix

nixos/lxd: partial fix for lxd breakage
This commit is contained in:
Joachim F 2018-02-17 09:08:08 +00:00 committed by GitHub
commit cac0d0eb33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,6 +38,15 @@ in
environment.systemPackages =
[ pkgs.lxd ];
security.apparmor = {
enable = true;
profiles = [
"${pkgs.lxc}/etc/apparmor.d/usr.bin.lxc-start"
"${pkgs.lxc}/etc/apparmor.d/lxc-containers"
];
packages = [ pkgs.lxc ];
};
systemd.services.lxd =
{ description = "LXD Container Management Daemon";
@ -47,6 +56,10 @@ in
# TODO(wkennington): Add lvm2 and thin-provisioning-tools
path = with pkgs; [ acl rsync gnutar xz btrfs-progs gzip dnsmasq squashfsTools iproute iptables ];
preStart = ''
mkdir -m 0755 -p /var/lib/lxc/rootfs
'';
serviceConfig.ExecStart = "@${pkgs.lxd.bin}/bin/lxd lxd --syslog --group lxd";
serviceConfig.Type = "simple";
serviceConfig.KillMode = "process"; # when stopping, leave the containers alone