Merge staging-next into staging

This commit is contained in:
github-actions[bot]
2024-11-23 06:05:56 +00:00
committed by GitHub
45 changed files with 434 additions and 10088 deletions
@@ -444,6 +444,9 @@
- `gitea` no longer supports the opt-in feature [PAM (Pluggable Authentication Module)](https://docs.gitea.com/usage/authentication#pam-pluggable-authentication-module).
- `vuze` was removed because it is unmaintained upstream and insecure (CVE-2018-13417).
BiglyBT is a maintained fork.
- `services.ddclient.use` has been deprecated: `ddclient` now supports separate IPv4 and IPv6 configuration. Use `services.ddclient.usev4` and `services.ddclient.usev6` instead.
- `services.pgbouncer` systemd service is now configured with `Type=notify-reload` and allows reloading configuration without process restart. PgBouncer configuration options were moved to the freeform type option under [`services.pgbouncer.settings`](#opt-services.pgbouncer.settings).
+1
View File
@@ -1621,6 +1621,7 @@
./services/x11/xserver.nix
./system/activation/activatable-system.nix
./system/activation/activation-script.nix
./system/activation/pre-switch-check.nix
./system/activation/specialisation.nix
./system/activation/switchable-system.nix
./system/activation/bootspec.nix
+2 -2
View File
@@ -24,10 +24,10 @@ in
type = lib.types.package;
default = pkgs.scx.full;
defaultText = lib.literalExpression "pkgs.scx.full";
example = lib.literalExpression "pkgs.scx.rustland";
example = lib.literalExpression "pkgs.scx.rustscheds";
description = ''
`scx` package to use. `scx.full`, which includes all schedulers, is the default.
You may choose a minimal package, such as `pkgs.scx.rustland`, if only one specific scheduler is needed.
You may choose a minimal package, such as `pkgs.scx.rustscheds`.
::: {.note}
Overriding this does not change the default scheduler; you should set `services.scx.scheduler` for it.
@@ -0,0 +1,44 @@
{ lib, pkgs, ... }:
let
preSwitchCheckScript =
set:
lib.concatLines (
lib.mapAttrsToList (name: text: ''
# pre-switch check ${name}
(
${text}
)
if [[ $? != 0 ]]; then
echo "Pre-switch check '${name}' failed"
exit 1
fi
'') set
);
in
{
options.system.preSwitchChecks = lib.mkOption {
default = { };
example = lib.literalExpression ''
{ failsEveryTime =
'''
false
''';
}
'';
description = ''
A set of shell script fragments that are executed before the switch to a
new NixOS system configuration. A failure in any of these fragments will
cause the switch to fail and exit early.
'';
type = lib.types.attrsOf lib.types.str;
apply =
set:
set
// {
script = pkgs.writeShellScript "pre-switch-checks" (preSwitchCheckScript set);
};
};
}
@@ -78,10 +78,11 @@ if ("@localeArchive@" ne "") {
$ENV{LOCALE_ARCHIVE} = "@localeArchive@";
}
if (!defined($action) || ($action ne "switch" && $action ne "boot" && $action ne "test" && $action ne "dry-activate")) {
if (!defined($action) || ($action ne "switch" && $action ne "boot" && $action ne "test" && $action ne "dry-activate" && $action ne "check")) {
print STDERR <<"EOF";
Usage: $0 [switch|boot|test|dry-activate]
Usage: $0 [check|switch|boot|test|dry-activate]
check: run pre-switch checks and exit
switch: make the configuration the boot default and activate now
boot: make the configuration the boot default
test: activate the configuration, but don\'t make it the boot default
@@ -101,6 +102,17 @@ open(my $stc_lock, '>>', '/run/nixos/switch-to-configuration.lock') or die "Coul
flock($stc_lock, LOCK_EX) or die "Could not acquire lock - $!";
openlog("nixos", "", LOG_USER);
# run pre-switch checks
if (($ENV{"NIXOS_NO_CHECK"} // "") ne "1") {
chomp(my $pre_switch_checks = <<'EOFCHECKS');
@preSwitchCheck@
EOFCHECKS
system("$pre_switch_checks $out") == 0 or exit 1;
if ($action eq "check") {
exit 0;
}
}
# Install or update the bootloader.
if ($action eq "switch" || $action eq "boot") {
chomp(my $install_boot_loader = <<'EOFBOOTLOADER');
@@ -61,6 +61,7 @@ in
--subst-var-by coreutils "${pkgs.coreutils}" \
--subst-var-by distroId ${lib.escapeShellArg config.system.nixos.distroId} \
--subst-var-by installBootLoader ${lib.escapeShellArg config.system.build.installBootLoader} \
--subst-var-by preSwitchCheck ${lib.escapeShellArg config.system.preSwitchChecks.script} \
--subst-var-by localeArchive "${config.i18n.glibcLocales}/lib/locale/locale-archive" \
--subst-var-by perl "${perlWrapped}" \
--subst-var-by shell "${pkgs.bash}/bin/sh" \
@@ -93,6 +94,7 @@ in
--set TOPLEVEL ''${!toplevelVar} \
--set DISTRO_ID ${lib.escapeShellArg config.system.nixos.distroId} \
--set INSTALL_BOOTLOADER ${lib.escapeShellArg config.system.build.installBootLoader} \
--set PRE_SWITCH_CHECK ${lib.escapeShellArg config.system.preSwitchChecks.script} \
--set LOCALE_ARCHIVE ${config.i18n.glibcLocales}/lib/locale/locale-archive \
--set SYSTEMD ${config.systemd.package}
)
@@ -342,6 +342,7 @@ in
perl = pkgs.perl.withPackages (p: with p; [ ConfigIniFiles FileSlurp ]);
# End if legacy environment variables
preSwitchCheck = config.system.preSwitchChecks.script;
# Not actually used in the builder. `passedChecks` is just here to create
# the build dependencies. Checks are similar to build dependencies in the
+9
View File
@@ -612,6 +612,10 @@ in {
other = {
system.switch.enable = true;
users.mutableUsers = true;
specialisation.failingCheck.configuration.system.preSwitchChecks.failEveryTime = ''
echo this will fail
false
'';
};
};
@@ -684,6 +688,11 @@ in {
boot_loader_text = "Warning: do not know how to make this configuration bootable; please enable a boot loader."
with subtest("pre-switch checks"):
machine.succeed("${stderrRunner} ${otherSystem}/bin/switch-to-configuration check")
out = switch_to_specialisation("${otherSystem}", "failingCheck", action="check", fail=True)
assert_contains(out, "this will fail")
with subtest("actions"):
# boot action
out = switch_to_specialisation("${machine}", "simpleService", action="boot")
@@ -633,13 +633,13 @@
"vendorHash": null
},
"ibm": {
"hash": "sha256-GhQ6ao37GUzryuqOIddZiLNAZWoTOQ0HuSp9ROHxMaI=",
"hash": "sha256-ZjsQBqn0faSqgSrdV4G+18XD1ZpCd3zRt5I1zQ3MWoQ=",
"homepage": "https://registry.terraform.io/providers/IBM-Cloud/ibm",
"owner": "IBM-Cloud",
"repo": "terraform-provider-ibm",
"rev": "v1.70.0",
"rev": "v1.71.2",
"spdx": "MPL-2.0",
"vendorHash": "sha256-4ELjuIe7cMSC79pO6UOaV4cnEKChCtBdJ8Q3vUNk9W8="
"vendorHash": "sha256-eYmxVdMbGT7aW9tfH9shgc/eIDfe41OdLOGrDuxivTY="
},
"icinga2": {
"hash": "sha256-Y/Oq0aTzP+oSKPhHiHY9Leal4HJJm7TNDpcdqkUsCmk=",
@@ -1,33 +0,0 @@
{ lib, stdenv, fetchsvn, jdk, jre, ant, swt, makeWrapper }:
stdenv.mkDerivation rec {
pname = "vuze";
version = "5750";
src = fetchsvn {
url = "http://svn.vuze.com/public/client/tags/RELEASE_${version}";
sha256 = "07w6ipyiy8hi88d6yxbbf3vkv26mj7dcz9yr8141hb2ig03v0h0p";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ jdk ant ];
buildPhase = "ant";
installPhase = ''
install -D dist/Vuze_0000-00.jar $out/share/java/Vuze_${version}-00.jar
makeWrapper ${jre}/bin/java $out/bin/vuze \
--add-flags "-Xmx256m -Djava.library.path=${swt}/lib -cp $out/share/java/Vuze_${version}-00.jar:${swt}/jars/swt.jar org.gudy.azureus2.ui.swt.Main"
'';
meta = with lib; {
description = "Torrent client";
homepage = "http://www.vuze.com";
license = licenses.unfree;
platforms = platforms.all;
maintainers = [ ];
# Doesn't launch, gives java related incompatibilities errors. Probably
# related to swt. Same error happens with swt_jdk8
broken = true;
};
}
+2 -2
View File
@@ -20,13 +20,13 @@
let self = python3.pkgs.buildPythonApplication rec {
pname = "duplicity";
version = "3.0.2";
version = "3.0.3.1";
src = fetchFromGitLab {
owner = "duplicity";
repo = "duplicity";
rev = "rel.${version}";
hash = "sha256-qY6J0t6mgrbEojlKxpVFfsVhffjrAxc8R9Z/Klrp7wE=";
hash = "sha256-s8yPmuGivvmqAKsdaGouP/UoK6Ea27HjvSm39eQuKF0=";
};
patches = [
+3 -3
View File
@@ -9,17 +9,17 @@ let
in buildGoModule rec {
pname = "go-ethereum";
version = "1.14.11";
version = "1.14.12";
src = fetchFromGitHub {
owner = "ethereum";
repo = pname;
rev = "v${version}";
hash = "sha256-y4tUV5TGhvvaLTukT0jVhoBWxXQlDFVKHScQC8Ytl/A=";
hash = "sha256-s1BSFTjqro3gFyKphU8FdpjViKyyZc0bt1m+lzkAcBU=";
};
proxyVendor = true;
vendorHash = "sha256-xPFTvzsHMWVyeAt7m++6v2l8m5ZvnLaIDGki/TWe5kU=";
vendorHash = "sha256-IEwy3XRyj+5GjAWRjPsd5qzwEMpI/pZIwPjKdeATgkE=";
doCheck = false;
+3 -2
View File
@@ -9,6 +9,7 @@
, gettext
, libxslt
, python3
, python3Packages
, docbook-xsl-nons
, docbook_xml_dtd_42
, libgcrypt
@@ -72,8 +73,8 @@ stdenv.mkDerivation rec {
nativeCheckInputs = [
python3
python3.pkgs.dbus-python
python3.pkgs.pygobject3
python3Packages.dbus-python
python3Packages.pygobject3
dbus
gjs
];
+2 -2
View File
@@ -15,8 +15,8 @@ stdenv.mkDerivation rec {
buildInputs = [ ncurses libressl ];
CFLAGS = lib.optionals stdenv.hostPlatform.isDarwin [
"-D_DARWIN_C_SOURCE"
makeFlags = lib.optionals stdenv.hostPlatform.isDarwin [
"OSCFLAGS=-D_DARWIN_C_SOURCE"
];
postPatch = ''
+2 -2
View File
@@ -11,13 +11,13 @@
}:
stdenv.mkDerivation rec {
pname = "sqlitestudio";
version = "3.4.4";
version = "3.4.5";
src = fetchFromGitHub {
owner = "pawelsalawa";
repo = "sqlitestudio";
rev = version;
hash = "sha256-5oBYv8WxyfVvvqr15XApvn6P/lBxR8b6E+2acRkvX0U=";
hash = "sha256-51gvjQULHI4MC+odsLPjK2n/9dIMrhq8S9R/uMGueXU=";
};
nativeBuildInputs =
@@ -79,6 +79,7 @@ const DRY_RELOAD_BY_ACTIVATION_LIST_FILE: &str = "/run/nixos/dry-activation-relo
#[derive(Debug, Clone, PartialEq)]
enum Action {
Switch,
Check,
Boot,
Test,
DryActivate,
@@ -93,6 +94,7 @@ impl std::str::FromStr for Action {
"boot" => Self::Boot,
"test" => Self::Test,
"dry-activate" => Self::DryActivate,
"check" => Self::Check,
_ => bail!("invalid action {s}"),
})
}
@@ -105,6 +107,7 @@ impl Into<&'static str> for &Action {
Action::Boot => "boot",
Action::Test => "test",
Action::DryActivate => "dry-activate",
Action::Check => "check",
}
}
}
@@ -129,6 +132,28 @@ fn parse_os_release() -> Result<HashMap<String, String>> {
}))
}
fn do_pre_switch_check(command: &str, toplevel: &Path) -> Result<()> {
let mut cmd_split = command.split_whitespace();
let Some(argv0) = cmd_split.next() else {
bail!("missing first argument in install bootloader commands");
};
match std::process::Command::new(argv0)
.args(cmd_split.collect::<Vec<&str>>())
.arg(toplevel)
.spawn()
.map(|mut child| child.wait())
{
Ok(Ok(status)) if status.success() => {}
_ => {
eprintln!("Pre-switch checks failed");
die()
}
}
Ok(())
}
fn do_install_bootloader(command: &str, toplevel: &Path) -> Result<()> {
let mut cmd_split = command.split_whitespace();
let Some(argv0) = cmd_split.next() else {
@@ -939,7 +964,8 @@ fn do_user_switch(parent_exe: String) -> anyhow::Result<()> {
fn usage(argv0: &str) -> ! {
eprintln!(
r#"Usage: {} [switch|boot|test|dry-activate]
r#"Usage: {} [check|switch|boot|test|dry-activate]
check: run pre-switch checks and exit
switch: make the configuration the boot default and activate now
boot: make the configuration the boot default
test: activate the configuration, but don't make it the boot default
@@ -955,6 +981,7 @@ fn do_system_switch(action: Action) -> anyhow::Result<()> {
let out = PathBuf::from(required_env("OUT")?);
let toplevel = PathBuf::from(required_env("TOPLEVEL")?);
let distro_id = required_env("DISTRO_ID")?;
let pre_switch_check = required_env("PRE_SWITCH_CHECK")?;
let install_bootloader = required_env("INSTALL_BOOTLOADER")?;
let locale_archive = required_env("LOCALE_ARCHIVE")?;
let new_systemd = PathBuf::from(required_env("SYSTEMD")?);
@@ -1013,6 +1040,18 @@ fn do_system_switch(action: Action) -> anyhow::Result<()> {
bail!("Failed to initialize logger");
}
if std::env::var("NIXOS_NO_CHECK")
.as_deref()
.unwrap_or_default()
!= "1"
{
do_pre_switch_check(&pre_switch_check, &toplevel)?;
}
if *action == Action::Check {
return Ok(());
}
// Install or update the bootloader.
if matches!(action, Action::Switch | Action::Boot) {
do_install_bootloader(&install_bootloader, &toplevel)?;
@@ -18,13 +18,13 @@
stdenv.mkDerivation rec {
pname = "sideload";
version = "6.2.2";
version = "6.3.0";
src = fetchFromGitHub {
owner = "elementary";
repo = pname;
rev = version;
sha256 = "sha256-7qwjZpEvB0eHIRsXv8jU7fVhbCIYI6tqJYmYvZR8oLo=";
sha256 = "sha256-2tYdcHx77XN2iu2PKXAKwOtb4TOFt3Igv17w2zIxqT4=";
};
nativeBuildInputs = [
@@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, nix-update-script
, meson
, ninja
@@ -32,6 +33,15 @@ stdenv.mkDerivation rec {
sha256 = "sha256-6b6nuOp4pEufHEmTraSfKpbtPuO3Z9hQJfvKuuyy7as=";
};
patches = [
# Fix build with fwupd 2.0.0
# https://github.com/elementary/switchboard-plug-about/pull/343
(fetchpatch {
url = "https://github.com/elementary/switchboard-plug-about/commit/6f8ba61cb3d82229e19358ede81b77f66dbb06a2.patch";
hash = "sha256-E9itq/KGzw36S1dAFoCowa/A2/f6Shx9F379nEIM2qI=";
})
];
nativeBuildInputs = [
meson
ninja
@@ -11,13 +11,13 @@
stdenvNoCC.mkDerivation rec {
pname = "elementary-gtk-theme";
version = "8.1.0";
version = "8.2.0";
src = fetchFromGitHub {
owner = "elementary";
repo = "stylesheet";
rev = version;
sha256 = "sha256-ZhqgvTbZN0lVAZ1nWy/Pvg7EdMYZIn8B5h1nmWo5E8E=";
sha256 = "sha256-l7E5o7JNqfJZzKpyvsjIVd2i9fwLh4Qn8oJ/S5RlFQ8=";
};
nativeBuildInputs = [
@@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, nix-update-script
, meson
, ninja
@@ -34,6 +35,15 @@ stdenv.mkDerivation rec {
sha256 = "sha256-w5dRQPRsM52wqusTLLPmKmVwoBFS+pHOokfDmCDxVWM=";
};
patches = [
# Fix build with fwupd 2.0.0
# https://github.com/elementary/settings-daemon/pull/169
(fetchpatch {
url = "https://github.com/elementary/settings-daemon/commit/f9f9e6c49ef89451ad45aa8314769a0358a5e481.patch";
hash = "sha256-zLONUqRwODK3JXaoymztEfOIJONJpwcTp5AWv0Vl+EI=";
})
];
nativeBuildInputs = [
desktop-file-utils
gobject-introspection
@@ -26,7 +26,7 @@
buildPythonPackage rec {
pname = "django-markup";
version = "1.9";
version = "1.9.1";
pyproject = true;
disabled = pythonOlder "3.8";
@@ -35,7 +35,7 @@ buildPythonPackage rec {
owner = "bartTC";
repo = "django-markup";
rev = "refs/tags/v${version}";
hash = "sha256-HSszXZ86hLxRgBZHIs1TA7F7MHLlS58oAhG50yrTquE=";
hash = "sha256-dj5Z36W4Stly203SKWpR/DF+Wf7+ejbZnDCmHNRb3c0=";
};
postPatch = ''
@@ -72,7 +72,7 @@ buildPythonPackage rec {
meta = with lib; {
description = "Generic Django application to convert text with specific markup to html";
homepage = "https://github.com/bartTC/django-markup";
changelog = "https://github.com/bartTC/django-markup/blob/v${version}/CHANGELOG.rst";
changelog = "https://github.com/bartTC/django-markup/blob/v${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ hexa ];
};
@@ -2,16 +2,22 @@
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
pythonOlder,
aiodns,
aiohttp,
aresponses,
poetry-core,
pytest-asyncio,
pytest-cov-stub,
pytest-freezer,
pytestCheckHook,
syrupy,
yarl,
}:
buildPythonPackage rec {
pname = "forecast-solar";
version = "3.1.0";
version = "4.0.0";
pyproject = true;
disabled = pythonOlder "3.11";
@@ -20,21 +26,42 @@ buildPythonPackage rec {
owner = "home-assistant-libs";
repo = "forecast_solar";
rev = "refs/tags/v${version}";
hash = "sha256-iol0XtfPZI95o/uEyBcXgeQjcfl2kI+4mugtywa6BXI=";
hash = "sha256-lWP4ZG195IuP8E9n53EkvdIs3aVTYeEc171Yh3EngOI=";
};
build-system = [ setuptools ];
build-system = [ poetry-core ];
env.PACKAGE_VERSION = version;
dependencies = [
aiodns
aiohttp
yarl
];
pythonImportsCheck = [ "forecast_solar" ];
nativeCheckInputs = [ pytestCheckHook ];
nativeCheckInputs = [
aresponses
pytest-asyncio
pytest-cov-stub
pytest-freezer
pytestCheckHook
syrupy
];
disabledTests = [
# "Error while resolving Forecast.Solar API address"
"test_api_key_validation"
"test_estimated_forecast"
"test_internal_session"
"test_json_request"
"test_plane_validation"
"test_status_400"
"test_status_401"
"test_status_422"
"test_status_429"
];
meta = with lib; {
changelog = "https://github.com/home-assistant-libs/forecast_solar/releases/tag/v${version}";
@@ -14,7 +14,7 @@
buildPythonPackage rec {
pname = "solarlog-cli";
version = "0.3.2";
version = "0.4.0";
pyproject = true;
disabled = pythonOlder "3.12";
@@ -23,7 +23,7 @@ buildPythonPackage rec {
owner = "dontinelli";
repo = "solarlog_cli";
rev = "refs/tags/v${version}";
hash = "sha256-Oa2o4fuchW3ROtQFVhiWL6rhdUbzSFDegCkm8W7bCpE=";
hash = "sha256-G7DZHFg0NH3rY/tbWpXDchYHkrvG8dUvINNxBIUKnzk=";
};
build-system = [ hatchling ];
@@ -0,0 +1,31 @@
diff --git a/Makefile.in b/Makefile.in
index d5c9fda..a596462 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -14,10 +14,7 @@ DUTI_BUILD_DATE=@build_date@
CC= @CC@
FRAMEWORKS= -framework ApplicationServices -framework CoreFoundation
-OPTOPTS= -isysroot @macosx_sdk@ \
- @macosx_arches@ \
- -mmacosx-version-min=@macosx_dep_target@ \
- @OPTOPTS@
+OPTOPTS= @OPTOPTS@
LIBS= @LIBS@
LDFLAGS= @LDFLAGS@ ${LIBS}
diff --git a/configure.ac b/configure.ac
index 815f395..05caaed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,8 +15,8 @@ AC_PROG_CC
AC_PROG_INSTALL
AC_CANONICAL_SYSTEM
-DUTI_CHECK_SDK
-DUTI_CHECK_DEPLOYMENT_TARGET
+#DUTI_CHECK_SDK
+#DUTI_CHECK_DEPLOYMENT_TARGET
# function checks
AC_CHECK_FUNC(strlcpy,have_strlcpy=yes,)
+14 -10
View File
@@ -1,4 +1,9 @@
{stdenv, lib, fetchFromGitHub, autoreconfHook, ApplicationServices}:
{
stdenv,
lib,
fetchFromGitHub,
autoreconfHook,
}:
stdenv.mkDerivation rec {
pname = "duti";
@@ -10,16 +15,12 @@ stdenv.mkDerivation rec {
sha256 = "1pg4i6ghpib2gy1sqpml7dbnhr1vbr43fs2pqkd09i4w3nmgpic9";
};
nativeBuildInputs = [autoreconfHook];
buildInputs = [ApplicationServices];
configureFlags = [
"--with-macosx-sdk=/homeless-shelter"
# needed to prevent duti from trying to guess our sdk
# NOTE: this is different than stdenv.hostPlatform.config!
"--host=x86_64-apple-darwin18"
patches = [
./buildConfigure.patch
];
nativeBuildInputs = [ autoreconfHook ];
meta = with lib; {
description = "Command-line tool to select default applications for document types and URL schemes on Mac OS X";
longDescription = ''
@@ -29,7 +30,10 @@ stdenv.mkDerivation rec {
a Microsoft Word document has a UTI of com.microsoft.word.doc. Using duti, the
user can change which application acts as the default handler for a given UTI.
'';
maintainers = with maintainers; [matthewbauer n-hass];
maintainers = with maintainers; [
matthewbauer
n-hass
];
platforms = platforms.darwin;
license = licenses.publicDomain;
homepage = "https://github.com/moretension/duti/";
+21 -62
View File
@@ -1,79 +1,38 @@
{
lib,
callPackage,
pkg-config,
rustPlatform,
llvmPackages,
elfutils,
zlib,
fetchFromGitHub,
}:
let
versionInfo = lib.importJSON ./version.json;
scx-common = rec {
versionInfo = lib.importJSON ./version.json;
# Useful function for packaging schedulers, should be used unless the build system is too complex
# passes some default values like src, version (all of which can be overridden)
mkScxScheduler =
packageType:
args@{ schedulerName, ... }:
(if packageType == "rust" then rustPlatform.buildRustPackage else llvmPackages.stdenv.mkDerivation)
(
args
// {
pname = "${schedulerName}";
version = args.version or versionInfo.scx.version;
inherit (versionInfo.scx) version;
src = args.src or fetchFromGitHub {
owner = "sched-ext";
repo = "scx";
rev = "refs/tags/v${versionInfo.scx.version}";
inherit (versionInfo.scx) hash;
};
src = fetchFromGitHub {
owner = "sched-ext";
repo = "scx";
rev = "refs/tags/v${versionInfo.scx.version}";
inherit (versionInfo.scx) hash;
};
nativeBuildInputs = [
pkg-config
llvmPackages.clang
] ++ (args.nativeBuildInputs or [ ]);
buildInputs = [
elfutils
zlib
] ++ (args.buildInputs or [ ]);
env.LIBCLANG_PATH = args.env.LIBCLANG_PATH or "${lib.getLib llvmPackages.libclang}/lib";
# Needs to be disabled in BPF builds
hardeningDisable = [
"zerocallusedregs"
] ++ (args.hardeningDisable or [ ]);
meta = (args.meta or { }) // {
description = args.meta.description or "";
longDescription =
(args.meta.longDescription or "")
+ ''
\n\nSched-ext schedulers are only available on supported kernels
(6.12 and above or any kernel with the scx patchset applied).'';
homepage = args.meta.homepage or "https://github.com/sched-ext/scx";
license = args.meta.license or lib.licenses.gpl2Only;
platforms = args.meta.platforms or lib.platforms.linux;
maintainers = (args.meta.maintainers or [ ]) ++ (with lib.maintainers; [ johnrtitor ]);
};
}
);
meta = {
homepage = "https://github.com/sched-ext/scx";
changelog = "https://github.com/sched-ext/scx/releases/tag/v${versionInfo.scx.version}";
license = lib.licenses.gpl2Only;
platforms = lib.platforms.linux;
badPlatforms = [ "aarch64-linux" ];
maintainers = with lib.maintainers; [ johnrtitor ];
};
};
schedulers = lib.mergeAttrsList [
{ bpfland = import ./scx_bpfland; }
{ lavd = import ./scx_lavd; }
{ layered = import ./scx_layered; }
{ rlfifo = import ./scx_rlfifo; }
{ rustland = import ./scx_rustland; }
{ rusty = import ./scx_rusty; }
{ cscheds = import ./scx_cscheds.nix; }
{ rustscheds = import ./scx_rustscheds.nix; }
{ full = import ./scx_full.nix; }
];
in
(lib.mapAttrs (name: scheduler: callPackage scheduler { inherit mkScxScheduler; }) schedulers)
(lib.mapAttrs (name: scheduler: callPackage scheduler { inherit scx-common; }) schedulers)
// {
inherit mkScxScheduler;
inherit scx-common;
}
File diff suppressed because it is too large Load Diff
@@ -1,38 +0,0 @@
{
stdenv,
lib,
mkScxScheduler,
}:
mkScxScheduler "rust" {
schedulerName = "scx_bpfland";
cargoRoot = "scheds/rust/scx_bpfland";
cargoLock.lockFile = ./Cargo.lock;
postPatch = ''
rm Cargo.toml Cargo.lock
ln -fs ${./Cargo.lock} scheds/rust/scx_bpfland/Cargo.lock
'';
preBuild = ''
cd scheds/rust/scx_bpfland
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp target/${stdenv.targetPlatform.config}/release/scx_bpfland $out/bin/
runHook postInstall
'';
meta = {
description = "Sched-ext Rust userspace scheduler";
longDescription = ''
Vruntime-based Sched-ext scheduler that prioritizes interactive workloads. This
scheduler is derived from scx_rustland, but it is fully implemented in BPF. It
has a minimal user-space Rust part to process command line options, collect metrics
and log out scheduling statistics. The BPF part makes all the scheduling decisions.
'';
mainProgram = "scx_bpfland";
};
}
+70 -43
View File
@@ -1,40 +1,21 @@
{
stdenv,
lib,
mkScxScheduler,
llvmPackages,
fetchFromGitHub,
writeShellScript,
bash,
meson,
ninja,
jq,
pkg-config,
bpftools,
elfutils,
zlib,
libbpf,
zstd,
scx-common,
}:
let
versionInfo = lib.importJSON ./version.json;
# scx needs a specific commit of bpftool
# can be found in meson.build of scx src
# grep 'bpftool_commit =' ./meson.build
bpftools_src = fetchFromGitHub {
owner = "libbpf";
repo = "bpftool";
inherit (versionInfo.bpftool) rev hash;
fetchSubmodules = true;
};
# scx needs a specific commit of bpftool
# this imitates the fetch_bpftool script in src/meson-scripts
fetchBpftool = writeShellScript "fetch_bpftool" ''
[ "$2" == '${bpftools_src.rev}' ] || exit 1
cd "$1"
cp --no-preserve=mode,owner -r "${bpftools_src}/" ./bpftool
'';
# Fixes a bug with the meson build script where it specifies
# /bin/bash twice in the script
misbehaviorBash = writeShellScript "bash" ''
@@ -42,24 +23,46 @@ let
exec ${lib.getExe bash} "$@"
'';
# Won't build with stable libbpf, so use the latest commit
libbpf-git = libbpf.overrideAttrs (oldAttrs: {
src = fetchFromGitHub {
owner = "libbpf";
repo = "libbpf";
inherit (versionInfo.libbpf) rev hash;
fetchSubmodules = true;
};
});
in
mkScxScheduler "c" {
schedulerName = "scx_cscheds";
llvmPackages.stdenv.mkDerivation (finalAttrs: {
pname = "scx_cscheds";
inherit (scx-common) version src;
# scx needs specific commits of bpftool and libbpf
# can be found in meson.build of scx src
# grep 'bpftool_commit =' ./meson.build
bpftools_src = fetchFromGitHub {
owner = "libbpf";
repo = "bpftool";
inherit (scx-common.versionInfo.bpftool) rev hash;
fetchSubmodules = true;
};
# grep 'libbpf_commit = ' ./meson.build
libbpf_src = fetchFromGitHub {
owner = "libbpf";
repo = "libbpf";
inherit (scx-common.versionInfo.libbpf) rev hash;
fetchSubmodules = true;
};
# this imitates the fetch_bpftool and fetch_libbpf script in src/meson-scripts
fetchBpftool = writeShellScript "fetch_bpftool" ''
[ "$2" == '${finalAttrs.bpftools_src.rev}' ] || exit 1
cd "$1"
cp --no-preserve=mode,owner -r "${finalAttrs.bpftools_src}/" ./bpftool
'';
fetchLibbpf = writeShellScript "fetch_libbpf" ''
[ "$2" == '${finalAttrs.libbpf_src.rev}' ] || exit 1
cd "$1"
cp --no-preserve=mode,owner -r "${finalAttrs.libbpf_src}/" ./libbpf
mkdir -p ./libbpf/src/usr/include
'';
postPatch = ''
rm meson-scripts/fetch_bpftool
rm meson-scripts/fetch_bpftool meson-scripts/fetch_libbpf
patchShebangs ./meson-scripts
cp ${fetchBpftool} meson-scripts/fetch_bpftool
cp ${finalAttrs.fetchBpftool} meson-scripts/fetch_bpftool
cp ${finalAttrs.fetchLibbpf} meson-scripts/fetch_libbpf
substituteInPlace meson.build \
--replace-fail '[build_bpftool' "['${misbehaviorBash}', build_bpftool"
'';
@@ -68,12 +71,13 @@ mkScxScheduler "c" {
meson
ninja
jq
pkg-config
zstd
] ++ bpftools.buildInputs ++ bpftools.nativeBuildInputs;
buildInputs = [
elfutils
zlib
libbpf-git
];
mesonFlags = [
@@ -81,10 +85,8 @@ mkScxScheduler "c" {
# systemd unit is implemented in the nixos module
# upstream systemd files are a hassle to patch
"systemd" = false;
"openrc" = false;
# libbpf is already fetched as FOD
"libbpf_a" = false;
# not for nix
"openrc" = false;
"libalpm" = false;
})
(lib.mapAttrsToList lib.mesonBool {
@@ -93,17 +95,42 @@ mkScxScheduler "c" {
# rust based schedulers are built seperately
"enable_rust" = false;
})
# Clang to use when compiling .bpf.c
(lib.mesonOption "bpf_clang" (lib.getExe llvmPackages.clang))
];
hardeningDisable = [
"stackprotector"
"zerocallusedregs"
];
meta = {
# We copy the compiled header files to the dev output
# These are needed for the rust schedulers
preInstall = ''
mkdir -p ${placeholder "dev"}/libbpf ${placeholder "dev"}/bpftool
cp -r libbpf/* ${placeholder "dev"}/libbpf/
cp -r bpftool/* ${placeholder "dev"}/bpftool/
'';
outputs = [
"bin"
"dev"
"out"
];
# Enable this when default kernel in nixpkgs is 6.12+
doCheck = false;
meta = scx-common.meta // {
description = "Sched-ext C userspace schedulers";
longDescription = ''
This includes C based schedulers such as scx_central, scx_flatcg,
scx_nest, scx_pair, scx_qmap, scx_simple, scx_userland.
::: {.note}
Sched-ext schedulers are only available on kernels version 6.12 or later.
It is recommended to use the latest kernel for the best compatibility.
:::
'';
};
}
})
+10 -8
View File
@@ -1,28 +1,30 @@
{
stdenv,
lib,
stdenv,
scx-common,
scx,
mkScxScheduler,
}:
scx.cscheds.overrideAttrs (oldAttrs: {
pname = "scx_full";
postInstall =
(oldAttrs.postInstall or "")
+ ''
cp ${lib.getExe scx.bpfland} $out/bin/
cp ${lib.getExe scx.lavd} $out/bin/
cp ${lib.getExe scx.layered} $out/bin/
cp ${lib.getExe scx.rlfifo} $out/bin/
cp ${lib.getExe scx.rustland} $out/bin/
cp ${lib.getExe scx.rusty} $out/bin/
cp ${scx.rustscheds}/bin/* ${placeholder "bin"}/bin/
'';
passthru.updateScript.command = ./update.sh;
meta = oldAttrs.meta // {
description = "Sched-ext C and Rust userspace schedulers";
longDescription = ''
This includes C based schedulers such as scx_central, scx_flatcg,
scx_pair, scx_qmap, scx_simple, scx_userland and Rust based schedulers
like scx_rustland, scx_bpfland, scx_lavd, scx_layered, scx_rlfifo.
::: {.note}
Sched-ext schedulers are only available on kernels version 6.12 or later.
It is recommended to use the latest kernel for the best compatibility.
:::
'';
};
})
File diff suppressed because it is too large Load Diff
@@ -1,37 +0,0 @@
{
stdenv,
lib,
mkScxScheduler,
}:
mkScxScheduler "rust" {
schedulerName = "scx_lavd";
cargoRoot = "scheds/rust/scx_lavd";
cargoLock.lockFile = ./Cargo.lock;
postPatch = ''
rm Cargo.toml Cargo.lock
ln -fs ${./Cargo.lock} scheds/rust/scx_lavd/Cargo.lock
'';
preBuild = ''
cd scheds/rust/scx_lavd
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp target/${stdenv.targetPlatform.config}/release/scx_lavd $out/bin/
runHook postInstall
'';
meta = {
description = "Sched-ext Rust userspace scheduler";
longDescription = ''
BPF scheduler that implements an LAVD (Latency-criticality Aware Virtual Deadline)
scheduling algorithm. typical use case involves highly interactive applications,
such as gaming, which requires high throughput and low tail latencies.
'';
mainProgram = "scx_lavd";
};
}
File diff suppressed because it is too large Load Diff
@@ -1,36 +0,0 @@
{
stdenv,
lib,
mkScxScheduler,
}:
mkScxScheduler "rust" {
schedulerName = "scx_layered";
cargoRoot = "scheds/rust/scx_layered";
cargoLock.lockFile = ./Cargo.lock;
postPatch = ''
rm Cargo.toml Cargo.lock
ln -fs ${./Cargo.lock} scheds/rust/scx_layered/Cargo.lock
'';
preBuild = ''
cd scheds/rust/scx_layered
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp target/${stdenv.targetPlatform.config}/release/scx_layered $out/bin/
runHook postInstall
'';
meta = {
description = "Sched-ext Rust userspace scheduler";
longDescription = ''
Highly configurable multi-layer BPF/userspace hybrid scheduler.
It is designed to be highly customizable, and can be targeted for specific applications.
'';
mainProgram = "scx_layered";
};
}
File diff suppressed because it is too large Load Diff
@@ -1,37 +0,0 @@
{
stdenv,
lib,
mkScxScheduler,
}:
mkScxScheduler "rust" {
schedulerName = "scx_rlfifo";
cargoRoot = "scheds/rust/scx_rlfifo";
cargoLock.lockFile = ./Cargo.lock;
postPatch = ''
rm Cargo.toml Cargo.lock
ln -fs ${./Cargo.lock} scheds/rust/scx_rlfifo/Cargo.lock
'';
preBuild = ''
cd scheds/rust/scx_rlfifo
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp target/${stdenv.targetPlatform.config}/release/scx_rlfifo $out/bin/
runHook postInstall
'';
meta = {
description = "Sched-ext Rust userspace scheduler";
longDescription = ''
scx_rlfifo is a simple FIFO scheduler runs in user-space, based on the
scx_rustland_core framework. Not for production use, but useful to test as a
baseline against complex scheduling polices or for a basic FIFO scheduling approach.
'';
mainProgram = "scx_rlfifo";
};
}
File diff suppressed because it is too large Load Diff
@@ -1,38 +0,0 @@
{
stdenv,
lib,
mkScxScheduler,
}:
mkScxScheduler "rust" {
schedulerName = "scx_rustland";
cargoRoot = "scheds/rust/scx_rustland";
cargoLock.lockFile = ./Cargo.lock;
postPatch = ''
rm Cargo.toml Cargo.lock
ln -fs ${./Cargo.lock} scheds/rust/scx_rustland/Cargo.lock
'';
preBuild = ''
cd scheds/rust/scx_rustland
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp target/${stdenv.targetPlatform.config}/release/scx_rustland $out/bin/
runHook postInstall
'';
meta = {
description = "Sched-ext Rust userspace scheduler";
longDescription = ''
Made of a BPF component (scx_rustland_core) that implements the low level sched-ext functionalities
and a user-space counterpart (scheduler), written in Rust, that implements the actual scheduling policy.
It is designed to prioritize interactive workloads over background CPU-intensive workloads. Typical use
case involves low-latency interactive applications, such as gaming, video conferencing and live streaming.
'';
mainProgram = "scx_rustland";
};
}
@@ -0,0 +1,72 @@
{
lib,
rustPlatform,
llvmPackages,
pkg-config,
elfutils,
zlib,
zstd,
scx-common,
scx,
}:
rustPlatform.buildRustPackage {
pname = "scx_rustscheds";
inherit (scx-common) version src;
inherit (scx-common.versionInfo.scx) cargoHash;
# Copy compiled headers and libs from scx.cscheds
postPatch = ''
mkdir bpftool libbpf
cp -r ${scx.cscheds.dev}/bpftool/* bpftool/
cp -r ${scx.cscheds.dev}/libbpf/* libbpf/
'';
nativeBuildInputs = [
pkg-config
llvmPackages.clang
];
buildInputs = [
elfutils
zlib
zstd
];
env = {
LIBCLANG_PATH = "${lib.getLib llvmPackages.libclang}/lib";
BPF_CLANG = lib.getExe llvmPackages.clang;
BPF_EXTRA_CFLAGS_PRE_INCL = lib.concatStringsSep " " [
"-I${scx.cscheds.dev}/libbpf/src/usr/include"
"-I${scx.cscheds.dev}/libbpf/include/uapi"
"-I${scx.cscheds.dev}/libbpf/include/linux"
];
RUSTFLAGS = lib.concatStringsSep " " [
"-C relocation-model=pic"
"-C link-args=-lelf"
"-C link-args=-lz"
"-C link-args=-lzstd"
"-L ${scx.cscheds.dev}/libbpf/src"
];
};
hardeningDisable = [
"stackprotector"
"zerocallusedregs"
];
# Enable this when default kernel in nixpkgs is 6.12+
doCheck = false;
meta = scx-common.meta // {
description = "Sched-ext Rust userspace schedulers";
longDescription = ''
This includes Rust based schedulers such as
scx_rustland, scx_bpfland, scx_lavd, scx_layered, scx_rlfifo.
::: {.note}
Sched-ext schedulers are only available on kernels version 6.12 or later.
It is recommended to use the latest kernel for the best compatibility.
:::
'';
};
}
File diff suppressed because it is too large Load Diff
@@ -1,38 +0,0 @@
{
stdenv,
lib,
mkScxScheduler,
}:
mkScxScheduler "rust" {
schedulerName = "scx_rusty";
cargoRoot = "scheds/rust/scx_rusty";
cargoLock.lockFile = ./Cargo.lock;
postPatch = ''
rm Cargo.toml Cargo.lock
ln -fs ${./Cargo.lock} scheds/rust/scx_rusty/Cargo.lock
'';
preBuild = ''
cd scheds/rust/scx_rusty
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp target/${stdenv.targetPlatform.config}/release/scx_rusty $out/bin/
runHook postInstall
'';
meta = {
description = "Sched-ext Rust userspace scheduler";
longDescription = ''
Multi-domain, BPF/userspace hybrid scheduler. BPF portion of the scheduler does
a simple round robin in each domain, and the userspace portion calculates the load
factor of each domain, and informs BPF of how tasks should be load balanced accordingly.
Rusty is designed to be flexible, accommodating different architectures and workloads.
'';
mainProgram = "scx_rusty";
};
}
+17 -10
View File
@@ -1,13 +1,15 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p coreutils moreutils curl jq nix-prefetch-git cargo gnugrep gawk
#! nix-shell -i bash -p coreutils moreutils curl jq nix-prefetch-git cargo gnugrep gawk nix
# shellcheck shell=bash
# You must run it from the root directory of a nixpkgs repo checkout
set -euo pipefail
versionJson="$(realpath "./pkgs/os-specific/linux/scx/version.json")"
nixFolder="$(dirname "$versionJson")"
localVer=$(jq -r .version <$versionJson)
localVer=$(jq -r .scx.version <$versionJson)
latestVer=$(curl -s https://api.github.com/repos/sched-ext/scx/releases/latest | jq -r .tag_name | sed 's/v//g')
if [ "$localVer" == "$latestVer" ]; then
@@ -26,7 +28,7 @@ pushd "$tmp/scx"
bpftoolRev=$(grep 'bpftool_commit =' ./meson.build | awk -F"'" '{print $2}')
bpftoolHash=$(nix-prefetch-git https://github.com/libbpf/bpftool.git --rev $bpftoolRev --fetch-submodules --quiet | jq -r .hash)
libbpfRev=$(curl -s "https://api.github.com/repos/libbpf/libbpf/commits/master" | jq -r '.sha')
libbpfRev=$(grep 'libbpf_commit =' ./meson.build | awk -F"'" '{print $2}')
libbpfHash=$(nix-prefetch-git https://github.com/libbpf/libbpf.git --rev $libbpfRev --fetch-submodules --quiet | jq -r .hash)
jq \
@@ -38,13 +40,18 @@ jq \
.libbpf.rev = \$libbpfRev | .libbpf.hash = \$libbpfHash" \
"$versionJson" | sponge $versionJson
rm -f Cargo.toml Cargo.lock
echo "scx: $localVer -> $latestVer"
for scheduler in bpfland lavd layered rlfifo rustland rusty; do
pushd "scheds/rust/scx_$scheduler"
echo "Updating cargoHash. This may take a while..."
popd
cargoHash=$((nix-build --attr scx.rustscheds 2>&1 || true) | awk '/got/{print $2}')
cargo generate-lockfile
cp Cargo.lock "$nixFolder/scx_$scheduler/Cargo.lock"
if [ -z "$cargoHash" ]; then
echo "Failed to get cargoHash, please update it manually"
exit 0
fi
popd
done
jq \
--arg cargoHash "$cargoHash" \
".scx.cargoHash = \$cargoHash" \
"$versionJson" | sponge $versionJson
+5 -4
View File
@@ -1,14 +1,15 @@
{
"scx": {
"version": "1.0.5",
"hash": "sha256-nb2bzEanPPWTUhMmGw/8/bwOkdgNmwoZX2lMFq5Av5Q="
"version": "1.0.6",
"hash": "sha256-hE0O15/9fplKrkmdiiHRJK6DzD9XaGhBwtGPqq/sX58=",
"cargoHash": "sha256-K/pLWEUQyzdGDBhP5MXVOiAXCA4h0dh0S2q0SzlsSDY="
},
"bpftool": {
"rev": "77a72987353fcae8ce330fd87d4c7afb7677a169",
"hash": "sha256-pItTVewlXgB97AC/WH9rW9J/eYSe2ZdBkJaAgGnDeUU="
},
"libbpf": {
"rev": "09b9e83102eb8ab9e540d36b4559c55f3bcdb95d",
"hash": "sha256-0PadA9OppNGmgSTLi8sXrh3syxPVkqrnTkBr8cyp+Ug="
"rev": "686f600bca59e107af4040d0838ca2b02c14ff50",
"hash": "sha256-uIu57gFkPhBCq3RqKb6J4r5OB4X5/V9q8HqIafUc+Do="
}
}
+1
View File
@@ -1307,6 +1307,7 @@ mapAliases {
virtscreen = throw "'virtscreen' has been removed, as it was broken and unmaintained"; # Added 2024-10-17
vkBasalt = vkbasalt; # Added 2022-11-22
vkdt-wayland = vkdt; # Added 2024-04-19
vuze = throw "'vuze' was removed because it is unmaintained upstream and insecure (CVE-2018-13417). BiglyBT is a maintained fork."; # Added 2024-11-22
inherit (libsForQt5.mauiPackages) vvave; # added 2022-05-17
### W ###
+1 -8
View File
@@ -16230,11 +16230,6 @@ with pkgs;
inherit (darwin.apple_sdk.frameworks) AppKit Cocoa CoreServices Security;
};
vuze = callPackage ../applications/networking/p2p/vuze {
jre = jre8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731
jdk = jdk8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731
};
whispers = with python3Packages; toPythonApplication whispers;
warp = callPackage ../applications/networking/warp {
@@ -18960,9 +18955,7 @@ with pkgs;
compressDrvWeb = callPackage ../build-support/compress-drv/web.nix { };
duti = callPackage ../os-specific/darwin/duti {
inherit (darwin.apple_sdk.frameworks) ApplicationServices;
};
duti = callPackage ../os-specific/darwin/duti { };
dnstracer = callPackage ../tools/networking/dnstracer {
inherit (darwin) libresolv;