Commit Graph

43 Commits

Author SHA1 Message Date
Adam C. Stephens
887d3f54c6
Merge pull request #278753 from adamcstephens/incus/migrate-test
incus, lxd: ensure lxd->incus migration is supported and tested
2024-01-18 08:01:23 -05:00
Adam Stephens
ffdcec2d94
nixos/tests/incus: add lxd-to-incus migration test 2024-01-14 09:26:49 -05:00
Peder Bergebakken Sundt
4071c294ac nixos/lxd: convert cfg.package to mkPackageOption
Also fixes the documentation of `virtualisation.lxd.ui.package`, which currently says the package is `pkgs.ui`
2023-12-16 21:30:18 +01:00
Adam Stephens
6765aac154
treewide/lxc: set lxc team as maintainer 2023-12-04 10:06:50 -05:00
Maciej Krüger
d934d20cd3
nixos/lxd: fix ui.enable desc
Otherwise it would show up as "Whether to enable Enables the (experimental) LXD UI. ."

Now is just "Whether to enable (experimental) LXD UI."
2023-10-12 15:24:01 +02:00
Adam Stephens
a90385c62b nixos/lxd: add preseed option 2023-09-05 15:28:00 +00:00
Adam Stephens
85c14ff2ff nixos/lxd: remove with lib 2023-09-05 15:28:00 +00:00
Adam Stephens
efd1605be6
nixos/lxd: add virtual-machine support, image and module 2023-09-03 20:06:44 -04:00
Jon Seager
5e73f0c1c9 nixos/lxd: fix default ui package 2023-07-17 08:04:42 -03:00
Jon Seager
2fbb85e2c9
nixos/lxd: add ui.enable option to toggle ui feature 2023-07-07 18:31:03 +01:00
Martino Fontana
e1a6c85c2b nixos/sysctl: raise default vm.max_map_count to 1048576 2023-06-21 19:25:42 +02:00
Bjørn Forsman
c3cfa83884 nixos/lxd: add missing util-linux to $PATH
This fixes `lxd init`, which previously failed like this:

  $ yes "" | lxd init
  [...]
  Error: Failed to create storage pool "default": Failed to run: losetup --find --nooverlap --direct-io=on --show /var/lib/lxd/disks/default.img: exec: "losetup": executable file not found in $PATH
2022-12-03 16:01:05 +01:00
Benjamin Asbach
96424ddf55 lxd: Check if lxcfs is enabled before adding it as service dependency
Without that check `lxc.service` cannot be manage manually as a manual start fails due to missing dependency to `lxcfs` when not enabled.
2022-11-28 21:48:34 +04:00
pennae
f2ea09ecbe nixos/*: convert options with listings
minor rendering changes.
2022-08-31 17:27:36 +02:00
pennae
7d102d113a nixos/*: convert multiline inline code to listings
presumably it was not intended to have these blocks rendered inline, and
markdown conversion would be messy as well.
2022-08-31 16:27:25 +02:00
pennae
2e751c0772 treewide: automatically md-convert option descriptions
the conversion procedure is simple:

 - find all things that look like options, ie calls to either `mkOption`
   or `lib.mkOption` that take an attrset. remember the attrset as the
   option
 - for all options, find a `description` attribute who's value is not a
   call to `mdDoc` or `lib.mdDoc`
 - textually convert the entire value of the attribute to MD with a few
   simple regexes (the set from mdize-module.sh)
 - if the change produced a change in the manual output, discard
 - if the change kept the manual unchanged, add some text to the
   description to make sure we've actually found an option. if the
   manual changes this time, keep the converted description

this procedure converts 80% of nixos options to markdown. around 2000
options remain to be inspected, but most of those fail the "does not
change the manual output check": currently the MD conversion process
does not faithfully convert docbook tags like <code> and <package>, so
any option using such tags will not be converted at all.
2022-07-30 15:16:34 +02:00
Maciej Krüger
9d3df0b2ac
nixos/lxd: fix nftables switch #81172 breaking module 2021-11-03 07:41:40 +01:00
Naïm Favier
2ddc335e6f
nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
Guillaume Girol
bc3bca822a nixos: define the primary group of users where needed 2021-09-12 14:59:30 +02:00
Maciej Krüger
26b3751de7
Merge pull request #97692 from ryneeverett/lockkernelmodules-lxd 2021-06-05 01:27:27 +02:00
ryneeverett
161a35b0b8
nixos/lxd: explicitly load xt_CHECKSUM module
This module is needed to create bridge networks such as the default
lxdbr0 created by `lxd init`. Without this module, running `lxc network
create lxdbr0` errors with:

> Error: Failed to create network 'lxdbr0': Failed to run: iptables -w -t mangle -I POSTROUTING -o lxdbr0 -p udp --dport 68 -j CHECKSUM --checksum-fill -m comment --comment generated for LXD network lxdbr0: iptables v1.8.5 (legacy): unknown option "--checksum-fill"
2021-04-29 11:40:00 +02:00
ryneeverett
80e263b389
nixos/lxd: explicitly load kernel modules
This is analogous to #70447 and #76487.

These are all needed to attach a container to the default bridge
network, without which the final line of the following script fails with
the error for each respective kernel module listed below.

```sh
lxc storage create foo dir
lxc launch -s foo ubuntu:trusty bar
lxc network attach lxdbr0 bar
```

veth
----

> Error: Failed to start device 'lxdbr0': Failed to create the veth interfaces vethefbc3cd6 and vetha4abbcbc: Failed to run: ip link add dev vethefbc3cd6 type veth peer name vetha4abbcbc: RTNETLINK answers: Operation not supported

iptable_mangle
--------------

> lvl=eror msg="Failed to bring up network" err="Failed to list ipv4 rules for LXD network lxdbr0 (table mangle)" name=lxdbr0

xt_comment
----------

> lvl=error msg="Failed to bring up network" err="Failed to run: iptables -w -t filter -I INPUT -i lxdbr0 -p udp --dport 67 -j ACCEPT -m comment --comment generated for LXD network lxdbr0: iptables v1.8.4 (legacy): Couldn't load match `comment':No such file or directory\n\nTry `iptables -h' or 'iptables --help' for more information." name=lxdbr0

xt_MASQUERADE
-------------

> vl=eror msg="Failed to bring up network" err="Failed to run: iptables -w -t nat -I POSTROUTING -s 10.0.107.0/24 ! -d 10.0.107.0/24 -j MASQUERADE -m comment --comment generated for LXD network lxdbr0: iptables v1.8.4 (legacy): Couldn't load target `MASQUERADE':No such file or directory\n\nTry `iptables -h' or 'iptables --help' for more information." name=lxdbr0
2021-04-29 11:37:10 +02:00
Julien Moutinho
05d334cfe2 Revert "Revert "apparmor: fix and improve the service""
This reverts commit 420f89ceb2.
2021-04-23 07:17:55 +02:00
rnhmjoj
24e45e308d
nixos/lxd: fixup of 4adcb006 2021-03-03 01:16:41 +01:00
rnhmjoj
b9dc818bd5
nixos/lxd: make start timeout configurable 2021-02-28 14:02:56 +01:00
rnhmjoj
4adcb00642
nixos/lxd: cleanup and misc fixes
- Actually use the zfsSupport option
- Add documentation URI to lxd.service
- Add lxd.socket to enable socket activatation
- Add proper dependencies and remove systemd-udev-settle from lxd.service
- Set up /var/lib/lxc/rootfs using systemd.tmpfiles
- Configure safe start and shutdown of lxd.service
- Configure restart on failures of lxd.service
2021-02-28 14:02:56 +01:00
Jörg Thalheim
9c6a9d0458
nixos/lxd: refactor to use zfs.package/enabled property 2021-02-01 17:59:18 +01:00
Patryk Wychowaniec
30ccbe8eec
nixos/lxd: disable cgroup v2 when LXD is active 2021-01-04 11:25:30 +01:00
Vladimír Čunát
420f89ceb2
Revert "apparmor: fix and improve the service"
This reverts commit fb6d63f3fd.

I really hope this finally fixes #99236: evaluation on Hydra.
This time I really did check basically the same commit on Hydra:
https://hydra.nixos.org/eval/1618011

Right now I don't have energy to find what exactly is wrong in the
commit, and it doesn't seem important in comparison to nixos-unstable
channel being stuck on a commit over one week old.
2020-10-07 12:22:18 +02:00
Julien Moutinho
fb6d63f3fd apparmor: fix and improve the service 2020-09-06 07:43:03 +02:00
Patryk Wychowaniec
6c6924b2eb
lxd: When lxcfs is enabled, start lxd with explicit LXD_LXC_TEMPLATE_CONFIG 2020-06-05 16:37:31 +02:00
Patryk Wychowaniec
72e80cdc54
lxd: Add proper support for nftables 2020-06-05 16:37:31 +02:00
zowoq
c59c4e3589 nixos/*: use $out instead of $bin with buildGoPackage 2020-04-28 20:30:29 +10:00
Jörg Thalheim
ccb3846596
lxd: also use default text for other package options 2020-01-30 14:26:54 +00:00
Hugo Geoffroy
665d863fce nixos/lxd: add package options for LXC, LXD and ZFS
Currently, LXD always use pkgs.zfs, even if boot.zfs.enableUnstable is set. This
change provides the option to change the LXC, LXD and ZFS packages, and
determines the default ZFS package based on zfs.enableUnstable.
2019-12-23 18:21:48 +01:00
mt_caret
7358e4f93c nixos/lxd: add recommendedSysctlSettings
* nixos/lxd: add productionSetup option
* nixos/lxd: enable some settings by default
* nixos/lxd: rename option
2019-12-14 15:29:08 +01:00
Florian Klink
fff5923686 nixos/modules: users.(extraUsers|extraGroup->users|group) 2018-06-30 03:02:58 +02:00
Jörg Thalheim
7663de114a lxd: 2.16 -> 3.0.0 2018-04-14 11:02:24 +01:00
Masayuki Takeda
65faff97ff nixos/lxd: partial fix 2018-02-10 17:18:53 +09:00
Bastian Köcher
179c504a66 lxd: 2.0.2 -> 2.12 (#25685)
* Upgrades lxd to version 2.12

* Adds missing packages to path for lxd
2017-05-24 19:29:38 +01:00
Zack Piper
f36c8f5f54 lxd: pkg.lxd does not point to the binaries
`pkg.lxd.bin` does
2016-06-19 20:30:36 +01:00
Tobias Geerinckx-Rice
82419575aa btrfsProgs -> canonical btrfs-progs 2016-01-03 20:38:44 +01:00
William A. Kennington III
c2e4fb29c6 nixos/lxd: Add service 2015-09-13 23:27:31 -07:00