diff --git a/options/custom/programs/waybar/default.nix b/options/custom/programs/waybar/default.nix index 888582a..a4ee268 100644 --- a/options/custom/programs/waybar/default.nix +++ b/options/custom/programs/waybar/default.nix @@ -340,7 +340,7 @@ in { text = '' #! /usr/bin/env ${bash} - case "$(virsh --connect qemu:///system domstate myndows)" in + case "$(virsh domstate myndows)" in 'running') ${echo}  ${echo} Online diff --git a/options/custom/scripts/vm.sh b/options/custom/scripts/vm.sh index 49b81c8..18871d8 100644 --- a/options/custom/scripts/vm.sh +++ b/options/custom/scripts/vm.sh @@ -3,8 +3,6 @@ # Start/resume VM if needed and launch viewer #?? man xfreerdp -function virsh() { command virsh --connect qemu:///system "$@"; } - state="$(virsh domstate myndows)" if [[ "$state" == 'paused' ]]; then diff --git a/options/custom/settings/dconf/apps.nix b/options/custom/settings/dconf/apps.nix index e4212de..4a463b0 100644 --- a/options/custom/settings/dconf/apps.nix +++ b/options/custom/settings/dconf/apps.nix @@ -149,12 +149,6 @@ in forcepoweroff = mkBoolean false; }; - "org/virt-manager/virt-manager/connections" = { - #?? [as] - autoconnect = mkArray type.string [ "qemu:///system" ]; - uris = mkArray type.string [ "qemu:///system" ]; - }; - "org/virt-manager/virt-manager/console" = { auto-redirect = mkBoolean false; resize-guest = mkInt32 1; diff --git a/options/custom/settings/vm.nix b/options/custom/settings/vm.nix index 3b149f9..ae3e149 100644 --- a/options/custom/settings/vm.nix +++ b/options/custom/settings/vm.nix @@ -19,13 +19,6 @@ in }; config = mkIf cfg.enable { - # https://github.com/virt-manager/virt-manager - programs.virt-manager.enable = cfg.libvirt; - - users.users.${config.custom.username}.extraGroups = - lib.optionals cfg.libvirt [ "libvirtd" ] - ++ lib.optionals cfg.virtualbox [ "vboxusers" ]; - virtualisation = { # https://wiki.nixos.org/wiki/Libvirt # https://libvirt.org @@ -76,6 +69,16 @@ in }; }; + # https://github.com/virt-manager/virt-manager + programs.virt-manager.enable = cfg.libvirt; + + # https://libvirt.org/uri.html#default-uri-choice + environment.sessionVariables.LIBVIRT_DEFAULT_URI = mkIf cfg.libvirt "qemu:///system"; + + users.users.${config.custom.username}.extraGroups = + lib.optionals cfg.libvirt ["libvirtd"] + ++ lib.optionals cfg.virtualbox ["vboxusers"]; + systemd = mkIf cfg.libvirt { # Fix resume messages polluting tty services.libvirt-guests.serviceConfig.StandardOutput = "journal";