Changes: nbd: Update nixos/modules/services/networking/nbd.nix Co-authored-by: pennae <82953136+pennae@users.noreply.github.com> nbd: Update nixos/modules/services/networking/nbd.nix Co-authored-by: pennae <82953136+pennae@users.noreply.github.com> nbd: Update nixos/tests/nbd.nix Co-authored-by: pennae <82953136+pennae@users.noreply.github.com> nbd: generalize options in nbd service nbd: harden service nbd: Update nixos/modules/services/networking/nbd.nix Co-authored-by: pennae <82953136+pennae@users.noreply.github.com> nbd: Update nixos/modules/services/networking/nbd.nix Co-authored-by: pennae <82953136+pennae@users.noreply.github.com> nbd: refactor code a bit and BindPaths automatically
31 KiB
Release 22.05 (“Quokka”, 2022.05/??)
In addition to numerous new and upgraded packages, this release has the following highlights:
- Support is planned until the end of December 2022, handing over to 22.11.
Highlights
-
security.acme.defaultshas been added to simplify configuring settings for many certificates at once. This also opens up the the option to use DNS-01 validation when usingenableACMEon web server virtual hosts (e.g.services.nginx.virtualHosts.*.enableACME). -
PHP 8.1 is now available
-
Mattermost has been updated to extended support release 6.3, as the previously packaged extended support release 5.37 is reaching its end of life. Migrations may take a while, see the changelog and important upgrade notes.
-
systemd services can now set systemd.services.<name>.reloadTriggers instead of
reloadIfChangedfor a more granular distinction between reloads and restarts. -
kopsdefaults to 1.22.4, which will enable Instance Metadata Service Version 2 and require tokens on new clusters with Kubernetes 1.22. This will increase security by default, but may break some types of workloads. See the release notes for details.
New Services
-
aesmd, the Intel SGX Architectural Enclave Service Manager. Available as services.aesmd.
-
rootless Docker, a
systemd --userDocker service which runs without root permissions. Available as virtualisation.docker.rootless.enable. -
matrix-conduit, a simple, fast and reliable chat server powered by matrix. Available as services.matrix-conduit.
-
filebeat, a lightweight shipper for forwarding and centralizing log data. Available as services.filebeat.
-
apfs, a kernel module for mounting the Apple File System (APFS).
-
FRRouting, a popular suite of Internet routing protocol daemons (BGP, BFD, OSPF, IS-IS, VVRP and others). Available as services.frr
-
heisenbridge, a bouncer-style Matrix IRC bridge. Available as services.heisenbridge.
-
snowflake-proxy, a system to defeat internet censorship. Available as services.snowflake-proxy.
-
ergochat, a modern IRC with IRCv3 features. Available as services.ergochat.
-
PowerDNS-Admin, a web interface for the PowerDNS server. Available at services.powerdns-admin.
-
pgadmin4, an admin interface for the PostgreSQL database. Available at services.pgadmin.
-
input-remapper, an easy to use tool to change the mapping of your input device buttons. Available at services.input-remapper.
-
InvoicePlane, web application for managing and creating invoices. Available at services.invoiceplane.
-
maddy, a composable all-in-one mail server. Available as services.maddy.
-
K40-Whisperer, a program to control cheap Chinese laser cutters. Available as programs.k40-whisperer.enable. Users must add themselves to the
k40group to be able to access the device. -
mtr-exporter, a Prometheus exporter for mtr metrics. Available as services.mtr-exporter.
-
tetrd, share your internet connection from your device to your PC and vice versa through a USB cable. Available at services.tetrd.
-
agate, a very simple server for the Gemini hypertext protocol. Available as services.agate.
-
ArchiSteamFarm, a C# application with primary purpose of idling Steam cards from multiple accounts simultaneously. Available as services.archisteamfarm.
-
teleport, allows engineers and security professionals to unify access for SSH servers, Kubernetes clusters, web applications, and databases across all environments. Available at services.teleport.
-
BaGet, a lightweight NuGet and symbol server. Available at services.baget.
-
moosefs, fault tolerant petabyte distributed file system. Available as moosefs.
-
prosody-filer, a server for handling XMPP HTTP Upload requests. Available at services.prosody-filer.
-
ethercalc, an online collaborative spreadsheet. Available as services.ethercalc.
-
nbd, a Network Block Device server. Available as services.nbd.
-
timetagger, an open source time-tracker with an intuitive user experience and powerful reporting. services.timetagger.
-
rstudio-server, a browser-based version of the RStudio IDE for the R programming language. Available as services.rstudio-server.
-
headscale, an Open Source implementation of the Tailscale Control Server. Available as services.headscale
-
blocky, fast and lightweight DNS proxy as ad-blocker for local network with many features.
Backward Incompatibilities
-
pkgs.ghcnow refers topkgs.targetPackages.haskellPackages.ghc. This only makes a difference if you are cross-compiling and will ensure thatpkgs.ghcalways runs on the host platform and compiles for the target platform (similar topkgs.gccfor example).haskellPackages.ghcstill behaves as before, running on the build platform and compiling for the host platform (similar tostdenv.cc). This means you don't have to adjust your derivations if you usehaskellPackages.callPackage, but when usingpkgs.callPackageand takingghcas an input, you should now usebuildPackages.ghcinstead to ensure cross compilation keeps working (or switch tohaskellPackages.callPackage). -
pkgs.ghc.withPackagesas well ashaskellPackages.ghcWithPackagesetc. now needs be overridden directly, as opposed to overriding the result of calling it. Additionally, thewithLLVMparameter has been renamed touseLLVM. So instead of(ghc.withPackages (p: [])).override { withLLVM = true; }, one needs to use(ghc.withPackages.override { useLLVM = true; }) (p: []). -
The
home-assistantmodule now requires users that don't want their configuration to be managed declaratively to setservices.home-assistant.config = null;. This is required due to the way default settings are handled with the new settings style.Additionally the default list of
extraComponentsnow includes the minimal dependencies to successfully complete the onboarding procedure. -
pkgs.emacsPackages.orgPackagesis removed because org elpa is deprecated. The packages in the top level ofpkgs.emacsPackages, such as org and org-contrib, refer to the ones inpkgs.emacsPackages.elpaPackagesandpkgs.emacsPackages.nongnuPackageswhere the new versions will release. -
services.kubernetes.addons.dashboardwas removed due to it being an outdated version. -
services.kubernetes.scheduler.{port,address}now set--secure-portand--bind-addressinstead of--portand--address, since the former have been deprecated and are no longer functional in kubernetes>=1.23. Ensure that you are not relying on the insecure behaviour before upgrading. -
The DHCP server (
services.dhcpd4,services.dhcpd6) has been hardened. The service is now using the systemd'sDynamicUsermechanism to run as an unprivileged dynamically-allocated user with limited capabilities. The dhcpd state files are now always stored in/var/lib/dhcpd{4,6}and theservices.dhcpd4.stateDirandservice.dhcpd6.stateDiroptions have been removed. If you were depending on root privileges or set{uid,gid,cap} binaries in dhcpd shell hooks, you may give dhcpd more capabilities with e.g.systemd.services.dhcpd6.serviceConfig.AmbientCapabilities. -
The
mailpileemail webclient (services.mailpile) has been removed due to its reliance on python2. -
The
matrix-synapseservice (services.matrix-synapse) has been converted to use thesettingsoption defined in RFC42. This means that options that are part of yourhomeserver.yamlconfiguration, and that were specified at the top-level of the module (services.matrix-synapse) now need to be moved intoservices.matrix-synapse.settings. And while not all options you may use are defined in there, they are still supported, because you can set arbitrary values in this freeform type.An example to make the required migration clearer:
Before:
{ services.matrix-synapse = { enable = true; server_name = "example.com"; public_baseurl = "https://example.com:8448"; enable_registration = false; registration_shared_secret = "xohshaeyui8jic7uutuDogahkee3aehuaf6ei3Xouz4iicie5thie6nohNahceut"; macaroon_secret_key = "xoo8eder9seivukaiPh1cheikohquuw8Yooreid0The4aifahth3Ou0aiShaiz4l"; tls_certificate_path = "/var/lib/acme/example.com/fullchain.pem"; tls_certificate_path = "/var/lib/acme/example.com/fullchain.pem"; listeners = [ { port = 8448; bind_address = ""; type = "http"; tls = true; resources = [ { names = [ "client" ]; compress = true; } { names = [ "federation" ]; compress = false; } ]; } ]; }; }After:
{ services.matrix-synapse = { enable = true; # this attribute set holds all values that go into your homeserver.yaml configuration # See https://github.com/matrix-org/synapse/blob/develop/docs/sample_config.yaml for # possible values. settings = { server_name = "example.com"; public_baseurl = "https://example.com:8448"; enable_registration = false; # pass `registration_shared_secret` and `macaroon_secret_key` via `extraConfigFiles` instead tls_certificate_path = "/var/lib/acme/example.com/fullchain.pem"; tls_certificate_path = "/var/lib/acme/example.com/fullchain.pem"; listeners = [ { port = 8448; bind_address = [ "::" "0.0.0.0" ]; type = "http"; tls = true; resources = [ { names = [ "client" ]; compress = true; } { names = [ "federation" ]; compress = false; } ]; } ]; }; extraConfigFiles = [ /run/keys/matrix-synapse/secrets.yaml ]; }; }The secrets in your original config should be migrated into a YAML file that is included via
extraConfigFiles.Additionally a few option defaults have been synced up with upstream default values, for example the
max_upload_sizegrew from10Mto50M. -
The MoinMoin wiki engine (
services.moinmoin) has been removed, because Python 2 is being retired from nixpkgs. -
The
wafHookhook now honorsNIX_BUILD_CORESwhenenableParallelBuildingis not set explicitly. Packages can restore the old behaviour by settingenableParallelBuilding=false. -
pkgs.claws-mail-gtk2, representing Claws Mail's older release version three, was removed in order to get rid of Python 2. Please switch toclaws-mail, which is Claws Mail's latest release based on GTK+3 and Python 3. -
The
writers.writePython2and correspondingwriters.writePython2Binconvenience functions to create executable Python 2 scripts in the store were removed in preparation of removal of the Python 2 interpreter. Scripts have to be converted to Python 3 for use withwriters.writePython3orwriters.writePyPy2needs to be used. -
buildGoModulewas updated to usego_1_17, third party derivations that specify >= go 1.17 in the maingo.modwill need to regenerate theirvendorSha256hash. -
The
gnome-passwordsafepackage updated to version 6.x and renamed tognome-secrets. -
If you previously used
/etc/docker/daemon.json, you need to incorporate the changes into the new optionvirtualisation.docker.daemon.settings. -
Ntopng (
services.ntopng) is updated to 5.2.1 and uses a separate Redis instance ifsystem.stateVersionis at least22.05. Existing setups shouldn't be affected. -
The backward compatibility in
services.wordpressto configure sites with the old interface has been removed. Please useservices.wordpress.sitesinstead. -
The backward compatibility in
services.dokuwikito configure sites with the old interface has been removed. Please useservices.dokuwiki.sitesinstead. -
opensmtpd-extras is no longer build with python2 scripting support due to python2 deprecation in nixpkgs
-
services.miniflux.adminCredentialFilesis now required, instead of defaulting toadminandpassword. -
The
autoresticpackage has been upgraded from 1.3.0 to 1.5.0 which introduces breaking changes in config file, check their migration guide for more details. -
For
pkgs.python3.pkgs.ipython, its direct dependencypkgs.python3.pkgs.matplotlib-inline(which is really an adapter to integrate matplotlib in ipython if it is installed) does not depend onpkgs.python3.pkgs.matplotlibanymore. This is closer to a non-Nix install of ipython. This has the added benefit to reduce the closure size ofipythonfrom ~400MB to ~160MB (including ~100MB for python itself). -
documentation.manhas been refactored to support choosing a man implementation other than GNU'sman-db. For this,documentation.man.manualPageshas been renamed todocumentation.man.man-db.manualPages. If you want to use the new alternative man implementationmandoc, adddocumentation.man = { enable = true; man-db.enable = false; mandoc.enable = true; }to your configuration. -
Normal users (with
isNormalUser = true) which have non-emptysubUidRangesorsubGidRangesset no longer have additional implicit ranges allocated. To enable automatic allocation back setautoSubUidGidRange = true. -
idris2now requires--packagewhen using packagescontribandnetwork, while previously these idris2 packages were automatically loaded. -
The iputils package, which is installed by default, no longer provides the legacy tools
tftpdandtraceroute6. More tools (ninfod,rarpd, andrdisc) are going to be removed in the next release. See upstream's release notes for more details and available replacements. -
services.thelounge.privatewas removed in favor ofservices.thelounge.public, to follow with upstream changes. -
pkgs.docbookrxwas removed since it's unmaintained -
tilp2was removed together with its module -
The F-PROT antivirus (
fprotpackage) and its service module were removed because it reached end-of-life. -
bird1and its modulesservices.birdas well asservices.bird6have been removed. Upgrade toservices.bird2. -
The options
networking.interfaces.<name>.ipv4.routesandnetworking.interfaces.<name>.ipv6.routesare no longer ignored when using networkd instead of the default scripted network backend by settingnetworking.useNetworkdtotrue. -
MultiMC has been replaced with the fork PolyMC due to upstream developers being hostile to 3rd party package maintainers. PolyMC removes all MultiMC branding and is aimed at providing proper 3rd party packages like the one contained in Nixpkgs. This change affects the data folder where game instances and other save and configuration files are stored. Users with existing installations should rename
~/.local/share/multimcto~/.local/share/polymc. The main config file's path has also moved from~/.local/share/multimc/multimc.cfgto~/.local/share/polymc/polymc.cfg. -
systemd-nspawn@.servicesettings have been reverted to the default systemd behaviour. User namespaces are now activated by default. If you want to keep running nspawn containers without user namespaces you need to setsystemd.nspawn.<name>.execConfig.PrivateUsers = false -
The terraform 0.12 compatibility has been removed and the
terraform.withPluginsandterraform-providers.mkProviderimplementations simplified. Providers now need to be stored under$out/libexec/terraform-providers/<registry>/<owner>/<name>/<version>/<os>_<arch>/terraform-provider-<name>_v<version>(which mkProvider does).This breaks back-compat so it's not possible to mix-and-match with previous versions of nixpkgs. In exchange, it now becomes possible to use the providers from nixpkgs-terraform-providers-bin directly.
-
The existing
pkgs.opentelemetry-collectorhas been moved topkgs.opentelemetry-collector-contribto match the actual source being the "contrib" edition.pkgs.opentelemetry-collectoris now the actual core release of opentelemetry-collector. If you use the community contributions you should change the package you refer to. If you don't need them update your commands fromotelcontribcoltootelcorecoland enjoy a 7x smaller binary. -
pkgs.pgadminnow refers topkgs.pgadmin4. If you still need pgadmin3, usepkgs.pgadmin3. -
pkgs.noto-fonts-cjkis now deprecated in favor ofpkgs.noto-fonts-cjk-sansandpkgs.noto-fonts-cjk-serifbecause they each have different release schedules. To maintain compatibility with prior releases of Nixpkgs,pkgs.noto-fonts-cjkis currently an alias ofpkgs.noto-fonts-cjk-sansand doesn't include serif fonts. -
switch-to-configuration(the script that is run when runningnixos-rebuild switchfor example) has been reworked- The interface that allows activation scripts to restart units has been streamlined. Restarting and reloading is now done by a single file
/run/nixos/activation-restart-listthat honorsrestartIfChangedandreloadIfChangedof the units.- Preferring to reload instead of restarting can still be achieved using
/run/nixos/activation-reload-list.
- Preferring to reload instead of restarting can still be achieved using
- The script now uses a proper ini-file parser to parse systemd units. Some values are now only searched in one section instead of in the entire unit. This is only relevant for units that don't use the NixOS systemd moule.
RefuseManualStop,X-OnlyManualStart,X-StopOnRemoval,X-StopOnReconfigurationare only searched in the[Unit]sectionX-ReloadIfChanged,X-RestartIfChanged,X-StopIfChangedare only searched in the[Service]section
- The interface that allows activation scripts to restart units has been streamlined. Restarting and reloading is now done by a single file
-
The
services.bookstack.cacheDiroption has been removed, since the cache directory is now handled by systemd. -
The
services.bookstack.extraConfigoption has been replaced byservices.bookstack.configwhich implements a settings-style configuration. -
lib.assertMsgandlib.assertOneOfno longer returnfalseif the passed condition isfalse,throwing the given error message instead (which makes the resulting error message less cluttered). This will not impact the behaviour of code using these functions as intended, namely as top-level wrapper forassertconditions. -
The
vpncpackage has been changed to use GnuTLS instead of OpenSSL by default for licensing reasons. -
pkgs.vimPlugins.onedark-nvimnow refers to navarasu/onedark.nvim (formerly refers to olimorris/onedarkpro.nvim). -
services.pipewire.enablewill default to enabling the WirePlumber session manager instead of pipewire-media-session. pipewire-media-session is deprecated by upstream and not recommended, but can still be manually enabled by settingservices.pipewire.media-session.enabletotrueandservices.pipewire.wireplumber.enabletofalse. -
pkgs.makeDesktopItemhas been refactored to provide a more idiomatic API. Specifically:- All valid options as of FDO Desktop Entry specification version 1.4 can now be passed in as explicit arguments
execcan now be null, for entries that are not of type ApplicationmimeTypeargument is renamed tomimeTypesfor consistencymimeTypes,categories,implements,keywords,onlyShowInandnotShowIntake lists of strings instead of one string with semicolon separatorsextraDesktopEntriesrenamed toextraConfigfor consistency- Actions should now be provided as an attrset
actions, theActionsline will be autogenerated. extraEntriesis removed.- Additional validation is added both at eval time and at build time.
See the
vscodepackage for a more detailed example.
Other Notable Changes
-
The option services.redis.servers was added to support per-application
redis-serverwhich is more secure since Redis databases are only mere key prefixes without any configuration or ACL of their own. Backward-compatibility is preserved by mapping oldservices.redis.settingstoservices.redis.servers."".settings, but you are strongly encouraged to name eachredis-serverinstance after the application using it, instead of keeping that nameless one. Except for the namelessservices.redis.servers.""still accessible at127.0.0.1:6379, and to the members of the Unix groupredisthrough the Unix socket/run/redis/redis.sock, all otherservices.redis.servers.${serverName}are only accessible by default to the members of the Unix groupredis-${serverName}through the Unix socket/run/redis-${serverName}/redis.sock. -
The option virtualisation.vmVariant was added to allow users to make changes to the
nixos-rebuild build-vmconfiguration that do not apply to their normal system.The
config.system.build.vmattribute now always exists and defaults to the value fromvmVariant. Configurations that import thevirtualisation/qemu-vm.nixmodule themselves will override this value, such thatvmVariantis not used.Similarly virtualisation.vmVariantWithBootloader was added.
-
The configuration portion of the
nix-daemonmodule has been reworked and exposed as nix.settings:- Legacy options have been mapped to the corresponding options under under nix.settings but may be deprecated in the future.
- nix.buildMachines.publicHostKey has been added.
-
The
writers.writePyPy2/writers.writePyPy3and correspondingwriters.writePyPy2Bin/writers.writePyPy3Binconvenience functions to create executable Python 2/3 scripts using the PyPy interpreter were added. -
If you are using Wayland you can choose to use the Ozone Wayland support in Chrome and several Electron apps by setting the environment variable
NIXOS_OZONE_WL=1(for example viaenvironment.sessionVariables.NIXOS_OZONE_WL = "1"). This is not enabled by default because Ozone Wayland is still under heavy development and behavior is not always flawless. Furthermore, not all Electron apps use the latest Electron versions. -
The
influxdb2package was split intoinfluxdb2-serverandinfluxdb2-cli, matching the split that took place upstream. A combinedinfluxdb2package is still provided in this release for backwards compatibilty, but will be removed at a later date. -
The
services.unifi.openPortsoption default value oftrueis now deprecated and will be changed tofalsein 22.11. Configurations using this default will print a warning when rebuilt. -
security.acmecertificates will now correctly check for CA revokation before reaching their minimum age. -
Removing domains from
security.acme.certs._name_.extraDomainNameswill now correctly remove those domains during rebuild/renew. -
MariaDB is now offered in several versions, not just the newest one. So if you have a need for running MariaDB 10.4 for example, you can now just set
services.mysql.package = pkgs.mariadb_104;. In general, it is recommended to run the newest version, to get the newest features, while sticking with an LTS version will most likely provide a more stable experience. Sometimes software is also incompatible with the newest version of MariaDB. -
The option programs.ssh.enableAskPassword was added, decoupling the setting of
SSH_ASKPASSfromservices.xserver.enable. This allows easy usage in non-X11 environments, e.g. Wayland. -
programs.ssh.knownHosts has gained an
extraHostNamesoption to replacehostNames.hostNamesis deprecated, but still available for now. -
The
services.stubbymodule was converted to a settings-style configuration. -
The option
services.duplicati.dataDirhas been added to allow changing the location of duplicati's files. -
A new option
boot.initrd.extraModprobeConfighas been added which can be used to configure kernel modules that are loaded in the initrd. -
nixos-generate-confignow puts the dhcp configuration inhardware-configuration.nixinstead ofconfiguration.nix. -
fetchFromSourcehutnow allows fetching repositories recursively usingfetchgitorfetchhgif the argumentfetchSubmodulesis set totrue. -
The
element-desktoppackage now has anuseKeytaroption (defaults totrue), which allows disablingkeytarand in turnlibsecretusage (which binds to native credential managers / keychain libraries). -
The option
services.thelounge.pluginshas been added to allow installing plugins for The Lounge. Plugins can be found inpkgs.theLoungePlugins.pluginsandpkgs.theLoungePlugins.themes. -
The
firmwareLinuxNonfreepackage has been renamed tolinux-firmware. -
It is now possible to specify wordlists to include as handy to access environment variables using the
config.environment.wordlistconfiguration options. -
The
services.mbpfanmodule was converted to a RFC 0042 configuration. -
The default value for
programs.spacefm.settings.graphical_sugot unset. It previously pointed togksuwhich has been removed. -
A new module was added for the Starship shell prompt, providing the options
programs.starship.enableandprograms.starship.settings. -
The Dino XMPP client was updated to 0.3, adding support for audio and video calls.
-
services.mattermost.pluginshas been added to allow the declarative installation of Mattermost plugins. Plugins are automatically repackaged using autoPatchelf. -
services.logrotate.enablenow defaults to true if any rotate path has been defined, and some paths have been added by default. -
The
zreplpackage has been updated from 0.4.0 to 0.5:- The RPC protocol version was bumped; all zrepl daemons in a setup must be updated and restarted before replication can resume.
- A bug involving encrypt-on-receive has been fixed. Read the zrepl documentation and check the output of
zfs get -r encryption,zrepl:placeholder PATH_TO_ROOTFSon the receiver.
-
Renamed option
services.openssh.challengeResponseAuthenticationtoservices.openssh.kbdInteractiveAuthentication. Reason is that the old name has been deprecated upstream. Using the old option name will still work, but produce a warning. -
The option services.networking.networkmanager.enableFccUnlock was added to support FCC unlock procedures. Since release 1.18.4, the ModemManager daemon no longer automatically performs the FCC unlock procedure by default. See the docs for more details.
-
programs.tmuxhas a new optionpluginsthat accepts a list of packages from thetmuxPluginsgroup. The specified packages are added to the system and loaded bytmux. -
The polkit service, available at
security.polkit.enable, is now disabled by default. It will automatically be enabled through services and desktop environments as needed.