From 110e13b8beac0b80eabc50e63b9a2a84478711f5 Mon Sep 17 00:00:00 2001 From: rhaenys Date: Sun, 17 Nov 2024 21:44:12 -0300 Subject: [PATCH] feat: major refact, proxmox -> libvirtd --- .gitignore | 1 + flake.lock | 10 ++++------ flake.nix | 3 --- nixos/essos/configuration.nix | 5 +---- nixos/essos/hypervisor.nix | 17 ++++++++++++++++- 5 files changed, 22 insertions(+), 14 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c4a847d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/result diff --git a/flake.lock b/flake.lock index 97680bf..2cb6f8b 100644 --- a/flake.lock +++ b/flake.lock @@ -107,15 +107,13 @@ "locked": { "lastModified": 1730963029, "narHash": "sha256-+jlyA9jROgLjHKHXTLgJWmhQ0xK95LjKXQaRe2gxP7A=", - "owner": "5aaee9", - "repo": "proxmox-nixos", + "path": "/nix/store/kfmzrbg9zpsq2wrmfgrb0lw3h16jj2zy-source", "rev": "31e7e10c75d43313db000ff9834e7befebe6eb01", - "type": "github" + "type": "path" }, "original": { - "owner": "5aaee9", - "repo": "proxmox-nixos", - "type": "github" + "id": "proxmox-nixos", + "type": "indirect" } }, "root": { diff --git a/flake.nix b/flake.nix index 3677a20..b3a3584 100644 --- a/flake.nix +++ b/flake.nix @@ -3,8 +3,6 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - #proxmox-nixos.url = "github:SaumonNet/proxmox-nixos"; - proxmox-nixos.url = "github:5aaee9/proxmox-nixos"; }; outputs = { nixpkgs, proxmox-nixos, ... }@inputs: let @@ -16,7 +14,6 @@ essos = nixosSystem { system = "x86_64-linux"; modules = [ - proxmox-nixos.nixosModules.proxmox-ve ./nixos/essos/configuration.nix ./nixos/common.nix ]; diff --git a/nixos/essos/configuration.nix b/nixos/essos/configuration.nix index 5b5a9e6..fb630bf 100644 --- a/nixos/essos/configuration.nix +++ b/nixos/essos/configuration.nix @@ -44,7 +44,7 @@ users.users = { elise = { isNormalUser = true; - extraGroups = [ "wheel" ]; + extraGroups = [ "wheel" "libvirtd" ]; shell = pkgs.zsh; }; }; @@ -65,8 +65,5 @@ logind.lidSwitch = "ignore"; }; - services.proxmox-ve.enable = true; - nixpkgs.overlays = [ inputs.proxmox-nixos.overlays.x86_64-linux ]; - system.stateVersion = "22.11"; } diff --git a/nixos/essos/hypervisor.nix b/nixos/essos/hypervisor.nix index 9301300..eecd546 100644 --- a/nixos/essos/hypervisor.nix +++ b/nixos/essos/hypervisor.nix @@ -8,6 +8,21 @@ # }; #}; + virtualisation.libvirtd = { + enable = true; + qemu = { + package = pkgs.qemu_kvm; + runAsRoot = false; + }; + extraConfig = '' + listen_tls = 1 + listen_tcp = 1 + ''; + }; + + systemd.sockets."libvirtd-tcp".enable = true; + systemd.sockets."libvirtd-tls".enable = true; + systemd.network.enable = true; systemd.network.netdevs."wlan-ap0" = { @@ -76,7 +91,7 @@ networking.resolvconf.enable = false; - networking.firewall.allowedTCPPorts = [ 53 ]; + networking.firewall.allowedTCPPorts = [ 53 16514 16509 ]; networking.firewall.allowedUDPPorts = [ 53 ]; services.hostapd = { -- 2.47.0