vmix.nix/nixos/default.nix
Git Sagar 192ea9b54d fix: use vmix's own locked nixpkgs for all image building
The NixOS module was importing lib directly with the host's pkgs,
causing image customization to use the host's guestfs-tools instead
of vmix's locked version. guestfs-tools 1.52.2 (from host nixpkgs)
has a bug that overwrites /boot/grub/grub.cfg with resolv.conf
content, breaking VM boot.

Now vmixLib is built once in flake.nix with vmix's own nixpkgs and
passed through the overlay to pkgs.vmixLib. Removes overlay.nix and
module.nix as the logic is inlined in flake.nix.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-06-15 10:04:52 -03:00

18 lines
490 B
Nix

{ config, pkgs, lib, ... }:
with lib;
let
vmixLib = pkgs.vmixLib;
args = { inherit config pkgs lib vmixLib; };
in
{
imports = [ (import ./networks args) (import ./vms args) ];
# only relax sandbox on hosts that actually define VM namespaces
config.nix.settings.sandbox = mkIf (config.vmix.namespaces != {}) "relaxed";
options.vmix.namespaces = mkOption {
type = types.attrsOf
(types.submodule (import ./namespaceSubmoduleOptions.nix args));
default = {};
};
}