misc: various changes
This commit is contained in:
parent
5e2a68566b
commit
4944f2ba36
10 changed files with 99 additions and 60 deletions
40
nixos/vm.nix
40
nixos/vm.nix
|
@ -59,7 +59,7 @@ in {
|
|||
fi
|
||||
'';
|
||||
in
|
||||
pkgs.writeTextDir "/lib/udev/rules.d/99-vm-attach-usb-anker-hub.rules" ''
|
||||
pkgs.writeTextDir "/lib/udev/rules.d/60-vm-attach-usb-anker-hub.rules" ''
|
||||
SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="5411", ATTR{idVendor}!="0bda", ATTR{idProduct}!="5411", RUN+="${updateBin}"
|
||||
SUBSYSTEM=="usb", ACTION=="remove", RUN+="${updateBin}"
|
||||
''
|
||||
|
@ -88,6 +88,29 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
networking.dhcpcd.denyInterfaces = [ "winvm0" ];
|
||||
|
||||
# ensure the bridge network doesn't cause us to wait
|
||||
# on boot
|
||||
systemd.network.wait-online.ignoredInterfaces = [ "eth0" "winvm0" ];
|
||||
boot.initrd.systemd.network.wait-online.ignoredInterfaces = [ "eth0" "winvm0" ];
|
||||
|
||||
# These are needed, since I'm not currently trying to
|
||||
# reserve a static IP for the bridge interface
|
||||
networking.interfaces.winvm0 = {
|
||||
useDHCP = false;
|
||||
ipv4 = {
|
||||
addresses = [
|
||||
{ address = "10.0.5.1"; prefixLength = 16; }
|
||||
];
|
||||
routes = [{
|
||||
address = "10.0.0.0";
|
||||
prefixLength = 16;
|
||||
options = { scope = "link"; metric = "900"; };
|
||||
}];
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
# For sharing filesystems
|
||||
# I followed https://www.heiko-sieger.info/sharing-files-between-the-linux-host-and-a-windows-vm-using-virtiofs/
|
||||
|
@ -101,21 +124,6 @@ in {
|
|||
pkgs.scream
|
||||
];
|
||||
|
||||
# These are needed, since I'm not currently trying to
|
||||
# reserve a static IP for the bridge interface
|
||||
networking.interfaces.winvm0 = {
|
||||
useDHCP = false;
|
||||
ipv4.addresses = [
|
||||
{ address = "10.0.5.1"; prefixLength = 16; }
|
||||
];
|
||||
};
|
||||
|
||||
# Trying to ensure the bridge network doesn't cause us to wait
|
||||
# on boot
|
||||
systemd.services.network-addresses-eth0.before = lib.mkForce [ ];
|
||||
systemd.services.network-addresses-winvm0.before = lib.mkForce [ ];
|
||||
systemd.services.winvm0-netdev.before = lib.mkForce [ ];
|
||||
|
||||
programs.virt-manager.enable = true;
|
||||
users.groups.libvirtd.members = ["evar"]; # let me do stuff with vms
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue