This project is a port of the Proxmox Hypervisor on NixOS.
Proxmox-NixOS has been tested on real hardware with most basic features of Proxmox (booting VMs, user management, etc), more involved setups (clusters, HA, etc) are still under development and testing.
Some Proxmox packages have a quite power intensive build process. We make a cache available to download directly the artifacts:
- address:
https://cache.saumon.network/proxmox-nixos
- public key:
proxmox-nixos:nveXDuVVhFDRFx8Dn19f1WDEaNRJjPrF2CPD2D+m1ys=
With npins
Add proxmox-nixos
as a dependency of your npins project.
$ npins add github SaumonNet proxmox-nixos -b main
[INFO ] Adding 'proxmox-nixos' …
repository: https://github.com/SaumonNet/proxmox-nixos.git
branch: main
revision: ...
url: https://github.com/saumonnet/proxmox-nixos/archive/$revision.tar.gz
hash: ...
Below is a fragment of a NixOS configuration that enables Proxmox VE.
# file: configuration.nix
{ pkgs, lib, ... }:
let
sources = import ./npins;
proxmox-nixos = import sources.proxmox-nixos;
in
{
imports = [ proxmox-nixos.nixosModules.proxmox-ve ];
services.proxmox-ve.enable = true;
nixpkgs.overlays = [
proxmox-nixos.overlays.x86_64-linux
];
# The rest of your configuration...
}
Below is a fragment of a NixOS configuration that enables Proxmox VE.
{
description = "A flake with Proxmox VE enabled";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
proxmox-nixos.url = "github:SaumonNet/proxmox-nixos";
};
outputs = { self, nixpkgs, proxmox-nixos, ...}: {
nixosConfigurations = {
yourHost = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [
proxmox-nixos.nixosModules.proxmox-ve
({ pkgs, lib, ... }: {
services.proxmox-ve.enable = true;
nixpkgs.overlays = [
proxmox-nixos.overlays.${system}
];
# The rest of your configuration...
})
];
};
};
};
}
To get internet in your VMs, you need to add a network device to the VM, connected to a bridge. To get this working, follow this 2 steps:
- Create the bridge in
System->Network->Create->Linux Bridge
. This operation has no effect on your system and is just a quirk for Proxmox to know the existence of your bridge. - Configure your networking through NixOS configuration so that the bridge you created in the Proxmox web interface actually exists!
Any kind of advanced networking configuration is possible through the usual NixOS options, but here are basic examples that can get you started:
systemd.network.networks."10-lan" = {
matchConfig.Name = [ "ens18" ];
networkConfig = {
Bridge = "vmbr0";
};
};
systemd.network.netdevs."vmbr0" = {
netdevConfig = {
Name = "vmbr0";
Kind = "bridge";
};
};
systemd.network.networks."10-lan-bridge" = {
matchConfig.Name = "vmbr0";
networkConfig = {
IPv6AcceptRA = true;
DHCP = "ipv4";
};
linkConfig.RequiredForOnline = "routable";
};
networking.bridges.vmbr0.interfaces = [ "ens18" ];
networking.interfaces.vmbr0.useDHCP = lib.mkDefault true;
- Support for clusters / HA with Ceph
- More coverage of NixOS tests
- Proxmox backup server
This project has received support from NLNet.