From c138635f6aa5c79b1c058529b7186d64ea37864e Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Mon, 12 Jul 2021 12:14:23 +0300 Subject: [PATCH] feat(guix): libvirt & virt-manager --- .config/guix/manifests/dev.scm | 6 ++++++ .config/guix/systems/eminence.scm | 17 +++++++++++++---- Desktop.org | 5 +---- Guix.org | 25 +++++++++++++++++++++---- 4 files changed, 41 insertions(+), 12 deletions(-) create mode 100644 .config/guix/manifests/dev.scm diff --git a/.config/guix/manifests/dev.scm b/.config/guix/manifests/dev.scm new file mode 100644 index 0000000..5712d42 --- /dev/null +++ b/.config/guix/manifests/dev.scm @@ -0,0 +1,6 @@ +(specifications->manifest + '( + "virt-manager" + "postgresql" + "docker-compose" + "conda")) diff --git a/.config/guix/systems/eminence.scm b/.config/guix/systems/eminence.scm index c90bc93..d697e2e 100644 --- a/.config/guix/systems/eminence.scm +++ b/.config/guix/systems/eminence.scm @@ -12,6 +12,7 @@ (use-modules (gnu packages openbox)) (use-modules (gnu services docker)) (use-modules (gnu services cups)) +(use-modules (gnu services virtualization)) (use-modules (srfi srfi-1)) (use-modules (guix channels)) (use-modules (guix inferior)) @@ -30,10 +31,17 @@ (cups-configuration (web-interface? #t))) (service docker-service-type) + (service libvirt-service-type + (libvirt-configuration + (unix-sock-group "libvirt") + (tls-port "16555"))) + (service virtlog-service-type) (modify-services %desktop-services - (network-manager-service-type config => - (network-manager-configuration (inherit config) - (vpn-plugins (list network-manager-openvpn))))))) + (network-manager-service-type + config => + (network-manager-configuration + (inherit config) + (vpn-plugins (list network-manager-openvpn))))))) (define %backlight-udev-rule @@ -80,6 +88,7 @@ "tty" "docker" "scanner" + "libvirt" "lp"))) %base-user-accounts)) @@ -132,5 +141,5 @@ (mount-point "/boot/efi") (device (uuid "0031-3784" 'fat32)) (type "vfat")) - %base-file-systems)) + %base-file-systems))) ;; eminence:1 ends here diff --git a/Desktop.org b/Desktop.org index 5e9beb2..a5fe1f2 100644 --- a/Desktop.org +++ b/Desktop.org @@ -1002,10 +1002,6 @@ Prints out a current uptime and non-AFK time from [[https://github.com/ActivityW |-----------------| | dateutils | -| Type | Note | -|------+--------------------------------------------| -| TODO | Fix crash on uptime > 99h | - #+begin_src bash :tangle ./bin/polybar/aw_afk.sh :noweb yes afk_event=$(curl -s -X GET "http://localhost:5600/api/0/buckets/aw-watcher-afk_$(hostname)/events?limit=1" -H "accept: application/json") status=$(echo ${afk_event} | jq -r '.[0].data.status') @@ -2100,6 +2096,7 @@ This section generates manifests for various desktop software that I'm using. | dev | conda | | dev | docker-compose | | dev | postgresql | +| dev | virt-manager | ** Manifests #+NAME: packages #+begin_src emacs-lisp :tangle no :var category="" diff --git a/Guix.org b/Guix.org index 94e7c0a..0e539b7 100644 --- a/Guix.org +++ b/Guix.org @@ -192,6 +192,7 @@ Common modules: (use-modules (gnu packages openbox)) (use-modules (gnu services docker)) (use-modules (gnu services cups)) +(use-modules (gnu services virtualization)) (use-modules (srfi srfi-1)) (use-modules (guix channels)) (use-modules (guix inferior)) @@ -252,6 +253,7 @@ User accounts. "tty" "docker" "scanner" + "libvirt" "lp"))) %base-user-accounts)) @@ -276,6 +278,7 @@ Default services for each machine: - add nix service - add docker service - add CUPS service +- add libvirt service - add a symlink to ELF interpreter to where most Linux binaries expect it #+begin_src scheme :tangle no :noweb-ref system-common (define %my-base-services @@ -288,10 +291,17 @@ Default services for each machine: (cups-configuration (web-interface? #t))) (service docker-service-type) + (service libvirt-service-type + (libvirt-configuration + (unix-sock-group "libvirt") + (tls-port "16555"))) + (service virtlog-service-type) (modify-services %desktop-services - (network-manager-service-type config => - (network-manager-configuration (inherit config) - (vpn-plugins (list network-manager-openvpn))))))) + (network-manager-service-type + config => + (network-manager-configuration + (inherit config) + (vpn-plugins (list network-manager-openvpn))))))) #+end_src @@ -389,7 +399,7 @@ Default services for each machine: (mount-point "/boot/efi") (device (uuid "0031-3784" 'fat32)) (type "vfat")) - %base-file-systems)) + %base-file-systems))) #+end_src ** azure @@ -609,6 +619,13 @@ echo "Description: But GNU Guix doesn't have one." echo "Release: 42.2" echo "Codename: n/a" #+end_src +** virt-manager +Run the following to fix the network: +#+begin_src sh :tangle no +sudo virsh net-define /run/current-system/profile/etc/libvirt/qemu/networks/default.xml +sudo virsh net-start default +sudo herd restart libvirtd +#+end_src ** wakatime-cli | Note | Description | |------+-----------------------|