Skip to content

Commit

Permalink
Merge master into haskell-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Mar 2, 2024
2 parents a1ed799 + 0267739 commit 38eff76
Show file tree
Hide file tree
Showing 211 changed files with 5,105 additions and 1,741 deletions.
23 changes: 22 additions & 1 deletion maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10842,6 +10842,15 @@
githubId = 77865363;
name = "Leonid Belyaev";
};
leonm1 = {
github = "leonm1";
githubId = 32306579;
keys = [{
fingerprint = "C12D F14B DC9D 64E1 44C3 4D8A 755C DA4E 5923 416A";
}];
matrix = "@mattleon:matrix.org";
name = "Matt Leon";
};
leshainc = {
email = "[email protected]";
github = "LeshaInc";
Expand Down Expand Up @@ -12495,6 +12504,12 @@
github = "MichaelBrunn3r";
githubId = 19626539;
};
MichaelCDormann = {
email = "[email protected]";
name = "Michael Dormann";
github = "MichaelCDormann";
githubId = 12633081;
};
michaelCTS = {
email = "[email protected]";
name = "Michael Vogel";
Expand Down Expand Up @@ -14178,7 +14193,8 @@
githubId = 332423;
};
nu-nu-ko = {
email = "[email protected]";
email = "[email protected]";
matrix = "@nuko:shimeji.cafe";
github = "nu-nu-ko";
githubId = 153512689;
name = "nuko";
Expand Down Expand Up @@ -16582,6 +16598,11 @@
fingerprint = "1401 1B63 393D 16C1 AA9C C521 8526 B757 4A53 6236";
}];
};
rosehobgoblin = {
name = "J. L. Bowden";
github = "rosehobgoblin";
githubId = 84164410;
};
rossabaker = {
name = "Ross A. Baker";
email = "[email protected]";
Expand Down
6 changes: 6 additions & 0 deletions nixos/doc/manual/release-notes/rl-2405.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,15 @@ In addition to numerous new and upgraded packages, this release has the followin

- [hebbot](https://github.com/haecker-felix/hebbot), a Matrix bot to generate "This Week in X" like blog posts. Available as [services.hebbot](#opt-services.hebbot.enable).

- [Python Matter Server](https://github.com/home-assistant-libs/python-matter-server), a
Matter Controller Server exposing websocket connections for use with other services, notably Home Assistant.
Available as [services.matter-server](#opt-services.matter-server.enable)

- [Anki Sync Server](https://docs.ankiweb.net/sync-server.html), the official sync server built into recent versions of Anki. Available as [services.anki-sync-server](#opt-services.anki-sync-server.enable).
The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been marked deprecated and will be dropped after 24.05 due to lack of maintenance of the anki-sync-server softwares.

- [transfer-sh](https://github.com/dutchcoders/transfer.sh), a tool that supports easy and fast file sharing from the command-line. Available as [services.transfer-sh](#opt-services.transfer-sh.enable).

- [Suwayomi Server](https://github.com/Suwayomi/Suwayomi-Server), a free and open source manga reader server that runs extensions built for [Tachiyomi](https://tachiyomi.org). Available as [services.suwayomi-server](#opt-services.suwayomi-server.enable).

- [ping_exporter](https://github.com/czerwonk/ping_exporter), a Prometheus exporter for ICMP echo requests. Available as [services.prometheus.exporters.ping](#opt-services.prometheus.exporters.ping.enable).
Expand Down
7 changes: 7 additions & 0 deletions nixos/lib/make-disk-image.nix
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,13 @@ let format' = format; in let
''}
# Set up core system link, bootloader (sd-boot, GRUB, uboot, etc.), etc.
# NOTE: systemd-boot-builder.py calls nix-env --list-generations which
# clobbers $HOME/.nix-defexpr/channels/nixos This would cause a folder
# /homeless-shelter to show up in the final image which in turn breaks
# nix builds in the target image if sandboxing is turned off (through
# __noChroot for example).
export HOME=$TMPDIR
NIXOS_INSTALL_BOOTLOADER=1 nixos-enter --root $mountPoint -- /nix/var/nix/profiles/system/bin/switch-to-configuration boot
# The above scripts will generate a random machine-id and we don't want to bake a single ID into all our images
Expand Down
7 changes: 6 additions & 1 deletion nixos/lib/test-driver/test_driver/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from pathlib import Path
from typing import Any, Callable, ContextManager, Dict, Iterator, List, Optional, Union

from colorama import Fore, Style

from test_driver.logger import rootlog
from test_driver.machine import Machine, NixStartScript, retry
from test_driver.polling_condition import PollingCondition
Expand Down Expand Up @@ -226,7 +228,10 @@ def create_machine(
)

rootlog.warning(
"Using create_machine with a single dictionary argument is deprecated, and will be removed in NixOS 24.11"
Fore.YELLOW
+ Style.BRIGHT
+ "WARNING: Using create_machine with a single dictionary argument is deprecated and will be removed in NixOS 24.11"
+ Style.RESET_ALL
)
# End legacy args handling

Expand Down
13 changes: 12 additions & 1 deletion nixos/modules/i18n/input-method/fcitx5.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ with lib;
let
im = config.i18n.inputMethod;
cfg = im.fcitx5;
fcitx5Package = pkgs.fcitx5-with-addons.override { inherit (cfg) addons; };
fcitx5Package =
if cfg.plasma6Support
then pkgs.qt6Packages.fcitx5-with-addons.override { inherit (cfg) addons; }
else pkgs.libsForQt5.fcitx5-with-addons.override { inherit (cfg) addons; };
settingsFormat = pkgs.formats.ini { };
in
{
Expand All @@ -27,6 +30,14 @@ in
See [Using Fcitx 5 on Wayland](https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland).
'';
};
plasma6Support = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
Use qt6 versions of fcitx5 packages.
Required for configuring fcitx5 in KDE System Settings.
'';
};
quickPhrase = mkOption {
type = with types; attrsOf str;
default = { };
Expand Down
6 changes: 5 additions & 1 deletion nixos/modules/misc/nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,11 @@ in
example = { system = "x86_64-linux"; };
# Make sure that the final value has all fields for sake of other modules
# referring to this.
apply = lib.systems.elaborate;
apply = inputBuildPlatform:
let elaborated = lib.systems.elaborate inputBuildPlatform;
in if lib.systems.equals elaborated cfg.hostPlatform
then cfg.hostPlatform # make identical, so that `==` equality works; see https://github.com/NixOS/nixpkgs/issues/278001
else elaborated;
defaultText = literalExpression
''config.nixpkgs.hostPlatform'';
description = lib.mdDoc ''
Expand Down
6 changes: 6 additions & 0 deletions nixos/modules/misc/nixpkgs/test.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ let
nixpkgs.hostPlatform = "aarch64-linux";
nixpkgs.buildPlatform = "aarch64-darwin";
};
withSameHostAndBuild = eval {
nixpkgs.hostPlatform = "aarch64-linux";
nixpkgs.buildPlatform = "aarch64-linux";
};
ambiguous = {
_file = "ambiguous.nix";
nixpkgs.hostPlatform = "aarch64-linux";
Expand Down Expand Up @@ -81,6 +85,8 @@ lib.recurseIntoAttrs {
assert withHost._module.args.pkgs.stdenv.buildPlatform.system == "aarch64-linux";
assert withHostAndBuild._module.args.pkgs.stdenv.hostPlatform.system == "aarch64-linux";
assert withHostAndBuild._module.args.pkgs.stdenv.buildPlatform.system == "aarch64-darwin";
assert withSameHostAndBuild.config.nixpkgs.buildPlatform == withSameHostAndBuild.config.nixpkgs.hostPlatform;
assert withSameHostAndBuild._module.args.pkgs.stdenv.buildPlatform == withSameHostAndBuild._module.args.pkgs.stdenv.hostPlatform;
assert builtins.trace (lib.head (getErrors ambiguous))
getErrors ambiguous ==
[''
Expand Down
2 changes: 2 additions & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@
./services/home-automation/govee2mqtt.nix
./services/home-automation/home-assistant.nix
./services/home-automation/homeassistant-satellite.nix
./services/home-automation/matter-server.nix
./services/home-automation/zigbee2mqtt.nix
./services/home-automation/zwave-js.nix
./services/logging/SystemdJournal2Gelf.nix
Expand Down Expand Up @@ -786,6 +787,7 @@
./services/misc/tiddlywiki.nix
./services/misc/tp-auto-kbbl.nix
./services/misc/tuxclocker.nix
./services/misc/transfer-sh.nix
./services/misc/tzupdate.nix
./services/misc/uhub.nix
./services/misc/weechat.nix
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/security/pam.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1465,9 +1465,9 @@ in
'';
}
{
assertion = config.security.pam.zfs.enable -> (config.boot.zfs.enabled || config.boot.zfs.enableUnstable);
assertion = config.security.pam.zfs.enable -> config.boot.zfs.enabled;
message = ''
`security.pam.zfs.enable` requires enabling ZFS (`boot.zfs.enabled` or `boot.zfs.enableUnstable`).
`security.pam.zfs.enable` requires enabling ZFS (`boot.zfs.enabled`).
'';
}
{
Expand Down
6 changes: 5 additions & 1 deletion nixos/modules/services/desktops/pipewire/pipewire.nix
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ in {
description = lib.mdDoc ''
List of packages that provide PipeWire configuration, in the form of
`share/pipewire/*/*.conf` files.
LV2 dependencies will be picked up from config packages automatically
via `passthru.requiredLv2Packages`.
'';
};

Expand All @@ -258,7 +261,8 @@ in {
be made available to PipeWire for [filter chains][wiki-filter-chain].
Config packages have their required LV2 plugins added automatically,
so they don't need to be specified here.
so they don't need to be specified here. Config packages need to set
`passthru.requiredLv2Packages` for this to work.
[wiki-filter-chain]: https://docs.pipewire.org/page_module_filter_chain.html
'';
Expand Down
8 changes: 6 additions & 2 deletions nixos/modules/services/desktops/pipewire/wireplumber.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ in
description = lib.mdDoc ''
List of packages that provide WirePlumber configuration, in the form of
`share/wireplumber/*/*.lua` files.
LV2 dependencies will be picked up from config packages automatically
via `passthru.requiredLv2Packages`.
'';
};

Expand All @@ -42,7 +45,8 @@ in
be made available to WirePlumber for [filter chains][wiki-filter-chain].
Config packages have their required LV2 plugins added automatically,
so they don't need to be specified here.
so they don't need to be specified here. Config packages need to set
`passthru.requiredLv2Packages` for this to work.
[wiki-filter-chain]: https://docs.pipewire.org/page_module_filter_chain.html
'';
Expand Down Expand Up @@ -108,7 +112,7 @@ in
)
config.environment.etc
)) == 1;
message = "Using `environment.etc.\"wireplumber<...>\"` directly is no longer supported in 24.05. Use `services.wireplumber.configPackages` instead.";
message = "Using `environment.etc.\"wireplumber<...>\"` directly is no longer supported in 24.05. Use `services.pipewire.wireplumber.configPackages` instead.";
}
];

Expand Down
125 changes: 125 additions & 0 deletions nixos/modules/services/home-automation/matter-server.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
{ lib
, pkgs
, config
, ...
}:

with lib;

let
cfg = config.services.matter-server;
storageDir = "matter-server";
storagePath = "/var/lib/${storageDir}";
vendorId = "4939"; # home-assistant vendor ID
in

{
meta.maintainers = with lib.maintainers; [ leonm1 ];

options.services.matter-server = with types; {
enable = mkEnableOption (lib.mdDoc "Matter-server");

package = mkPackageOptionMD pkgs "python-matter-server" { };

port = mkOption {
type = types.port;
default = 5580;
description = "Port to expose the matter-server service on.";
};

logLevel = mkOption {
type = types.enum [ "critical" "error" "warning" "info" "debug" ];
default = "info";
description = "Verbosity of logs from the matter-server";
};

extraArgs = mkOption {
type = listOf str;
default = [];
description = ''
Extra arguments to pass to the matter-server executable.
See https://github.com/home-assistant-libs/python-matter-server?tab=readme-ov-file#running-the-development-server for options.
'';
};
};

config = mkIf cfg.enable {
systemd.services.matter-server = {
after = [ "network-online.target" ];
before = [ "home-assistant.service" ];
wants = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
description = "Matter Server";
environment.HOME = storagePath;
serviceConfig = {
ExecStart = (concatStringsSep " " [
"${cfg.package}/bin/matter-server"
"--port" (toString cfg.port)
"--vendorid" vendorId
"--storage-path" storagePath
"--log-level" "${cfg.logLevel}"
"${escapeShellArgs cfg.extraArgs}"
]);
# Start with a clean root filesystem, and allowlist what the container
# is permitted to access.
TemporaryFileSystem = "/";
# Allowlist /nix/store (to allow the binary to find its dependencies)
# and dbus.
ReadOnlyPaths = "/nix/store /run/dbus";
# Let systemd manage `/var/lib/matter-server` for us inside the
# ephemeral TemporaryFileSystem.
StateDirectory = storageDir;
# `python-matter-server` writes to /data even when a storage-path is
# specified. This bind-mount points /data at the systemd-managed
# /var/lib/matter-server, so all files get dropped into the state
# directory.
BindPaths = "${storagePath}:/data";

# Hardening bits
AmbientCapabilities = "";
CapabilityBoundingSet = "";
DevicePolicy = "closed";
DynamicUser = true;
LockPersonality = true;
MemoryDenyWriteExecute = true;
NoNewPrivileges = true;
PrivateDevices = true;
PrivateTmp = true;
PrivateUsers = true;
ProcSubset = "pid";
ProtectClock = true;
ProtectControlGroups = true;
ProtectHome = true;
ProtectHostname = true;
ProtectKernelLogs = true;
ProtectKernelModules = true;
ProtectKernelTunables = true;
ProtectProc = "invisible";
RestrictAddressFamilies = [
"AF_INET"
"AF_INET6"
"AF_NETLINK"
];
RestrictNamespaces = true;
RestrictRealtime = true;
RestrictSUIDSGID = true;
SystemCallFilter = concatStringsSep " " [
"~" # Blocklist
"@clock"
"@cpu-emulation"
"@debug"
"@module"
"@mount"
"@obsolete"
"@privileged"
"@raw-io"
"@reboot"
"@resources"
"@swap"
];
UMask = "0077";
};
};
};
}

10 changes: 10 additions & 0 deletions nixos/modules/services/misc/docker-registry.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ in {
type = types.port;
};

openFirewall = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc "Opens the port used by the firewall.";
};

storagePath = mkOption {
type = types.nullOr types.path;
default = "/var/lib/docker-registry";
Expand Down Expand Up @@ -154,5 +160,9 @@ in {
isSystemUser = true;
};
users.groups.docker-registry = {};

networking.firewall = mkIf cfg.openFirewall {
allowedTCPPorts = [ cfg.port ];
};
};
}
Loading

0 comments on commit 38eff76

Please sign in to comment.