diff options
author | Benjamin Asbach <asbachb@users.noreply.github.com> | 2022-11-28 21:43:20 +0400 |
---|---|---|
committer | Benjamin Asbach <asbachb@users.noreply.github.com> | 2022-11-28 21:48:34 +0400 |
commit | 96424ddf55485130af9565701db78fc9429f8aad (patch) | |
tree | f2f7a016c5e9effc87eee971a407bc217069682a /nixos/modules/virtualisation | |
parent | a115bb9bd56831941be3776c8a94005867f316a7 (diff) |
lxd: Check if `lxcfs` is enabled before adding it as service dependency
Without that check `lxc.service` cannot be manage manually as a manual start fails due to missing dependency to `lxcfs` when not enabled.
Diffstat (limited to 'nixos/modules/virtualisation')
-rw-r--r-- | nixos/modules/virtualisation/lxd.nix | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/nixos/modules/virtualisation/lxd.nix b/nixos/modules/virtualisation/lxd.nix index 764bb5e3b40ed..e3eb519b7dddf 100644 --- a/nixos/modules/virtualisation/lxd.nix +++ b/nixos/modules/virtualisation/lxd.nix @@ -129,8 +129,15 @@ in { description = "LXD Container Management Daemon"; wantedBy = [ "multi-user.target" ]; - after = [ "network-online.target" "lxcfs.service" ]; - requires = [ "network-online.target" "lxd.socket" "lxcfs.service" ]; + after = [ + "network-online.target" + (mkIf config.virtualisation.lxc.lxcfs.enable "lxcfs.service") + ]; + requires = [ + "network-online.target" + "lxd.socket" + (mkIf config.virtualisation.lxc.lxcfs.enable "lxcfs.service") + ]; documentation = [ "man:lxd(1)" ]; path = optional cfg.zfsSupport config.boot.zfs.package; |