8 cfg = config.virtualisation.multipass;
12 virtualisation.multipass = {
13 enable = lib.mkEnableOption "Multipass, a simple manager for virtualised Ubuntu instances";
15 logLevel = lib.mkOption {
16 type = lib.types.enum [ "error" "warning" "info" "debug" "trace" ];
19 The logging verbosity of the multipassd binary.
23 package = lib.mkPackageOption pkgs "multipass" { };
27 config = lib.mkIf cfg.enable {
28 environment.systemPackages = [ cfg.package ];
30 systemd.services.multipass = {
31 description = "Multipass orchestrates virtual Ubuntu instances.";
33 wantedBy = [ "multi-user.target" ];
34 wants = [ "network-online.target" ];
35 after = [ "network-online.target" ];
38 "XDG_DATA_HOME" = "/var/lib/multipass/data";
39 "XDG_CACHE_HOME" = "/var/lib/multipass/cache";
40 "XDG_CONFIG_HOME" = "/var/lib/multipass/config";
44 ExecStart = "${cfg.package}/bin/multipassd --logger platform --verbosity ${cfg.logLevel}";
45 SyslogIdentifier = "multipassd";
46 Restart = "on-failure";
50 WorkingDirectory = "/var/lib/multipass";
52 StateDirectory = "multipass";
53 StateDirectoryMode = "0750";
54 CacheDirectory = "multipass";
55 CacheDirectoryMode = "0750";