8 cfg = config.virtualisation.multipass;
12 virtualisation.multipass = {
13 enable = lib.mkEnableOption (lib.mdDoc ''
14 Multipass, a simple manager for virtualised Ubuntu instances.
17 logLevel = lib.mkOption {
18 type = lib.types.enum [ "error" "warning" "info" "debug" "trace" ];
20 description = lib.mdDoc ''
21 The logging verbosity of the multipassd binary.
25 package = lib.mkPackageOptionMD pkgs "multipass" { };
29 config = lib.mkIf cfg.enable {
30 environment.systemPackages = [ cfg.package ];
32 systemd.services.multipass = {
33 description = "Multipass orchestrates virtual Ubuntu instances.";
35 wantedBy = [ "multi-user.target" ];
36 wants = [ "network-online.target" ];
37 after = [ "network-online.target" ];
40 "XDG_DATA_HOME" = "/var/lib/multipass/data";
41 "XDG_CACHE_HOME" = "/var/lib/multipass/cache";
42 "XDG_CONFIG_HOME" = "/var/lib/multipass/config";
46 ExecStart = "${cfg.package}/bin/multipassd --logger platform --verbosity ${cfg.logLevel}";
47 SyslogIdentifier = "multipassd";
48 Restart = "on-failure";
52 WorkingDirectory = "/var/lib/multipass";
54 StateDirectory = "multipass";
55 StateDirectoryMode = "0750";
56 CacheDirectory = "multipass";
57 CacheDirectoryMode = "0750";