Only set sandbox = "relaxed" when vmix.namespaces is non-empty. Safe to import as a default module on all hosts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
20 lines
No EOL
571 B
Nix
20 lines
No EOL
571 B
Nix
{ config, pkgs, lib, ... }:
|
|
with lib;
|
|
let
|
|
vmixLib = import ./../lib {inherit pkgs lib; };
|
|
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 = {};
|
|
};
|
|
|
|
config.nixpkgs.overlays = [ (import ../overlay.nix) ];
|
|
} |