nixos-hypervisor/services/minimalConfig/vm.nix
Théo Barnouin 79356b8671
Some checks are pending
/ Build Nix targets (push) Waiting to run
Working Proxmox VM + jellyfin hw encoding
2025-04-11 15:55:10 +02:00

53 lines
1.1 KiB
Nix

{
lib,
config,
modulesPath,
...
}: let
cfg = config.services.vm;
in {
options.services.vm = {
enable = lib.mkEnableOption "Enable LXC container config";
};
config = lib.mkIf cfg.enable {
security.sudo.wheelNeedsPassword = false;
networking = {
dhcpcd.enable = false;
};
systemd.network.enable = true;
services = {
qemuGuest.enable = true;
cloud-init = {
enable = true;
network.enable = true;
config = ''
system_info:
distro: nixos
network:
renderers: [ 'networkd' ]
default_user:
name: ops
users:
- default
ssh_pwauth: false
chpasswd:
expire: false
cloud_init_modules:
- migrator
- seed_random
- growpart
- resizefs
cloud_config_modules:
- disk_setup
- mounts
- set-passwords
- ssh
cloud_final_modules: []
'';
};
};
};
}