Commit graph

1584 commits

Author SHA1 Message Date
github-actions[bot] 4a9909e0db
Merge master into staging-next 2023-08-19 00:01:42 +00:00
Adam Stephens 1403486d17 nixos/lxd-agent: init module from distrobuilder generator 2023-08-18 22:28:59 +00:00
James Baker 09d32e2612
nixos/virtualisation.docker: Do not assert 32 bit libraries available on ARM (#246179) 2023-08-11 10:49:25 +02:00
Franz Pletz dcafb07ed8
Merge pull request #232250 from YBeaugnon/libvirt-hooks
nixos/libvirtd: hooks support
2023-08-09 15:07:52 +02:00
Jake Schurch 36430fbb14 revert(proxmox-image): pull request #246120 from jakeschurch/add-proxmox-image-addl-disk-size-override
NOTES:

@jakeschurch did not realize that is was already updated on master, but not
backported to 23.05 channel

Signed-off-by: Jake Schurch <jakeschurch@gmail.com>
2023-08-02 15:01:44 -04:00
Pol Dellaiera 71e3934d82
Merge pull request #246120 from jakeschurch/add-proxmox-image-addl-disk-size-override
proxmox-image: add additionalDiskSpace parameter as input to make-disk-image.nix
2023-07-30 20:34:00 +02:00
Jake Schurch a479735162 respond to pr feedback
Signed-off-by: Jake Schurch <jakeschurch@gmail.com>
2023-07-30 12:01:03 -04:00
Jake Schurch d780bdf308
Update nixos/modules/virtualisation/proxmox-image.nix
Co-authored-by: Pol Dellaiera <pol.dellaiera@protonmail.com>
2023-07-30 11:57:29 -04:00
Jake Schurch f2794786fd proxmox-image: add additionalDiskSpace parameter as input to make-disk-image.nix 2023-07-29 20:47:46 -04:00
Emily 49c07cd259
Merge pull request #238735 from MayNiklas/proxmox-image-settings
nixos/proxmox-image: add additionalSpace, bootSize and diskSize options
2023-07-27 22:17:42 +02:00
Pol Dellaiera d242834675
Merge pull request #230109 from vdot0x23/docker-extraPackages
nixos/docker: add extraPackages option
2023-07-26 15:14:13 +02:00
Sandro 9f4a3203eb
Merge pull request #233250 from SuperSandro2000/podman-timer-persist 2023-07-21 11:34:18 +02:00
Jon Seager 5e73f0c1c9 nixos/lxd: fix default ui package 2023-07-17 08:04:42 -03:00
Sandro 75cfb4925a
Merge pull request #242126 from kjeremy/vmware-guest-aarch64
vmware-guest module: work under aarch64
2023-07-14 19:51:14 +02:00
Ryan Lahfa 49413e25e0
Merge pull request #241314 from jnsgruk/master 2023-07-08 13:58:20 +02:00
Jeremy Kolb 1e16a937ca vmware-guest module: work under aarch64 2023-07-07 15:40:29 -04:00
Jon Seager 2fbb85e2c9
nixos/lxd: add ui.enable option to toggle ui feature 2023-07-07 18:31:03 +01:00
Michael Hoang 98d970bc37 nixos/qemu-vm: use CA certificates from host 2023-07-06 21:32:08 +10:00
Sandro Jäckel 2048a8ca02
nixos/proxmox-image: fix example rendering 2023-06-30 18:14:43 +02:00
Atemu a04b45f10e
Merge pull request #238596 from nikstur/qemu-vm-use-host-pkgs
nixos/qemu-vm: use cfg.host.pkgs
2023-06-26 09:06:31 +02:00
Felix Buehler 6672dde558 treewide: use optionalAttrs instead of 'else {}' 2023-06-25 11:01:34 -03:00
nikstur f6b37ddaf2 nixos/qemu-vm: use cfg.host.pkgs 2023-06-24 00:45:15 +02:00
Martino Fontana e1a6c85c2b nixos/sysctl: raise default vm.max_map_count to 1048576 2023-06-21 19:25:42 +02:00
MayNiklas d7f89bbfb6 nixos/proxmox-image: add additionalSpace, bootSize and diskSize options 2023-06-21 14:13:03 +02:00
nikstur 0bdba6c99b nixos/qemu-vm: use persistent block device names
This change removes the bespoke logic around identifying block devices.
Instead of trying to find the right device by iterating over
`qemu.drives` and guessing the right partition number (e.g.
/dev/vda{1,2}), devices are now identified by persistent names provided
by udev in /dev/disk/by-*.

Before this change, the root device was formatted on demand in the
initrd. However, this makes it impossible to use filesystem identifiers
to identify devices. Now, the formatting step is performed before the VM
is started. Because some tests, however, rely on this behaviour, a
utility function to replace this behaviour in added in
/nixos/tests/common/auto-format-root-device.nix.

Devices that contain neither a partition table nor a filesystem are
identified by their hardware serial number which is injecetd via QEMU
(and is thus persistent and predictable). PCI paths are not a reliably
way to identify devices because their availability and numbering depends
on the QEMU machine type.

This change makes the module more robust against changes in QEMU and the
kernel (non-persistent device naming) and by decoupling abstractions
(i.e. rootDevice, bootPartition, and bootLoaderDevice) enables further
improvement down the line.
2023-06-16 19:36:03 +02:00
Raito Bezarius 610f60231f nixos/qemu-vm: introduce virtualisation.directBoot
As with many things, we have scenarios where we don't want to boot on a
disk / bootloader and also we don't want to boot directly.

Sometimes, we want to boot through an OptionROM of our NIC, e.g. netboot
scenarios or let the firmware decide something, e.g. UEFI PXE (or even
UEFI OptionROM!).

This is composed of:

- `directBoot.enable`: whether to direct boot or not
- `directBoot.initrd`: enable overriding the
  `config.system.build.initialRamdisk` defaults, useful for
  netbootRamdisk for example.

This makes it possible.
2023-06-09 14:51:18 +02:00
K900 57e1ea5a18 nixos/libvirtd: don't use cp -n 2023-06-05 19:14:01 +03:00
Victor Buttner 4f1ccb7fc5 nixos/docker: add extraPackages option
This permits easier use of some features, e.g. docker checkpoint.
2023-06-02 15:45:55 +02:00
Ryan Lahfa 0902958046
Merge pull request #235295 from nikstur/qemu-vm-improve-comments-and-docs
nixos/qemu-vm: improve comments and option descriptions
2023-06-02 15:34:49 +02:00
Amine Chikhaoui 709043ed97
add release 23.05 AWS AMIs 2023-06-01 13:46:53 -04:00
nikstur 003fec835c nixos/qemu-vm: remove grub references from useBootLoader description 2023-06-01 01:38:08 +02:00
nikstur 8ea8154a32 nixos/qemu-vm: (re-)move old/incorrect comments 2023-06-01 01:38:06 +02:00
Raito Bezarius 09d1022782 nixos/qemu-vm: fix 32-bits assert for memorySize
It should be an implication, rather than &&.
2023-05-27 17:20:08 +02:00
Ryan Lahfa 537c6ede55
Merge pull request #234266 from emilylange/qemu-vm-2047mb
nixos/qemu-vm: add `virtualisation.memorySize < 2048` assertion on 32bit
2023-05-27 15:31:00 +02:00
emilylange 5dbd4f3243
nixos/qemu-vm: add virtualisation.memorySize < 2048 assertion on 32bit 2023-05-26 19:43:58 +02:00
Ryan Lahfa 435237d641
Merge pull request #233350 from GrahamDennis/grahamdennis/testing-networks
nixos/qemu-vm: add option for named network interfaces
2023-05-26 15:57:01 +02:00
lucasew 8587646ef3 nixos/virtualisation/google-compute-config: minor refactoring
Signed-off-by: lucasew <lucas59356@gmail.com>
2023-05-26 00:56:32 +00:00
illustris 6a20c13258
nixos/proxmox-image: fix qemu build failure 2023-05-25 16:25:43 +05:30
Graham Dennis 93502aa3b1 nixos/qemu-vm: add option for named network interfaces
Adds a new option to the virtualisation modules that enables specifying explicitly named network interfaces in QEMU VMs.
The existing `virtualisation.vlans` option is still supported for cases where the name of the network interface is irrelevant.
2023-05-24 08:54:20 +10:00
Sandro Jäckel 9ad0793b40
nixos/podman: persist timer
otherwise the timer might never run on laptops which could be shutdown
during the night
2023-05-21 17:24:16 +02:00
Sandro Jäckel 64361e26b2
nixos/libvirtd: enable polkit
it is enforced by an assert anyway
2023-05-20 17:30:34 +02:00
Yoann Beaugnon 9617d41ab1 nixos/libvirtd: add support for nixos managed libvirt hooks
Libvirt support calling user defined hooks on certains events.
Documentation can be found https://libvirt.org/hooks.html.
This commit allow specifying these hooks via the
virtualisation.libvirtd.hooks.<name>.* options
2023-05-19 12:46:07 +02:00
Maciej Krüger 5bb24e21ee
Merge pull request #231097 from aanderse/lxc/nixos-rebuild-boot 2023-05-16 04:13:01 +02:00
Fabian Möller c51fe112cc
treewide: pass system argument to eval-config.nix
Calling `eval-config.nix` without a `system` from a Nix flake fails with
`error: attribute 'currentSystem' missing` since #230523. Setting
`system = null` removes the use of `currentSystem` and instead uses the
value from the `nixpkgs` module.
2023-05-12 14:56:23 +02:00
Arian van Putten 6c0935d466
Merge pull request #231140 from NixOS/rosetta-nix-build
modules/rosetta: configure nix build sandbox to use rosetta
2023-05-11 14:21:54 -04:00
ajs124 30bea8d82d nixos/*: remove boot.grub.version 2023-05-10 21:51:26 +02:00
Arian van Putten a33d032939 modules/rosetta: configure nix build sandbox to use rosetta
With this we can do x86_64 builds on aarch64
2023-05-10 14:28:50 -04:00
Aaron Andersen dd2c3b1310 nixos/lxc-container: ensure /sbin/init is updated on nixos-rebuild boot 2023-05-10 11:04:07 -04:00
Ryan Lahfa 98167d573d
Merge pull request #229313 from mped-oticon/mped_proxmox_assert
nixos/proxmox-image: Disable O_DIRECT to fix assert when writing to tmpfs
2023-05-08 16:11:40 +02:00
Mark Ruvald Pedersen 66fb2f539a nixos/proxmox-image: Disable O_DIRECT to fix assert
Context summary:
'vma create' can't otherwise write to tmpfs such as /dev/shm.
This is important when used from non-nixos machines which may
have /build as tmpfs.

VMA is Proxmox's virtual machine image format that wraps QEMU images,
augmenting these with proxmox-specific configuration file.
proxmox-image.nix uses the VMA tool to create vma image files.
The VMA tool exists as a patchset ontop of QEMU.

VMA writes its output with open() and O_DIRECT flag.
O_DIRECT does not work on Linux tmpfs [1]. Thus:
$ vma create ~/output.vma ...  # works, assuming home isn't tmpfs.
$ vma create /dev/shm/output.vma ...  # fails since /dev/shm is tmpfs
Failure results in assert(*errp == NULL).

O_DIRECT is a cache performance hint.
But it currently blocks our usage of nixos-generate -f proxmox from
Non-NixOS hosts and Docker.

The patch here simply removes O_DIRECT:
vma-writer.c later performs memalign due to O_DIRECT, but this is
safe to do with or without O_DIRECT.
Ideally, this should be fixed in upstream Proxmox: Perhaps by falling
back to open without O_DIRECT.

Another attempt to fix this SIGABRT is [2], which writes the vma file
directory to $out/ folder -- however that may still be tmpfs mounted
which it is in our case.

[1] https://lore.kernel.org/lkml/45A29EC2.8020502@tmr.com/t/
[2] https://github.com/NixOS/nixpkgs/pull/224282
2023-05-08 12:33:41 +02:00