Add looking glass for VMs, switch from scream-ivshmem to qemu-pulse

This commit is contained in:
Benjamin Bädorf 2021-12-11 21:08:20 +01:00
parent 40dab652fb
commit c825128eb4
No known key found for this signature in database
GPG key ID: 4406E80E13CD656C
6 changed files with 37 additions and 16 deletions

View file

@ -19,6 +19,8 @@ in
home.packages = [ home.packages = [
playonlinux playonlinux
godot godot
obs-studio
obs-studio-plugins.wlrobs
]; ];
}; };
}; };

View file

@ -3,6 +3,8 @@ with lib;
let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
cfg = config.pub-solar.virtualisation; cfg = config.pub-solar.virtualisation;
doesGaming = config.pub-solar.gaming.enable;
extraObsPlugins = if doesGaming then [ pkgs.obs-studio-plugins.looking-glass-obs ] else [ ];
in in
{ {
options.pub-solar.virtualisation = { options.pub-solar.virtualisation = {
@ -32,17 +34,26 @@ in
virt-manager virt-manager
python38Packages.libvirt python38Packages.libvirt
gvfs gvfs
scream
edk2 edk2
OVMF OVMF
win-virtio win-virtio
looking-glass-client
lgcl
]; ];
home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] { home-manager = with pkgs; pkgs.lib.setAttrByPath [ "users" psCfg.user.name ] {
xdg.dataFile."libvirt/.keep".text = "# this file is here to generate the directory"; xdg.dataFile."libvirt/.keep".text = "# this file is here to generate the directory";
home.packages = extraObsPlugins;
}; };
systemd.tmpfiles.rules = [ "f /dev/shm/scream-ivshmem 0660 ${psCfg.user.name} kvm" ]; systemd.tmpfiles.rules = [
systemd.user.services.scream-ivshmem-pulse = import ./scream-ivshmem-pulse.service.nix pkgs; "f /dev/shm/looking-glass 0660 ${psCfg.user.name} kvm"
];
networking.bridges.virbr1.interfaces = [ ];
networking.interfaces.virbr1 = {
ipv4.addresses = [
{ address = "192.168.123.1"; prefixLength = 24; }
];
};
}; };
} }

View file

@ -12,12 +12,16 @@ channels: final: prev: {
nixpkgs-fmt nixpkgs-fmt
qutebrowser qutebrowser
signal-desktop signal-desktop
tdesktop
starship starship
deploy-rs deploy-rs
tdesktop tdesktop
xdg-desktop-portal xdg-desktop-portal
xdg-desktop-portal-gtk xdg-desktop-portal-gtk
xdg-desktop-portal-wlr xdg-desktop-portal-wlr
obs-studio
obs-studio-plugins
looking-glass-client
; ;

View file

@ -1,18 +1,19 @@
final: prev: final: prev:
with final; { with final; {
# keep sources this first # keep sources this first
sources = prev.callPackage (import ./_sources/generated.nix) { }; sources = prev.callPackage (import ./_sources/generated.nix) { };
# then, call packages with `final.callPackage` # then, call packages with `final.callPackage`
import-gtk-settings = writeShellScriptBin "import-gtk-settings" (import ./import-gtk-settings.nix final); import-gtk-settings = writeShellScriptBin "import-gtk-settings" (import ./import-gtk-settings.nix final);
mailto-mutt = writeShellScriptBin "mailto-mutt" (import ./mailto-mutt.nix final); lgcl = writeShellScriptBin "lgcl" (import ./lgcl.nix final);
mopidy-jellyfin = import ./mopidy-jellyfin.nix final; mailto-mutt = writeShellScriptBin "mailto-mutt" (import ./mailto-mutt.nix final);
mu = writeShellScriptBin "mu" (import ./mu.nix final); mopidy-jellyfin = import ./mopidy-jellyfin.nix final;
psos = writeShellScriptBin "psos" (import ./psos.nix final); mu = writeShellScriptBin "mu" (import ./mu.nix final);
s = writeShellScriptBin "s" (import ./s.nix final); psos = writeShellScriptBin "psos" (import ./psos.nix final);
sway-launcher = writeScriptBin "sway-launcher" (import ./sway-launcher.nix final); s = writeShellScriptBin "s" (import ./s.nix final);
sway-service = writeShellScriptBin "sway-service" (import ./sway-service.nix final); sway-launcher = writeScriptBin "sway-launcher" (import ./sway-launcher.nix final);
swaylock-bg = writeScriptBin "swaylock-bg" (import ./swaylock-bg.nix final); sway-service = writeShellScriptBin "sway-service" (import ./sway-service.nix final);
toggle-kbd-layout = writeShellScriptBin "toggle-kbd-layout" (import ./toggle-kbd-layout.nix final); swaylock-bg = writeScriptBin "swaylock-bg" (import ./swaylock-bg.nix final);
uhk-agent = import ./uhk-agent.nix final; toggle-kbd-layout = writeShellScriptBin "toggle-kbd-layout" (import ./toggle-kbd-layout.nix final);
wcwd = writeShellScriptBin "wcwd" (import ./wcwd.nix final); uhk-agent = import ./uhk-agent.nix final;
wcwd = writeShellScriptBin "wcwd" (import ./wcwd.nix final);
} }

3
pkgs/lgcl.nix Normal file
View file

@ -0,0 +1,3 @@
self: with self; ''
${self.looking-glass-client}/bin/looking-glass-client -f /dev/shm/looking-glass input:ignoreWindowsKeys=yes input:grabKeyboardOnFocus=no
''