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 Feb 28, 2024
2 parents 6f731c3 + 5d1b96e commit f3c1e18
Show file tree
Hide file tree
Showing 255 changed files with 6,278 additions and 2,599 deletions.
8 changes: 8 additions & 0 deletions lib/meta.nix
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ rec {
We can inject these into a pattern for the whole of a structured platform,
and then match that.
Example:
lib.meta.platformMatch { system = "aarch64-darwin"; } "aarch64-darwin"
=> true
*/
platformMatch = platform: elem: (
# Check with simple string comparison if elem was a string.
Expand All @@ -112,6 +116,10 @@ rec {
platform, or `meta.platforms` is not present.
2. None of `meta.badPlatforms` pattern matches the given platform.
Example:
lib.meta.availableOn { system = "aarch64-darwin"; } pkg.zsh
=> true
*/
availableOn = platform: pkg:
((!pkg?meta.platforms) || any (platformMatch platform) pkg.meta.platforms) &&
Expand Down
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7606,6 +7606,12 @@
githubId = 287769;
name = "Sergii Paryzhskyi";
};
heijligen = {
email = "[email protected]";
github = "heijligen";
githubId = 19170376;
name = "Thomas Heijligen";
};
heisfer = {
email = "[email protected]";
github = "heisfer";
Expand Down
6 changes: 5 additions & 1 deletion nixos/doc/manual/release-notes/rl-2405.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ In addition to numerous new and upgraded packages, this release has the followin

- `linuxPackages_testing_bcachefs` is now fully deprecated by `linuxPackages_latest`, and is therefore no longer available.

- The default kernel package has been updated from 6.1 to 6.6. All supported kernels remain available.

- NixOS now installs a stub ELF loader that prints an informative error message when users attempt to run binaries not made for NixOS.
- This can be disabled through the `environment.stub-ld.enable` option.
- If you use `programs.nix-ld.enable`, no changes are needed. The stub will be disabled automatically.
Expand Down Expand Up @@ -85,6 +87,8 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m

- [go-camo](https://github.com/cactus/go-camo), a secure image proxy server. Available as [services.go-camo](#opt-services.go-camo.enable).

- [Monado](https://monado.freedesktop.org/), an open source XR runtime. Available as [services.monado](#opt-services.monado.enable).

- [Clevis](https://github.com/latchset/clevis), a pluggable framework for automated decryption, used to unlock encrypted devices in initrd. Available as [boot.initrd.clevis.enable](#opt-boot.initrd.clevis.enable).

- [TuxClocker](https://github.com/Lurkki14/tuxclocker), a hardware control and monitoring program. Available as [programs.tuxclocker](#opt-programs.tuxclocker.enable).
Expand All @@ -103,7 +107,7 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m

<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->

- `himalaya` was updated to v1.0.0-beta, which introduces breaking changes. Check out the [release note](https://github.com/soywod/himalaya/releases/tag/v1.0.0-beta) for details.
- `himalaya` was updated to `v1.0.0-beta.3`, which introduces breaking changes. Check out the [release note](https://github.com/soywod/himalaya/releases/tag/v1.0.0-beta.3) for details.

- The `power.ups` module now generates `upsd.conf`, `upsd.users` and `upsmon.conf` automatically from a set of new configuration options. This breaks compatibility with existing `power.ups` setups where these files were created manually. Back up these files before upgrading NixOS.

Expand Down
6 changes: 5 additions & 1 deletion nixos/lib/testing/nixos-test-base.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ in
# The human version (e.g. 21.05-pre) is left as is, because it is useful
# for external modules that test with e.g. testers.nixosTest and rely on that
# version number.
config.system.nixos.revision = mkForce "constant-nixos-revision";
config.system.nixos = {
revision = mkForce "constant-nixos-revision";
versionSuffix = mkForce "test";
label = mkForce "test";
};
}

];
Expand Down
19 changes: 6 additions & 13 deletions nixos/modules/installer/netboot/netboot.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,12 @@ with lib;
};

fileSystems."/nix/store" = mkImageMediaOverride
{ fsType = "overlay";
device = "overlay";
options = [
"lowerdir=/nix/.ro-store"
"upperdir=/nix/.rw-store/store"
"workdir=/nix/.rw-store/work"
];

depends = [
"/nix/.ro-store"
"/nix/.rw-store/store"
"/nix/.rw-store/work"
];
{ overlay = {
lowerdir = [ "/nix/.ro-store" ];
upperdir = "/nix/.rw-store/store";
workdir = "/nix/.rw-store/work";
};
neededForBoot = true;
};

boot.initrd.availableKernelModules = [ "squashfs" "overlay" ];
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@
./services/hardware/lcd.nix
./services/hardware/lirc.nix
./services/hardware/nvidia-container-toolkit-cdi-generator
./services/hardware/monado.nix
./services/hardware/nvidia-optimus.nix
./services/hardware/openrgb.nix
./services/hardware/pcscd.nix
Expand Down
102 changes: 102 additions & 0 deletions nixos/modules/services/hardware/monado.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{ config
, lib
, pkgs
, ...
}:
let
inherit (lib) mkDefault mkEnableOption mkIf mkOption mkPackageOption types;

cfg = config.services.monado;

in
{
options.services.monado = {
enable = mkEnableOption "Monado user service";

package = mkPackageOption pkgs "monado" { };

defaultRuntime = mkOption {
type = types.bool;
description = ''
Whether to enable Monado as the default OpenXR runtime on the system.
Note that applications can bypass this option by setting an active
runtime in a writable XDG_CONFIG_DIRS location like `~/.config`.
'';
default = false;
example = true;
};

highPriority = mkEnableOption "high priority capability for monado-service"
// mkOption { default = true; };
};

config = mkIf cfg.enable {
security.wrappers."monado-service" = mkIf cfg.highPriority {
setuid = false;
owner = "root";
group = "root";
# cap_sys_nice needed for asynchronous reprojection
capabilities = "cap_sys_nice+eip";
source = lib.getExe' cfg.package "monado-service";
};

services.udev.packages = with pkgs; [ xr-hardware ];

systemd.user = {
services.monado = {
description = "Monado XR runtime service module";
requires = [ "monado.socket" ];
conflicts = [ "monado-dev.service" ];

unitConfig.ConditionUser = "!root";

environment = {
# Default options
# https://gitlab.freedesktop.org/monado/monado/-/blob/4548e1738591d0904f8db4df8ede652ece889a76/src/xrt/targets/service/monado.in.service#L12
XRT_COMPOSITOR_LOG = mkDefault "debug";
XRT_PRINT_OPTIONS = mkDefault "on";
IPC_EXIT_ON_DISCONNECT = mkDefault "off";
};

serviceConfig = {
ExecStart =
if cfg.highPriority
then "${config.security.wrapperDir}/monado-service"
else lib.getExe' cfg.package "monado-service";
Restart = "no";
};

restartTriggers = [ cfg.package ];
};

sockets.monado = {
description = "Monado XR service module connection socket";
conflicts = [ "monado-dev.service" ];

unitConfig.ConditionUser = "!root";

socketConfig = {
ListenStream = "%t/monado_comp_ipc";
RemoveOnStop = true;

# If Monado crashes while starting up, we want to close incoming OpenXR connections
FlushPending = true;
};

restartTriggers = [ cfg.package ];

wantedBy = [ "sockets.target" ];
};
};

environment.systemPackages = [ cfg.package ];
environment.pathsToLink = [ "/share/openxr" ];

environment.etc."xdg/openxr/1/active_runtime.json" = mkIf cfg.defaultRuntime {
source = "${cfg.package}/share/openxr/1/openxr_monado.json";
};
};

meta.maintainers = with lib.maintainers; [ Scrumplex ];
}
15 changes: 14 additions & 1 deletion nixos/modules/services/monitoring/prometheus/exporters/nut.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ in
provisioned outside of Nix store.
'';
};
nutVariables = mkOption {
type = types.listOf types.str;
default = [ ];
description = ''
List of NUT variable names to monitor.
If no variables are set, all numeric variables will be exported automatically.
See the [upstream docs](https://github.com/DRuggeri/nut_exporter?tab=readme-ov-file#variables-and-information)
for more information.
'';
};
};
serviceOpts = {
script = ''
Expand All @@ -44,7 +55,9 @@ in
${pkgs.prometheus-nut-exporter}/bin/nut_exporter \
--nut.server=${cfg.nutServer} \
--web.listen-address="${cfg.listenAddress}:${toString cfg.port}" \
${optionalString (cfg.nutUser != "") "--nut.username=${cfg.nutUser}"}
${optionalString (cfg.nutUser != "") "--nut.username=${cfg.nutUser}"} \
${optionalString (cfg.nutVariables != []) "--nut.vars_enable=${concatStringsSep "," cfg.nutVariables}"} \
${concatStringsSep " " cfg.extraFlags}
'';
};
}
32 changes: 19 additions & 13 deletions nixos/modules/services/networking/dhcpcd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ let
enableDHCP = config.networking.dhcpcd.enable &&
(config.networking.useDHCP || any (i: i.useDHCP == true) interfaces);

enableNTPService = (config.services.ntp.enable || config.services.ntpd-rs.enable || config.services.openntpd.enable || config.services.chrony.enable);

# Don't start dhcpcd on explicitly configured interfaces or on
# interfaces that are part of a bridge, bond or sit device.
ignoredInterfaces =
Expand Down Expand Up @@ -89,20 +91,22 @@ let
${cfg.extraConfig}
'';

exitHook = pkgs.writeText "dhcpcd.exit-hook"
''
exitHook = pkgs.writeText "dhcpcd.exit-hook" ''
${optionalString enableNTPService ''
if [ "$reason" = BOUND -o "$reason" = REBOOT ]; then
# Restart ntpd. We need to restart it to make sure that it
# will actually do something: if ntpd cannot resolve the
# server hostnames in its config file, then it will never do
# anything ever again ("couldn't resolve ..., giving up on
# it"), so we silently lose time synchronisation. This also
# applies to openntpd.
/run/current-system/systemd/bin/systemctl try-reload-or-restart ntpd.service openntpd.service chronyd.service ntpd-rs.service || true
# Restart ntpd. We need to restart it to make sure that it will actually do something:
# if ntpd cannot resolve the server hostnames in its config file, then it will never do
# anything ever again ("couldn't resolve ..., giving up on it"), so we silently lose
# time synchronisation. This also applies to openntpd.
${optionalString config.services.ntp.enable "/run/current-system/systemd/bin/systemctl try-reload-or-restart ntpd.service || true"}
${optionalString config.services.ntpd-rs.enable "/run/current-system/systemd/bin/systemctl try-reload-or-restart ntpd-rs.service || true"}
${optionalString config.services.openntpd.enable "/run/current-system/systemd/bin/systemctl try-reload-or-restart openntpd.service || true"}
${optionalString config.services.chrony.enable "/run/current-system/systemd/bin/systemctl try-reload-or-restart chronyd.service || true"}
fi
''}
${cfg.runHook}
'';
${cfg.runHook}
'';

in

Expand Down Expand Up @@ -232,7 +236,7 @@ in
wants = [ "network.target" ];
before = [ "network-online.target" ];

restartTriggers = [ exitHook ];
restartTriggers = optional (enableNTPService || cfg.runHook != "") [ exitHook ];

# Stopping dhcpcd during a reconfiguration is undesirable
# because it brings down the network interfaces configured by
Expand Down Expand Up @@ -261,7 +265,9 @@ in

environment.systemPackages = [ dhcpcd ];

environment.etc."dhcpcd.exit-hook".source = exitHook;
environment.etc."dhcpcd.exit-hook" = mkIf (enableNTPService || cfg.runHook != "") {
source = exitHook;
};

powerManagement.resumeCommands = mkIf config.systemd.services.dhcpcd.enable
''
Expand Down
4 changes: 4 additions & 0 deletions nixos/modules/system/boot/plymouth.nix
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ in
# module might come from a theme
cp ${themesEnv}/lib/plymouth/*.so $out
cp ${plymouth}/lib/plymouth/renderers/*.so $out/renderers
# useless in the initrd, and adds several megabytes to the closure
rm $out/renderers/x11.so
'';
"/etc/plymouth/themes".source = pkgs.runCommand "plymouth-initrd-themes" {} ''
# Check if the actual requested theme is here
Expand Down Expand Up @@ -271,6 +273,8 @@ in
# module might come from a theme
cp ${themesEnv}/lib/plymouth/*.so $out/lib/plymouth
cp ${plymouth}/lib/plymouth/renderers/*.so $out/lib/plymouth/renderers
# useless in the initrd, and adds several megabytes to the closure
rm $out/lib/plymouth/renderers/x11.so
mkdir -p $out/share/plymouth/themes
cp ${plymouth}/share/plymouth/plymouthd.defaults $out/share/plymouth
Expand Down
6 changes: 4 additions & 2 deletions nixos/modules/tasks/filesystems/zfs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,9 @@ in
kernelParams = lib.optionals (!config.boot.zfs.allowHibernation) [ "nohibernate" ];

extraModulePackages = [
(cfgZfs.modulePackage.override { inherit (cfgZfs) removeLinuxDRM; })
(cfgZfs.modulePackage.override
(lib.optionalAttrs (lib.versionOlder cfgZfs.package.version "2.2.3")
{ inherit (cfgZfs) removeLinuxDRM; }))
];
};

Expand Down Expand Up @@ -731,7 +733,7 @@ in
# this symbol.
# In the meantime, we restore what was once a working piece of code
# in the kernel.
boot.kernelPatches = lib.optional (cfgZfs.removeLinuxDRM && pkgs.stdenv.hostPlatform.system == "aarch64-linux") {
boot.kernelPatches = lib.optional (lib.versionOlder cfgZfs.package.version "2.2.3" && cfgZfs.removeLinuxDRM && pkgs.stdenv.hostPlatform.system == "aarch64-linux") {
name = "export-neon-symbols-as-gpl";
patch = pkgs.fetchpatch {
url = "https://github.com/torvalds/linux/commit/aaeca98456431a8d9382ecf48ac4843e252c07b3.patch";
Expand Down
1 change: 0 additions & 1 deletion nixos/release-combined.nix
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ in rec {
(onFullSupported "nixos.tests.networking.networkd.virtual")
(onFullSupported "nixos.tests.networking.networkd.vlan")
(onFullSupported "nixos.tests.systemd-networkd-ipv6-prefix-delegation")
(onFullSupported "nixos.tests.nfs3.simple")
(onFullSupported "nixos.tests.nfs4.simple")
(onSystems ["x86_64-linux"] "nixos.tests.oci-containers.podman")
(onFullSupported "nixos.tests.openssh")
Expand Down
4 changes: 2 additions & 2 deletions nixos/release-small.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ in rec {
login
misc
nat
nfs3
nfs4
openssh
php
predictable-interface-names
Expand Down Expand Up @@ -125,7 +125,7 @@ in rec {
"nixos.tests.misc"
"nixos.tests.nat.firewall"
"nixos.tests.nat.standalone"
"nixos.tests.nfs3.simple"
"nixos.tests.nfs4.simple"
"nixos.tests.openssh"
"nixos.tests.php.fpm"
"nixos.tests.php.pcre"
Expand Down
1 change: 1 addition & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ in {
mobilizon = handleTest ./mobilizon.nix {};
mod_perl = handleTest ./mod_perl.nix {};
molly-brown = handleTest ./molly-brown.nix {};
monado = handleTest ./monado.nix {};
monica = handleTest ./web-apps/monica.nix {};
mongodb = handleTest ./mongodb.nix {};
moodle = handleTest ./moodle.nix {};
Expand Down
5 changes: 5 additions & 0 deletions nixos/tests/k3s/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ let
allK3s = lib.filterAttrs (n: _: lib.strings.hasPrefix "k3s_" n) pkgs;
in
{
# Testing K3s with Etcd backend
etcd = lib.mapAttrs (_: k3s: import ./etcd.nix {
inherit system pkgs k3s;
inherit (pkgs) etcd;
}) allK3s;
# Run a single node k3s cluster and verify a pod can run
single-node = lib.mapAttrs (_: k3s: import ./single-node.nix { inherit system pkgs k3s; }) allK3s;
# Run a multi-node k3s cluster and verify pod networking works across nodes
Expand Down
Loading

0 comments on commit f3c1e18

Please sign in to comment.