Skip to content

Commit 145ffdd

Browse files
Merge master into staging-next
2 parents 7e4d482 + 5505316 commit 145ffdd

60 files changed

Lines changed: 1540 additions & 641 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

maintainers/maintainer-list.nix

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3276,6 +3276,13 @@
32763276
githubId = 355401;
32773277
name = "Brian Hicks";
32783278
};
3279+
brianmay = {
3280+
name = "Brian May";
3281+
email = "brian@linuxpenguins.xyz";
3282+
github = "brianmay";
3283+
githubId = 112729;
3284+
keys = [ { fingerprint = "D636 5126 A92D B560 C627 ACED 1784 577F 811F 6EAC"; } ];
3285+
};
32793286
brianmcgee = {
32803287
name = "Brian McGee";
32813288
email = "brian@41north.dev";
@@ -13662,6 +13669,12 @@
1366213669
githubId = 34819524;
1366313670
name = "Marcel";
1366413671
};
13672+
MarchCraft = {
13673+
email = "felix@dienilles.de";
13674+
github = "MarchCraft";
13675+
githubId = 30194994;
13676+
name = "Felix Nilles";
13677+
};
1366513678
marcovergueira = {
1366613679
email = "vergueira.marco@gmail.com";
1366713680
github = "marcovergueira";
@@ -20424,6 +20437,12 @@
2042420437
name = "夜坂雅";
2042520438
keys = [ { fingerprint = "3237 D49E 8F81 5A45 2133 64EA 4FF3 5790 F405 53A9"; } ];
2042620439
};
20440+
shadows_withal = {
20441+
email = "shadows@with.al";
20442+
github = "shadows-withal";
20443+
githubId = 6445316;
20444+
name = "liv";
20445+
};
2042720446
shahrukh330 = {
2042820447
email = "shahrukh330@gmail.com";
2042920448
github = "shahrukh330";

nixos/doc/manual/development/running-nixos-tests-interactively.section.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ $ ./result/bin/nixos-test-driver
1010
>>>
1111
```
1212

13+
::: {.note}
14+
By executing the test driver in this way,
15+
the VMs executed may gain network & Internet access via their backdoor control interface,
16+
typically recognized as `eth0`.
17+
:::
18+
1319
You can then take any Python statement, e.g.
1420

1521
```py

nixos/doc/manual/release-notes/rl-2505.section.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747

4848
- [waagent](https://github.com/Azure/WALinuxAgent), the Microsoft Azure Linux Agent (waagent) manages Linux provisioning and VM interaction with the Azure Fabric Controller. Available with [services.waagent](options.html#opt-services.waagent.enable).
4949

50+
- [nostr-rs-relay](https://git.sr.ht/~gheartsfield/nostr-rs-relay/), This is a nostr relay, written in Rust. Available as [services.nostr-rs-relay](options.html#opt-services.nostr-rs-relay.enable).
51+
5052
- [mqtt-exporter](https://github.com/kpetremann/mqtt-exporter/), a Prometheus exporter for exposing messages from MQTT. Available as [services.prometheus.exporters.mqtt](#opt-services.prometheus.exporters.mqtt.enable).
5153

5254
- [Buffyboard](https://gitlab.postmarketos.org/postmarketOS/buffybox/-/tree/master/buffyboard), a framebuffer on-screen keyboard. Available as [services.buffyboard](option.html#opt-services.buffyboard).

nixos/modules/hardware/video/nvidia.nix

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,14 @@ in
274274
config.hardware.nvidia.open == true || lib.versionAtLeast config.hardware.nvidia.package.version "555"
275275
'';
276276
};
277+
278+
videoAcceleration =
279+
(lib.mkEnableOption ''
280+
Whether video acceleration (VA-API) should be enabled.
281+
'')
282+
// {
283+
default = true;
284+
};
277285
};
278286
};
279287

@@ -504,9 +512,7 @@ in
504512
"egl/egl_external_platform.d".source = "/run/opengl-driver/share/egl/egl_external_platform.d/";
505513
};
506514

507-
hardware.graphics = {
508-
extraPackages = [ pkgs.nvidia-vaapi-driver ];
509-
};
515+
hardware.graphics.extraPackages = lib.optional cfg.videoAcceleration pkgs.nvidia-vaapi-driver;
510516

511517
environment.systemPackages =
512518
lib.optional cfg.nvidiaSettings nvidia_x11.settings

nixos/modules/module-list.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,6 +1507,7 @@
15071507
./services/web-apps/nexus.nix
15081508
./services/web-apps/nifi.nix
15091509
./services/web-apps/node-red.nix
1510+
./services/web-apps/nostr-rs-relay.nix
15101511
./services/web-apps/ocis.nix
15111512
./services/web-apps/onlyoffice.nix
15121513
./services/web-apps/openvscode-server.nix

nixos/modules/services/cluster/kubernetes/kubelet.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,9 @@ in
345345
echo "Seeding container image: ${img}"
346346
${
347347
if (lib.hasSuffix "gz" img) then
348-
''${pkgs.gzip}/bin/zcat "${img}" | ${pkgs.containerd}/bin/ctr -n k8s.io image import --all-platforms -''
348+
''${pkgs.gzip}/bin/zcat "${img}" | ${pkgs.containerd}/bin/ctr -n k8s.io image import -''
349349
else
350-
''${pkgs.coreutils}/bin/cat "${img}" | ${pkgs.containerd}/bin/ctr -n k8s.io image import --all-platforms -''
350+
''${pkgs.coreutils}/bin/cat "${img}" | ${pkgs.containerd}/bin/ctr -n k8s.io image import -''
351351
}
352352
'') cfg.seedDockerImages}
353353

nixos/modules/services/hardware/udev.nix

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,9 @@ let
162162
'';
163163

164164
compressFirmware = firmware:
165-
let
166-
inherit (config.boot.kernelPackages) kernelAtLeast;
167-
in
168-
if ! (firmware.compressFirmware or true) then
169-
firmware
170-
else
171-
if kernelAtLeast "5.19" then pkgs.compressFirmwareZstd firmware
172-
else if kernelAtLeast "5.3" then pkgs.compressFirmwareXz firmware
173-
else firmware;
165+
if config.hardware.firmwareCompression == "none" || (firmware.compressFirmware or false) == false then firmware
166+
else if config.hardware.firmwareCompression == "zstd" then pkgs.compressFirmwareZstd firmware
167+
else pkgs.compressFirmwareXz firmware;
174168

175169
# Udev has a 512-character limit for ENV{PATH}, so create a symlink
176170
# tree to work around this.
@@ -279,6 +273,21 @@ in
279273
};
280274
};
281275

276+
hardware.firmwareCompression = lib.mkOption {
277+
type = lib.types.enum [ "xz" "zstd" "none" ];
278+
default = if config.boot.kernelPackages.kernelAtLeast "5.19" then "zstd"
279+
else if config.boot.kernelPackages.kernelAtLeast "5.3" then "xz"
280+
else "none";
281+
defaultText = "auto";
282+
description = ''
283+
Whether to compress firmware files.
284+
Defaults depend on the kernel version.
285+
For kernels older than 5.3, firmware files are not compressed.
286+
For kernels 5.3 and newer, firmware files are compressed with xz.
287+
For kernels 5.19 and newer, firmware files are compressed with zstd.
288+
'';
289+
};
290+
282291
networking.usePredictableInterfaceNames = lib.mkOption {
283292
default = true;
284293
type = lib.types.bool;
@@ -346,6 +355,23 @@ in
346355

347356
config = lib.mkIf cfg.enable {
348357

358+
assertions = [
359+
{
360+
assertion = config.hardware.firmwareCompression == "zstd" -> config.boot.kernelPackages.kernelAtLeast "5.19";
361+
message = ''
362+
The firmware compression method is set to zstd, but the kernel version is too old.
363+
The kernel version must be at least 5.3 to use zstd compression.
364+
'';
365+
}
366+
{
367+
assertion = config.hardware.firmwareCompression == "xz" -> config.boot.kernelPackages.kernelAtLeast "5.3";
368+
message = ''
369+
The firmware compression method is set to xz, but the kernel version is too old.
370+
The kernel version must be at least 5.3 to use xz compression.
371+
'';
372+
}
373+
];
374+
349375
services.udev.extraRules = nixosRules;
350376

351377
services.udev.packages = [ extraUdevRules extraHwdbFile ];

nixos/modules/services/misc/paperless.nix

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,7 @@ let
7070
ProtectKernelModules = true;
7171
ProtectKernelTunables = true;
7272
ProtectProc = "invisible";
73-
# Don't restrict ProcSubset because django-q requires read access to /proc/stat
74-
# to query CPU and memory information.
75-
# Note that /proc only contains processes of user `paperless`, so this is safe.
76-
# ProcSubset = "pid";
73+
ProcSubset = "pid";
7774
RestrictAddressFamilies = [ "AF_UNIX" "AF_INET" "AF_INET6" ];
7875
RestrictNamespaces = true;
7976
RestrictRealtime = true;

nixos/modules/services/networking/hickory-dns.nix

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ let
33
cfg = config.services.hickory-dns;
44
toml = pkgs.formats.toml { };
55

6-
configFile = toml.generate "hickory-dns.toml" (
7-
lib.filterAttrsRecursive (_: v: v != null) cfg.settings
8-
);
9-
106
zoneType = lib.types.submodule ({ config, ... }: {
7+
freeformType = toml.type;
118
options = with lib; {
129
zone = mkOption {
1310
type = types.str;
@@ -82,6 +79,22 @@ in
8279
If neither `quiet` nor `debug` are enabled, logging defaults to the INFO level.
8380
'';
8481
};
82+
configFile = mkOption {
83+
type = types.path;
84+
default = toml.generate "hickory-dns.toml" (
85+
lib.filterAttrsRecursive (_: v: v != null) cfg.settings
86+
);
87+
defaultText = lib.literalExpression ''
88+
let toml = pkgs.formats.toml { }; in toml.generate "hickory-dns.toml" cfg.settings
89+
'';
90+
description = ''
91+
Path to an existing toml file to configure hickory-dns with.
92+
93+
This can usually be left unspecified, in which case it will be
94+
generated from the values in `settings`.
95+
If manually specified, then the options in `settings` are ignored.
96+
'';
97+
};
8598
settings = mkOption {
8699
description = ''
87100
Settings for hickory-dns. The options enumerated here are not exhaustive.
@@ -142,7 +155,7 @@ in
142155
flags = (lib.optional cfg.debug "--debug") ++ (lib.optional cfg.quiet "--quiet");
143156
flagsStr = builtins.concatStringsSep " " flags;
144157
in ''
145-
${lib.getExe cfg.package} --config ${configFile} ${flagsStr}
158+
${lib.getExe cfg.package} --config ${cfg.configFile} ${flagsStr}
146159
'';
147160
Type = "simple";
148161
Restart = "on-failure";
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{
2+
config,
3+
pkgs,
4+
lib,
5+
...
6+
}:
7+
let
8+
cfg = config.services.nostr-rs-relay;
9+
settingsFormat = pkgs.formats.toml { };
10+
configFile = settingsFormat.generate "config.toml" (
11+
cfg.settings
12+
// {
13+
database = {
14+
data_directory = config.services.nostr-rs-relay.dataDir;
15+
};
16+
network = {
17+
port = config.services.nostr-rs-relay.port;
18+
};
19+
}
20+
);
21+
in
22+
{
23+
options.services.nostr-rs-relay = {
24+
enable = lib.mkEnableOption "nostr-rs-relay";
25+
26+
package = lib.mkPackageOption pkgs "nostr-rs-relay" { };
27+
28+
port = lib.mkOption {
29+
default = 12849;
30+
type = lib.types.port;
31+
description = "Listen on this port.";
32+
};
33+
34+
dataDir = lib.mkOption {
35+
type = lib.types.path;
36+
default = "/var/lib/nostr-rs-relay";
37+
description = "Directory for SQLite files.";
38+
};
39+
40+
settings = lib.mkOption {
41+
inherit (settingsFormat) type;
42+
default = { };
43+
description = "See https://git.sr.ht/~gheartsfield/nostr-rs-relay/#configuration for documentation.";
44+
};
45+
};
46+
47+
config = lib.mkIf cfg.enable {
48+
systemd.services.nostr-rs-relay = {
49+
description = "nostr-rs-relay";
50+
wants = [ "network.target" ];
51+
wantedBy = [ "multi-user.target" ];
52+
53+
serviceConfig = {
54+
ExecStart = "${cfg.package}/bin/nostr-rs-relay --config ${configFile}";
55+
DynamicUser = true;
56+
Restart = "on-failure";
57+
Type = "simple";
58+
59+
ReadWritePaths = [ cfg.dataDir ];
60+
61+
RuntimeDirectory = "nostr-rs-relay";
62+
StateDirectory = "nostr-rs-relay";
63+
64+
PrivateTmp = true;
65+
PrivateUsers = true;
66+
PrivateDevices = true;
67+
ProtectSystem = "strict";
68+
ProtectHome = true;
69+
NoNewPrivileges = true;
70+
MemoryDenyWriteExecute = true;
71+
ProtectKernelTunables = true;
72+
ProtectKernelModules = true;
73+
ProtectKernelLogs = true;
74+
ProtectClock = true;
75+
ProtectProc = "invisible";
76+
ProcSubset = "pid";
77+
ProtectControlGroups = true;
78+
LockPersonality = true;
79+
RestrictSUIDSGID = true;
80+
RemoveIPC = true;
81+
RestrictRealtime = true;
82+
ProtectHostname = true;
83+
CapabilityBoundingSet = "";
84+
SystemCallFilter = [
85+
"@system-service"
86+
];
87+
SystemCallArchitectures = "native";
88+
};
89+
};
90+
};
91+
92+
meta.maintainers = with lib.maintainers; [
93+
felixzieger
94+
jb55
95+
];
96+
}

0 commit comments

Comments
 (0)