1 { config, pkgs, lib, ... }:
7 privileged = mkOption {
10 description = lib.mdDoc ''
11 Whether to enable privileged mounts
14 manageNetwork = mkOption {
17 description = lib.mdDoc ''
18 Whether to manage network interfaces through nix options
19 When false, systemd-networkd is enabled to accept network
20 configuration from proxmox.
23 manageHostName = mkOption {
26 description = lib.mdDoc ''
27 Whether to manage hostname through nix options
28 When false, the hostname is picked up from /etc/hostname
36 cfg = config.proxmoxLXC;
39 system.build.tarball = pkgs.callPackage ../../lib/make-system-tarball.nix {
41 object = config.system.build.toplevel;
46 source = config.system.build.toplevel + "/init";
47 target = "/sbin/init";
50 extraCommands = "mkdir -p root etc/systemd/network";
55 loader.initScript.enable = true;
58 networking = mkIf (!cfg.manageNetwork) {
60 useHostResolvConf = false;
62 # pick up hostname from /etc/hostname generated by proxmox
63 hostName = mkIf (!cfg.manageHostName) (mkForce "");
67 enable = mkDefault true;
68 startWhenNeeded = mkDefault true;
71 systemd.mounts = mkIf (!cfg.privileged)
72 [{ where = "/sys/kernel/debug"; enable = false; }];