i am an idiot, i forgot to remove the xdg portal config in configuration.nix on apollo, this broke screensharing
This commit is contained in:
parent
d28b00841c
commit
4d2554aae8
12 changed files with 418 additions and 35 deletions
39
base/virtualisation/libvirt.nix
Normal file
39
base/virtualisation/libvirt.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
# https://gist.github.com/CRTified/43b7ce84cd238673f7f24652c85980b3?permalink_comment_id=3793931
|
||||
{ lib, pkgs, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.virtualisation.libvirtd;
|
||||
|
||||
boolToZeroOne = x: if x then "1" else "0";
|
||||
|
||||
aclString = with lib.strings;
|
||||
concatMapStringsSep ''
|
||||
,
|
||||
'' escapeNixString cfg.deviceACL;
|
||||
in {
|
||||
options.virtualisation.libvirtd = {
|
||||
deviceACL = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
};
|
||||
clearEmulationCapabilities = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Add qemu-libvirtd to the input group if required
|
||||
config.users.users."qemu-libvirtd" = {
|
||||
extraGroups = optionals (!cfg.qemu.runAsRoot) [ "kvm" "input" ];
|
||||
isSystemUser = true;
|
||||
};
|
||||
|
||||
config.virtualisation.libvirtd.qemu.verbatimConfig = ''
|
||||
clear_emulation_capabilities = ${
|
||||
boolToZeroOne cfg.clearEmulationCapabilities
|
||||
}
|
||||
cgroup_device_acl = [
|
||||
${aclString}
|
||||
]
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue