diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 2c1d0e348726..7724dd513143 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -6722,6 +6722,7 @@ drakon64 = { name = "Adam Chance"; email = "nixpkgs@drakon.cloud"; + github = "drakon64"; githubId = 6444703; }; dramaturg = { @@ -23224,6 +23225,7 @@ name = "Zhifan"; email = "nonno.felice69uwu@gmail.com"; matrix = "@c3n21:matrix.org"; + github = "c3n21"; githubId = 37077738; }; sinjin2300 = { diff --git a/nixos/doc/manual/release-notes/rl-2511.section.md b/nixos/doc/manual/release-notes/rl-2511.section.md index cf15890e2de9..e6a98cc93c12 100644 --- a/nixos/doc/manual/release-notes/rl-2511.section.md +++ b/nixos/doc/manual/release-notes/rl-2511.section.md @@ -48,6 +48,8 @@ +- The Perl implementation of the `switch-to-configuration` program is removed. All switchable systems now use the Rust rewrite. Any prior usage of `system.switch.enableNg` must now be removed. If you have any outstanding issues with the new implementation, please open an issue on GitHub. + - The `services.polipo` module has been removed as `polipo` is unmaintained and archived upstream. - The Pocket ID module ([`services.pocket-id`][#opt-services.pocket-id.enable]) and package (`pocket-id`) has been updated to 1.0.0. Some environment variables have been changed or removed, see the [migration guide](https://pocket-id.org/docs/setup/migrate-to-v1/). diff --git a/nixos/modules/misc/nixpkgs/read-only.nix b/nixos/modules/misc/nixpkgs/read-only.nix index fa372d13e545..db43615c12f0 100644 --- a/nixos/modules/misc/nixpkgs/read-only.nix +++ b/nixos/modules/misc/nixpkgs/read-only.nix @@ -63,7 +63,7 @@ in # find mistaken definitions builtins.seq cfg.config builtins.seq cfg.overlays builtins.seq cfg.hostPlatform builtins.seq cfg.buildPlatform - cfg.pkgs; + cfg.pkgs.__splicedPackages; nixpkgs.config = cfg.pkgs.config; nixpkgs.overlays = cfg.pkgs.overlays; nixpkgs.hostPlatform = cfg.pkgs.stdenv.hostPlatform; diff --git a/nixos/modules/services/hardware/nvidia-optimus.nix b/nixos/modules/services/hardware/nvidia-optimus.nix index 7c16cb9676ee..fff8d2a0ddce 100644 --- a/nixos/modules/services/hardware/nvidia-optimus.nix +++ b/nixos/modules/services/hardware/nvidia-optimus.nix @@ -29,6 +29,7 @@ in "nvidia" "nvidiafb" "nvidia-drm" + "nvidia-uvm" "nvidia-modeset" ]; boot.kernelModules = [ "bbswitch" ]; diff --git a/nixos/modules/system/activation/activation-script.nix b/nixos/modules/system/activation/activation-script.nix index 58f6ebc90422..d398c6069e71 100644 --- a/nixos/modules/system/activation/activation-script.nix +++ b/nixos/modules/system/activation/activation-script.nix @@ -256,7 +256,7 @@ in description = '' A program that writes a bootloader installation script to the path passed in the first command line argument. - See `nixos/modules/system/activation/switch-to-configuration.pl`. + See `pkgs/by-name/sw/switch-to-configuration-ng/src/src/main.rs`. ''; type = types.unique { message = '' diff --git a/nixos/modules/system/activation/switch-to-configuration.pl b/nixos/modules/system/activation/switch-to-configuration.pl deleted file mode 100755 index 8eee52bfa332..000000000000 --- a/nixos/modules/system/activation/switch-to-configuration.pl +++ /dev/null @@ -1,1027 +0,0 @@ -#! @perl@/bin/perl - -# NOTE: This script has an alternative implementation at -# . Any behavioral -# modifications to this script should also be made to that implementation. - - -# Issue #166838 uncovered a situation in which a configuration not suitable -# for the target architecture caused a cryptic error message instead of -# a clean failure. Due to this mismatch, the perl interpreter in the shebang -# line wasn't able to be executed, causing this script to be misinterpreted -# as a shell script. -# -# Let's detect this situation to give a more meaningful error -# message. The following two lines are carefully written to be both valid Perl -# and Bash. -printf "Perl script erroneously interpreted as shell script,\ndoes target platform match nixpkgs.crossSystem platform?\n" && exit 1 - if 0; - -use strict; -use warnings; -use Config::IniFiles; -use File::Path qw(make_path); -use File::Basename; -use File::Slurp qw(read_file write_file edit_file); -use JSON::PP; -use IPC::Cmd; -use Sys::Syslog qw(:standard :macros); -use Cwd qw(abs_path); -use Fcntl ':flock'; - -## no critic(ControlStructures::ProhibitDeepNests) -## no critic(ErrorHandling::RequireCarping) -## no critic(CodeLayout::ProhibitParensWithBuiltins) -## no critic(Variables::ProhibitPunctuationVars, Variables::RequireLocalizedPunctuationVars) -## no critic(InputOutput::RequireCheckedSyscalls, InputOutput::RequireBracedFileHandleWithPrint, InputOutput::RequireBriefOpen) -## no critic(ValuesAndExpressions::ProhibitNoisyQuotes, ValuesAndExpressions::ProhibitMagicNumbers, ValuesAndExpressions::ProhibitEmptyQuotes, ValuesAndExpressions::ProhibitInterpolationOfLiterals) -## no critic(RegularExpressions::ProhibitEscapedMetacharacters) - -# Location of activation scripts -my $out = "@out@"; -# System closure path to switch to -my $toplevel = "@toplevel@"; - -# To be robust against interruption, record what units need to be started etc. -# We read these files again every time this script starts to make sure we continue -# where the old (interrupted) script left off. -my $start_list_file = "/run/nixos/start-list"; -my $restart_list_file = "/run/nixos/restart-list"; -my $reload_list_file = "/run/nixos/reload-list"; - -# Parse restart/reload requests by the activation script. -# Activation scripts may write newline-separated units to the restart -# file and switch-to-configuration will handle them. While -# `stopIfChanged = true` is ignored, switch-to-configuration will -# handle `restartIfChanged = false` and `reloadIfChanged = true`. -# This is the same as specifying a restart trigger in the NixOS module. -# -# The reload file asks the script to reload a unit. This is the same as -# specifying a reload trigger in the NixOS module and can be ignored if -# the unit is restarted in this activation. -my $restart_by_activation_file = "/run/nixos/activation-restart-list"; -my $reload_by_activation_file = "/run/nixos/activation-reload-list"; -my $dry_restart_by_activation_file = "/run/nixos/dry-activation-restart-list"; -my $dry_reload_by_activation_file = "/run/nixos/dry-activation-reload-list"; - -# The action that is to be performed (like switch, boot, test, dry-activate) -# Also exposed via environment variable from now on -my $action = shift(@ARGV); -$ENV{NIXOS_ACTION} = $action; - -# Expose the locale archive as an environment variable for systemctl and the activation script -if ("@localeArchive@" ne "") { - $ENV{LOCALE_ARCHIVE} = "@localeArchive@"; -} - -if (!defined($action) || ($action ne "switch" && $action ne "boot" && $action ne "test" && $action ne "dry-activate" && $action ne "check")) { - print STDERR <<"EOF"; -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 -dry-activate: show what would be done if this configuration were activated -EOF - exit(1); -} - -# This is a NixOS installation if it has /etc/NIXOS or a proper -# /etc/os-release. -if (!-f "/etc/NIXOS" && (read_file("/etc/os-release", err_mode => "quiet") // "") !~ /^ID="?@distroId@"?/msx) { - die("This is not a NixOS installation!\n"); -} - -make_path("/run/nixos", { mode => oct(755) }); -open(my $stc_lock, '>>', '/run/nixos/switch-to-configuration.lock') or die "Could not open lock - $!"; -flock($stc_lock, LOCK_EX|LOCK_NB) 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 $action") == 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'); -@installBootLoader@ -EOFBOOTLOADER - system("$install_boot_loader $toplevel") == 0 or exit 1; -} - -# Just in case the new configuration hangs the system, do a sync now. -if (($ENV{"NIXOS_NO_SYNC"} // "") ne "1") { - system("@coreutils@/bin/sync", "-f", "/nix/store"); -} - -if ($action eq "boot") { - exit(0); -} - -# Path to the directory containing systemd tools of the old system -# Needs to be after the "boot" action exits, as this directory will not exist when doing a NIXOS_LUSTRATE install -my $cur_systemd = abs_path("/run/current-system/sw/bin"); -# Path to the systemd store path of the new system -my $new_systemd = "@systemd@"; - -# Check if we can activate the new configuration. -my $cur_init_interface_version = read_file("/run/current-system/init-interface-version", err_mode => "quiet") // ""; -my $new_init_interface_version = read_file("$toplevel/init-interface-version"); - -if ($new_init_interface_version ne $cur_init_interface_version) { - print STDERR <<'EOF'; -Warning: the new NixOS configuration has an ‘init’ that is -incompatible with the current configuration. The new configuration -won't take effect until you reboot the system. -EOF - exit(100); -} - -# Ignore SIGHUP so that we're not killed if we're running on (say) -# virtual console 1 and we restart the "tty1" unit. -$SIG{PIPE} = "IGNORE"; - -# Replacement for Net::DBus that calls busctl of the current systemd, parses -# it's json output and returns the response using only core modules to reduce -# dependencies on perlPackages in baseSystem -sub busctl_call_systemd1_mgr { - my (@args) = @_; - my $cmd = [ - "$cur_systemd/busctl", "--json=short", "call", "org.freedesktop.systemd1", - "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", - @args - ]; - - my ($ok, $err, undef, $stdout) = IPC::Cmd::run(command => $cmd); - die $err unless $ok; - - my $res = decode_json(join "", @$stdout); - return $res; -} - -# Asks the currently running systemd instance via dbus which units are active. -# Returns a hash where the key is the name of each unit and the value a hash -# of load, state, substate. -sub get_active_units { - my $units = busctl_call_systemd1_mgr("ListUnitsByPatterns", "asas", 0, 0)->{data}->[0]; - my $res = {}; - for my $item (@{$units}) { - my ($id, $description, $load_state, $active_state, $sub_state, - $following, $unit_path, $job_id, $job_type, $job_path) = @{$item}; - if ($following ne "") { - next; - } - if ($job_id == 0 and $active_state eq "inactive") { - next; - } - $res->{$id} = { load => $load_state, state => $active_state, substate => $sub_state }; - } - return $res; -} - -# Asks the currently running systemd instance whether a unit is currently active. -# Takes the name of the unit as an argument and returns a bool whether the unit is active or not. -sub unit_is_active { - my ($unit_name) = @_; - my $units = busctl_call_systemd1_mgr("ListUnitsByNames", "as", 1, , "--", $unit_name)->{data}->[0]; - if (scalar(@{$units}) == 0) { - return 0; - } - my $active_state = $units->[0]->[3]; - return $active_state eq "active" || $active_state eq "activating"; -} - -# Parse a fstab file, given its path. -# Returns a tuple of filesystems and swaps. -# -# Filesystems is a hash of mountpoint and { device, fsType, options } -# Swaps is a hash of device and { options } -sub parse_fstab { - my ($filename) = @_; - my ($fss, $swaps); - foreach my $line (read_file($filename, err_mode => "quiet")) { - chomp($line); - $line =~ s/^\s*\#.*//msx; - if ($line =~ /^\s*$/msx) { - next; - } - my @xs = split(/\s+/msx, $line); - if ($xs[2] eq "swap") { - $swaps->{$xs[0]} = { options => $xs[3] // "" }; - } else { - $fss->{$xs[1]} = { device => $xs[0], fsType => $xs[2], options => $xs[3] // "" }; - } - } - return ($fss, $swaps); -} - -# This subroutine takes a single ini file that specified systemd configuration -# like unit configuration and parses it into a hash where the keys are the sections -# of the unit file and the values are hashes themselves. These hashes have the unit file -# keys as their keys (left side of =) and an array of all values that were set as their -# values. If a value is empty (for example `ExecStart=`), then all current definitions are -# removed. -# -# Instead of returning the hash, this subroutine takes a hashref to return the data in. This -# allows calling the subroutine multiple times with the same hash to parse override files. -sub parse_systemd_ini { - my ($unit_contents, $path) = @_; - # Tie the ini file to a hash for easier access - tie(my %file_contents, "Config::IniFiles", (-file => $path, -allowempty => 1, -allowcontinue => 1)); ## no critic(Miscellanea::ProhibitTies) - - # Copy over all sections - foreach my $section_name (keys(%file_contents)) { - if ($section_name eq "Install") { - # Skip the [Install] section because it has no relevant keys for us - next; - } - # Copy over all keys - foreach my $ini_key (keys(%{$file_contents{$section_name}})) { - # Ensure the value is an array so it's easier to work with - my $ini_value = $file_contents{$section_name}{$ini_key}; - my @ini_values; - if (ref($ini_value) eq "ARRAY") { - @ini_values = @{$ini_value}; - } else { - @ini_values = $ini_value; - } - # Go over all values - for my $ini_value (@ini_values) { - # If a value is empty, it's an override that tells us to clean the value - if ($ini_value eq "") { - delete $unit_contents->{$section_name}->{$ini_key}; - next; - } - push(@{$unit_contents->{$section_name}->{$ini_key}}, $ini_value); - } - } - } - return; -} - -# This subroutine takes the path to a systemd configuration file (like a unit configuration), -# parses it, and returns a hash that contains the contents. The contents of this hash are -# explained in the `parse_systemd_ini` subroutine. Neither the sections nor the keys inside -# the sections are consistently sorted. -# -# If a directory with the same basename ending in .d exists next to the unit file, it will be -# assumed to contain override files which will be parsed as well and handled properly. -sub parse_unit { - my ($unit_path, $base_unit_path) = @_; - - # Parse the main unit and all overrides - my %unit_data; - # Replace \ with \\ so glob() still works with units that have a \ in them - # Valid characters in unit names are ASCII letters, digits, ":", "-", "_", ".", and "\" - $base_unit_path =~ s/\\/\\\\/gmsx; - $unit_path =~ s/\\/\\\\/gmsx; - - foreach (glob("${base_unit_path}{,.d/*.conf}")) { - parse_systemd_ini(\%unit_data, "$_") - } - # Handle drop-in template-unit instance overrides - if ($unit_path ne $base_unit_path) { - foreach (glob("${unit_path}.d/*.conf")) { - parse_systemd_ini(\%unit_data, "$_") - } - } - return %unit_data; -} - -# Checks whether a specified boolean in a systemd unit is true -# or false, with a default that is applied when the value is not set. -sub parse_systemd_bool { - my ($unit_config, $section_name, $bool_name, $default) = @_; - - my @values = @{$unit_config->{$section_name}{$bool_name} // []}; - # Return default if value is not set - if ((scalar(@values) < 1) || (not defined($values[-1]))) { - return $default; - } - # If value is defined multiple times, use the last definition - my $last_value = $values[-1]; - # These are valid values as of systemd.syntax(7) - return $last_value eq "1" || $last_value eq "yes" || $last_value eq "true" || $last_value eq "on"; -} - -# Writes a unit name into a given file to be more resilient against -# crashes of the script. Does nothing when the action is dry-activate. -sub record_unit { - my ($fn, $unit) = @_; - if ($action ne "dry-activate") { - write_file($fn, { append => 1 }, "$unit\n"); - } - return; -} - -# The opposite of record_unit, removes a unit name from a file -sub unrecord_unit { - my ($fn, $unit) = @_; - if ($action ne "dry-activate") { - edit_file(sub { s/^$unit\n//msx }, $fn); - } - return; -} - -# Compare the contents of two unit files and return whether the unit -# needs to be restarted or reloaded. If the units differ, the service -# is restarted unless the only difference is `X-Reload-Triggers` in the -# `Unit` section. If this is the only modification, the unit is reloaded -# instead of restarted. If the only difference is `Options` in the -# `[Mount]` section, the unit is reloaded rather than restarted. -# Returns: -# - 0 if the units are equal -# - 1 if the units are different and a restart action is required -# - 2 if the units are different and a reload action is required -sub compare_units { ## no critic(Subroutines::ProhibitExcessComplexity) - my ($cur_unit, $new_unit) = @_; - my $ret = 0; - # Keys to ignore in the [Unit] section - my %unit_section_ignores = map { $_ => 1 } qw( - X-Reload-Triggers - Description Documentation - OnFailure OnSuccess OnFailureJobMode - IgnoreOnIsolate StopWhenUnneeded - RefuseManualStart RefuseManualStop - AllowIsolate CollectMode - SourcePath - ); - - my $comp_array = sub { - my ($a, $b) = @_; - return join("\0", @{$a}) eq join("\0", @{$b}); - }; - - # Comparison hash for the sections - my %section_cmp = map { $_ => 1 } keys(%{$new_unit}); - # Iterate over the sections - foreach my $section_name (keys(%{$cur_unit})) { - # Missing section in the new unit? - if (not exists($section_cmp{$section_name})) { - # If the [Unit] section was removed, make sure that only keys - # were in it that are ignored - if ($section_name eq "Unit") { - foreach my $ini_key (keys(%{$cur_unit->{"Unit"}})) { - if (not defined($unit_section_ignores{$ini_key})) { - return 1; - } - } - next; # check the next section - } else { - return 1; - } - if ($section_name eq "Unit" and %{$cur_unit->{"Unit"}} == 1 and defined(%{$cur_unit->{"Unit"}}{"X-Reload-Triggers"})) { - # If a new [Unit] section was removed that only contained X-Reload-Triggers, - # do nothing. - next; - } else { - return 1; - } - } - delete $section_cmp{$section_name}; - # Comparison hash for the section contents - my %ini_cmp = map { $_ => 1 } keys(%{$new_unit->{$section_name}}); - # Iterate over the keys of the section - foreach my $ini_key (keys(%{$cur_unit->{$section_name}})) { - delete $ini_cmp{$ini_key}; - my @cur_value = @{$cur_unit->{$section_name}{$ini_key}}; - # If the key is missing in the new unit, they are different... - if (not $new_unit->{$section_name}{$ini_key}) { - # ... unless the key that is now missing is one of the ignored keys - if ($section_name eq "Unit" and defined($unit_section_ignores{$ini_key})) { - next; - } - return 1; - } - my @new_value = @{$new_unit->{$section_name}{$ini_key}}; - # If the contents are different, the units are different - if (not $comp_array->(\@cur_value, \@new_value)) { - # Check if only the reload triggers changed or one of the ignored keys - if ($section_name eq "Unit") { - if ($ini_key eq "X-Reload-Triggers") { - $ret = 2; - next; - } elsif (defined($unit_section_ignores{$ini_key})) { - next; - } - } - # If this is a mount unit, check if it was only `Options` - if ($section_name eq "Mount" and $ini_key eq "Options") { - $ret = 2; - next; - } - return 1; - } - } - # A key was introduced that was missing in the previous unit - if (%ini_cmp) { - if ($section_name eq "Unit") { - foreach my $ini_key (keys(%ini_cmp)) { - if ($ini_key eq "X-Reload-Triggers") { - $ret = 2; - } elsif (defined($unit_section_ignores{$ini_key})) { - next; - } else { - return 1; - } - } - } else { - return 1; - } - }; - } - # A section was introduced that was missing in the previous unit - if (%section_cmp) { - if (%section_cmp == 1 and defined($section_cmp{"Unit"})) { - foreach my $ini_key (keys(%{$new_unit->{"Unit"}})) { - if (not defined($unit_section_ignores{$ini_key})) { - return 1; - } elsif ($ini_key eq "X-Reload-Triggers") { - $ret = 2; - } - } - } else { - return 1; - } - } - - return $ret; -} - -# Called when a unit exists in both the old systemd and the new system and the units -# differ. This figures out of what units are to be stopped, restarted, reloaded, started, and skipped. -sub handle_modified_unit { ## no critic(Subroutines::ProhibitManyArgs, Subroutines::ProhibitExcessComplexity) - my ($unit, $base_name, $new_unit_file, $new_base_unit_file, $new_unit_info, $active_cur, $units_to_stop, $units_to_start, $units_to_reload, $units_to_restart, $units_to_skip) = @_; - - if ($unit eq "sysinit.target" || $unit eq "basic.target" || $unit eq "multi-user.target" || $unit eq "graphical.target" || $unit =~ /\.path$/msx || $unit =~ /\.slice$/msx) { - # Do nothing. These cannot be restarted directly. - - # Slices and Paths don't have to be restarted since - # properties (resource limits and inotify watches) - # seem to get applied on daemon-reload. - } elsif ($unit =~ /\.mount$/msx) { - # Just restart the unit. We wouldn't have gotten into this subroutine - # if only `Options` was changed, in which case the unit would be reloaded. - # The only exception is / and /nix because it's very unlikely we can safely - # unmount them so we reload them instead. This means that we may not get - # all changes into the running system but it's better than crashing it. - if ($unit eq "-.mount" or $unit eq "nix.mount") { - $units_to_reload->{$unit} = 1; - record_unit($reload_list_file, $unit); - } else { - $units_to_restart->{$unit} = 1; - record_unit($restart_list_file, $unit); - } - } elsif ($unit =~ /\.socket$/msx) { - # FIXME: do something? - # Attempt to fix this: https://github.com/NixOS/nixpkgs/pull/141192 - # Revert of the attempt: https://github.com/NixOS/nixpkgs/pull/147609 - # More details: https://github.com/NixOS/nixpkgs/issues/74899#issuecomment-981142430 - } else { - my %new_unit_info = $new_unit_info ? %{$new_unit_info} : parse_unit($new_unit_file, $new_base_unit_file); - if (parse_systemd_bool(\%new_unit_info, "Service", "X-ReloadIfChanged", 0) and not $units_to_restart->{$unit} and not $units_to_stop->{$unit}) { - $units_to_reload->{$unit} = 1; - record_unit($reload_list_file, $unit); - } - elsif ($unit eq "dbus.service" || $unit eq "dbus-broker.service") { - # dbus service should only ever be reloaded, not started/stoped/restarted as that would break the system. - } - elsif (!parse_systemd_bool(\%new_unit_info, "Service", "X-RestartIfChanged", 1) || parse_systemd_bool(\%new_unit_info, "Unit", "RefuseManualStop", 0) || parse_systemd_bool(\%new_unit_info, "Unit", "X-OnlyManualStart", 0)) { - $units_to_skip->{$unit} = 1; - } else { - # It doesn't make sense to stop and start non-services because - # they can't have ExecStop= - if (!parse_systemd_bool(\%new_unit_info, "Service", "X-StopIfChanged", 1) || $unit !~ /\.service$/msx) { - # This unit should be restarted instead of - # stopped and started. - $units_to_restart->{$unit} = 1; - record_unit($restart_list_file, $unit); - # Remove from units to reload so we don't restart and reload - if ($units_to_reload->{$unit}) { - delete $units_to_reload->{$unit}; - unrecord_unit($reload_list_file, $unit); - } - } else { - # If this unit is socket-activated, then stop the - # socket unit(s) as well, and restart the - # socket(s) instead of the service. - my $socket_activated = 0; - if ($unit =~ /\.service$/msx) { - my @sockets = split(/\s+/msx, join(" ", @{$new_unit_info{Service}{Sockets} // []})); - if (scalar(@sockets) == 0) { - @sockets = ("$base_name.socket"); - } - foreach my $socket (@sockets) { - if (defined($active_cur->{$socket})) { - # We can now be sure this is a socket-activate unit - - $units_to_stop->{$socket} = 1; - # Only restart sockets that actually - # exist in new configuration: - if (-e "$toplevel/etc/systemd/system/$socket") { - $units_to_start->{$socket} = 1; - if ($units_to_start eq $units_to_restart) { - record_unit($restart_list_file, $socket); - } else { - record_unit($start_list_file, $socket); - } - $socket_activated = 1; - } - # Remove from units to reload so we don't restart and reload - if ($units_to_reload->{$unit}) { - delete $units_to_reload->{$unit}; - unrecord_unit($reload_list_file, $unit); - } - } - } - } - - if (parse_systemd_bool(\%new_unit_info, "Service", "X-NotSocketActivated", 0)) { - # If the unit explicitly opts out of socket - # activation, restart it as if it weren't (but do - # restart its sockets, that's fine): - $socket_activated = 0; - } - - # If the unit is not socket-activated, record - # that this unit needs to be started below. - # We write this to a file to ensure that the - # service gets restarted if we're interrupted. - if (!$socket_activated) { - $units_to_start->{$unit} = 1; - if ($units_to_start eq $units_to_restart) { - record_unit($restart_list_file, $unit); - } else { - record_unit($start_list_file, $unit); - } - } - - $units_to_stop->{$unit} = 1; - # Remove from units to reload so we don't restart and reload - if ($units_to_reload->{$unit}) { - delete $units_to_reload->{$unit}; - unrecord_unit($reload_list_file, $unit); - } - } - } - } - return; -} - -# Figure out what units need to be stopped, started, restarted or reloaded. -my (%units_to_stop, %units_to_skip, %units_to_start, %units_to_restart, %units_to_reload); - -my %units_to_filter; # units not shown - -%units_to_start = map { $_ => 1 } - split(/\n/msx, read_file($start_list_file, err_mode => "quiet") // ""); - -%units_to_restart = map { $_ => 1 } - split(/\n/msx, read_file($restart_list_file, err_mode => "quiet") // ""); - -%units_to_reload = map { $_ => 1 } - split(/\n/msx, read_file($reload_list_file, err_mode => "quiet") // ""); - -my $active_cur = get_active_units(); -while (my ($unit, $state) = each(%{$active_cur})) { - my $cur_unit_file = "/etc/systemd/system/$unit"; - my $new_unit_file = "$toplevel/etc/systemd/system/$unit"; - - my $base_unit = $unit; - my $cur_base_unit_file = $cur_unit_file; - my $new_base_unit_file = $new_unit_file; - - # Detect template instances. - if (!-e $cur_unit_file && !-e $new_unit_file && $unit =~ /^(.*)@[^\.]*\.(.*)$/msx) { - $base_unit = "$1\@.$2"; - $cur_base_unit_file = "/etc/systemd/system/$base_unit"; - $new_base_unit_file = "$toplevel/etc/systemd/system/$base_unit"; - } - - my $base_name = $base_unit; - $base_name =~ s/\.[[:lower:]]*$//msx; - - if (-e $cur_base_unit_file && ($state->{state} eq "active" || $state->{state} eq "activating")) { - if (! -e $new_base_unit_file || abs_path($new_base_unit_file) eq "/dev/null") { - my %cur_unit_info = parse_unit($cur_unit_file, $cur_base_unit_file); - if (parse_systemd_bool(\%cur_unit_info, "Unit", "X-StopOnRemoval", 1)) { - $units_to_stop{$unit} = 1; - } - } - - elsif ($unit =~ /\.target$/msx) { - my %new_unit_info = parse_unit($new_unit_file, $new_base_unit_file); - - # Cause all active target units to be restarted below. - # This should start most changed units we stop here as - # well as any new dependencies (including new mounts and - # swap devices). FIXME: the suspend target is sometimes - # active after the system has resumed, which probably - # should not be the case. Just ignore it. - if ($unit ne "suspend.target" && $unit ne "hibernate.target" && $unit ne "hybrid-sleep.target") { - if (!(parse_systemd_bool(\%new_unit_info, "Unit", "RefuseManualStart", 0) || parse_systemd_bool(\%new_unit_info, "Unit", "X-OnlyManualStart", 0))) { - $units_to_start{$unit} = 1; - record_unit($start_list_file, $unit); - # Don't spam the user with target units that always get started. - if (($ENV{"STC_DISPLAY_ALL_UNITS"} // "") ne "1") { - $units_to_filter{$unit} = 1; - } - } - } - - # Stop targets that have X-StopOnReconfiguration set. - # This is necessary to respect dependency orderings - # involving targets: if unit X starts after target Y and - # target Y starts after unit Z, then if X and Z have both - # changed, then X should be restarted after Z. However, - # if target Y is in the "active" state, X and Z will be - # restarted at the same time because X's dependency on Y - # is already satisfied. Thus, we need to stop Y first. - # Stopping a target generally has no effect on other units - # (unless there is a PartOf dependency), so this is just a - # bookkeeping thing to get systemd to do the right thing. - if (parse_systemd_bool(\%new_unit_info, "Unit", "X-StopOnReconfiguration", 0)) { - $units_to_stop{$unit} = 1; - } - } - - else { - my %cur_unit_info = parse_unit($cur_unit_file, $cur_base_unit_file); - my %new_unit_info = parse_unit($new_unit_file, $new_base_unit_file); - my $diff = compare_units(\%cur_unit_info, \%new_unit_info); - if ($diff == 1) { - handle_modified_unit($unit, $base_name, $new_unit_file, $new_base_unit_file, \%new_unit_info, $active_cur, \%units_to_stop, \%units_to_start, \%units_to_reload, \%units_to_restart, \%units_to_skip); - } elsif ($diff == 2 and not $units_to_restart{$unit}) { - $units_to_reload{$unit} = 1; - record_unit($reload_list_file, $unit); - } - } - } -} - -# Converts a path to the name of a systemd mount unit that would be responsible -# for mounting this path. -sub path_to_unit_name { - my ($path) = @_; - # Use current version of systemctl binary before daemon is reexeced. - open(my $cmd, "-|", "$cur_systemd/systemd-escape", "--suffix=mount", "-p", $path) - or die "Unable to escape $path!\n"; - my $escaped = do { local $/ = undef; <$cmd> }; - chomp($escaped); - close($cmd) or die("Unable to close systemd-escape pipe"); - return $escaped; -} - -# Compare the previous and new fstab to figure out which filesystems -# need a remount or need to be unmounted. New filesystems are mounted -# automatically by starting local-fs.target. FIXME: might be nicer if -# we generated units for all mounts; then we could unify this with the -# unit checking code above. -my ($cur_fss, $cur_swaps) = parse_fstab("/etc/fstab"); -my ($new_fss, $new_swaps) = parse_fstab("$toplevel/etc/fstab"); -foreach my $mount_point (keys(%{$cur_fss})) { - my $cur = $cur_fss->{$mount_point}; - my $new = $new_fss->{$mount_point}; - my $unit = path_to_unit_name($mount_point); - if (!defined($new)) { - # Filesystem entry disappeared, so unmount it. - $units_to_stop{$unit} = 1; - } elsif ($cur->{fsType} ne $new->{fsType} || $cur->{device} ne $new->{device}) { - if ($mount_point eq '/' or $mount_point eq '/nix') { - if ($cur->{options} ne $new->{options}) { - # Mount options changed, so remount it. - $units_to_reload{$unit} = 1; - record_unit($reload_list_file, $unit); - } else { - # Don't unmount / or /nix if the device changed - $units_to_skip{$unit} = 1; - } - } else { - # Filesystem type or device changed, so unmount and mount it. - $units_to_restart{$unit} = 1; - record_unit($restart_list_file, $unit); - } - } elsif ($cur->{options} ne $new->{options}) { - # Mount options changes, so remount it. - $units_to_reload{$unit} = 1; - record_unit($reload_list_file, $unit); - } -} - -# Also handles swap devices. -foreach my $device (keys(%{$cur_swaps})) { - my $cur = $cur_swaps->{$device}; - my $new = $new_swaps->{$device}; - if (!defined($new)) { - # Swap entry disappeared, so turn it off. Can't use - # "systemctl stop" here because systemd has lots of alias - # units that prevent a stop from actually calling - # "swapoff". - if ($action eq "dry-activate") { - print STDERR "would stop swap device: $device\n"; - } else { - print STDERR "stopping swap device: $device\n"; - system("@utillinux@/sbin/swapoff", $device); - } - } - # FIXME: update swap options (i.e. its priority). -} - - -# Should we have systemd re-exec itself? -my $cur_pid1_path = abs_path("/proc/1/exe") // "/unknown"; -my $cur_systemd_system_config = abs_path("/etc/systemd/system.conf") // "/unknown"; -my $new_pid1_path = abs_path("$new_systemd/lib/systemd/systemd") or die; -my $new_systemd_system_config = abs_path("$toplevel/etc/systemd/system.conf") // "/unknown"; - -my $restart_systemd = $cur_pid1_path ne $new_pid1_path; -if ($cur_systemd_system_config ne $new_systemd_system_config) { - $restart_systemd = 1; -} - -# Takes an array of unit names and returns an array with the same elements, -# except all units that are also in the global variable `unitsToFilter`. -sub filter_units { - my ($units) = @_; - my @res; - foreach my $unit (sort(keys(%{$units}))) { - if (!defined($units_to_filter{$unit})) { - push(@res, $unit); - } - } - return @res; -} - -my @units_to_stop_filtered = filter_units(\%units_to_stop); - - -# Show dry-run actions. -if ($action eq "dry-activate") { - if (scalar(@units_to_stop_filtered) > 0) { - print STDERR "would stop the following units: ", join(", ", @units_to_stop_filtered), "\n"; - } - if (scalar(keys(%units_to_skip)) > 0) { - print STDERR "would NOT stop the following changed units: ", join(", ", sort(keys(%units_to_skip))), "\n"; - } - - print STDERR "would activate the configuration...\n"; - system("$out/dry-activate", "$out"); - - # Handle the activation script requesting the restart or reload of a unit. - foreach (split(/\n/msx, read_file($dry_restart_by_activation_file, err_mode => "quiet") // "")) { - my $unit = $_; - my $new_unit_file = "$toplevel/etc/systemd/system/$unit"; - my $base_unit = $unit; - my $new_base_unit_file = $new_unit_file; - - # Detect template instances. - if (!-e $new_unit_file && $unit =~ /^(.*)@[^\.]*\.(.*)$/msx) { - $base_unit = "$1\@.$2"; - $new_base_unit_file = "$toplevel/etc/systemd/system/$base_unit"; - } - - my $base_name = $base_unit; - $base_name =~ s/\.[[:lower:]]*$//msx; - - # Start units if they were not active previously - if (not defined($active_cur->{$unit})) { - $units_to_start{$unit} = 1; - next; - } - - handle_modified_unit($unit, $base_name, $new_unit_file, $new_base_unit_file, undef, $active_cur, \%units_to_restart, \%units_to_restart, \%units_to_reload, \%units_to_restart, \%units_to_skip); - } - unlink($dry_restart_by_activation_file); - - foreach (split(/\n/msx, read_file($dry_reload_by_activation_file, err_mode => "quiet") // "")) { - my $unit = $_; - - if (defined($active_cur->{$unit}) and not $units_to_restart{$unit} and not $units_to_stop{$unit}) { - $units_to_reload{$unit} = 1; - record_unit($reload_list_file, $unit); - } - } - unlink($dry_reload_by_activation_file); - - if ($restart_systemd) { - print STDERR "would restart systemd\n"; - } - if (scalar(keys(%units_to_reload)) > 0) { - print STDERR "would reload the following units: ", join(", ", sort(keys(%units_to_reload))), "\n"; - } - if (scalar(keys(%units_to_restart)) > 0) { - print STDERR "would restart the following units: ", join(", ", sort(keys(%units_to_restart))), "\n"; - } - my @units_to_start_filtered = filter_units(\%units_to_start); - if (scalar(@units_to_start_filtered)) { - print STDERR "would start the following units: ", join(", ", @units_to_start_filtered), "\n"; - } - exit 0; -} - - -syslog(LOG_NOTICE, "switching to system configuration $toplevel"); - -if (scalar(keys(%units_to_stop)) > 0) { - if (scalar(@units_to_stop_filtered)) { - print STDERR "stopping the following units: ", join(", ", @units_to_stop_filtered), "\n"; - } - # Use current version of systemctl binary before daemon is reexeced. - system("$cur_systemd/systemctl", "stop", "--", sort(keys(%units_to_stop))); -} - -if (scalar(keys(%units_to_skip)) > 0) { - print STDERR "NOT restarting the following changed units: ", join(", ", sort(keys(%units_to_skip))), "\n"; -} - -# Activate the new configuration (i.e., update /etc, make accounts, -# and so on). -my $res = 0; -print STDERR "activating the configuration...\n"; -system("$out/activate", "$out") == 0 or $res = 2; - -# Handle the activation script requesting the restart or reload of a unit. -foreach (split(/\n/msx, read_file($restart_by_activation_file, err_mode => "quiet") // "")) { - my $unit = $_; - my $new_unit_file = "$toplevel/etc/systemd/system/$unit"; - my $base_unit = $unit; - my $new_base_unit_file = $new_unit_file; - - # Detect template instances. - if (!-e $new_unit_file && $unit =~ /^(.*)@[^\.]*\.(.*)$/msx) { - $base_unit = "$1\@.$2"; - $new_base_unit_file = "$toplevel/etc/systemd/system/$base_unit"; - } - - my $base_name = $base_unit; - $base_name =~ s/\.[[:lower:]]*$//msx; - - # Start units if they were not active previously - if (not defined($active_cur->{$unit})) { - $units_to_start{$unit} = 1; - record_unit($start_list_file, $unit); - next; - } - - handle_modified_unit($unit, $base_name, $new_unit_file, $new_base_unit_file, undef, $active_cur, \%units_to_restart, \%units_to_restart, \%units_to_reload, \%units_to_restart, \%units_to_skip); -} -# We can remove the file now because it has been propagated to the other restart/reload files -unlink($restart_by_activation_file); - -foreach (split(/\n/msx, read_file($reload_by_activation_file, err_mode => "quiet") // "")) { - my $unit = $_; - - if (defined($active_cur->{$unit}) and not $units_to_restart{$unit} and not $units_to_stop{$unit}) { - $units_to_reload{$unit} = 1; - record_unit($reload_list_file, $unit); - } -} -# We can remove the file now because it has been propagated to the other reload file -unlink($reload_by_activation_file); - -# Restart systemd if necessary. Note that this is done using the -# current version of systemd, just in case the new one has trouble -# communicating with the running pid 1. -if ($restart_systemd) { - print STDERR "restarting systemd...\n"; - system("$cur_systemd/systemctl", "daemon-reexec") == 0 or $res = 2; -} - -# Forget about previously failed services. -system("$new_systemd/bin/systemctl", "reset-failed"); - -# Make systemd reload its units. -system("$new_systemd/bin/systemctl", "daemon-reload") == 0 or $res = 3; - -# Reload user units -open(my $list_active_users, "-|", "$new_systemd/bin/loginctl", "list-users", "--no-legend") || die("Unable to call loginctl"); -while (my $f = <$list_active_users>) { - if ($f !~ /^\s*(?\d+)\s+(?\S+)/msx) { - next; - } - my ($uid, $name) = ($+{uid}, $+{user}); - print STDERR "reloading user units for $name...\n"; - - system("@su@", "-s", "@shell@", "-l", $name, "-c", - "export XDG_RUNTIME_DIR=/run/user/$uid; " . - "$cur_systemd/systemctl --user daemon-reexec; " . - "$new_systemd/bin/systemctl --user start nixos-activation.service"); -} - -close($list_active_users) || die("Unable to close the file handle to loginctl"); - -# Restart sysinit-reactivation.target. -# This target only exists to restart services ordered before sysinit.target. We -# cannot use X-StopOnReconfiguration to restart sysinit.target because then ALL -# services of the system would be restarted since all normal services have a -# default dependency on sysinit.target. sysinit-reactivation.target ensures -# that services ordered BEFORE sysinit.target get re-started in the correct -# order. Ordering between these services is respected. -print STDERR "restarting sysinit-reactivation.target\n"; -system("$new_systemd/bin/systemctl", "restart", "sysinit-reactivation.target") == 0 or $res = 4; - -# Before reloading we need to ensure that the units are still active. They may have been -# deactivated because one of their requirements got stopped. If they are inactive -# but should have been reloaded, the user probably expects them to be started. -if (scalar(keys(%units_to_reload)) > 0) { - for my $unit (keys(%units_to_reload)) { - if (!unit_is_active($unit)) { - # Figure out if we need to start the unit - my %unit_info = parse_unit("$toplevel/etc/systemd/system/$unit", "$toplevel/etc/systemd/system/$unit"); - if (!(parse_systemd_bool(\%unit_info, "Unit", "RefuseManualStart", 0) || parse_systemd_bool(\%unit_info, "Unit", "X-OnlyManualStart", 0))) { - $units_to_start{$unit} = 1; - record_unit($start_list_file, $unit); - } - # Don't reload the unit, reloading would fail - delete %units_to_reload{$unit}; - unrecord_unit($reload_list_file, $unit); - } - } -} -# Reload units that need it. This includes remounting changed mount -# units. -if (scalar(keys(%units_to_reload)) > 0) { - print STDERR "reloading the following units: ", join(", ", sort(keys(%units_to_reload))), "\n"; - system("$new_systemd/bin/systemctl", "reload", "--", sort(keys(%units_to_reload))) == 0 or $res = 4; - unlink($reload_list_file); -} - -# Restart changed services (those that have to be restarted rather -# than stopped and started). -if (scalar(keys(%units_to_restart)) > 0) { - print STDERR "restarting the following units: ", join(", ", sort(keys(%units_to_restart))), "\n"; - system("$new_systemd/bin/systemctl", "restart", "--", sort(keys(%units_to_restart))) == 0 or $res = 4; - unlink($restart_list_file); -} - -# Start all active targets, as well as changed units we stopped above. -# The latter is necessary because some may not be dependencies of the -# targets (i.e., they were manually started). FIXME: detect units -# that are symlinks to other units. We shouldn't start both at the -# same time because we'll get a "Failed to add path to set" error from -# systemd. -my @units_to_start_filtered = filter_units(\%units_to_start); -if (scalar(@units_to_start_filtered)) { - print STDERR "starting the following units: ", join(", ", @units_to_start_filtered), "\n" -} -system("$new_systemd/bin/systemctl", "start", "--", sort(keys(%units_to_start))) == 0 or $res = 4; -unlink($start_list_file); - - -# Print failed and new units. -my (@failed, @new); -my $active_new = get_active_units(); -while (my ($unit, $state) = each(%{$active_new})) { - if ($state->{state} eq "failed") { - push(@failed, $unit); - next; - } - - if ($state->{substate} eq "auto-restart") { - # A unit in auto-restart substate is a failure *if* it previously failed to start - open(my $main_status_fd, "-|", "$new_systemd/bin/systemctl", "show", "--value", "--property=ExecMainStatus", $unit) || die("Unable to call 'systemctl show'"); - my $main_status = do { local $/ = undef; <$main_status_fd> }; - close($main_status_fd) || die("Unable to close 'systemctl show' fd"); - chomp($main_status); - - if ($main_status ne "0") { - push(@failed, $unit); - next; - } - } - - # Ignore scopes since they are not managed by this script but rather - # created and managed by third-party services via the systemd dbus API. - # This only lists units that are not failed (including ones that are in auto-restart but have not failed previously) - if ($state->{state} ne "failed" && !defined($active_cur->{$unit}) && $unit !~ /\.scope$/msx) { - push(@new, $unit); - } -} - -if (scalar(@new) > 0) { - print STDERR "the following new units were started: ", join(", ", sort(@new)), "\n" -} - -if (scalar(@failed) > 0) { - my @failed_sorted = sort(@failed); - print STDERR "warning: the following units failed: ", join(", ", @failed_sorted), "\n\n"; - system("$new_systemd/bin/systemctl status --no-pager --full '" . join("' '", @failed_sorted) . "' >&2"); - $res = 4; -} - -if ($res == 0) { - syslog(LOG_NOTICE, "finished switching to system configuration $toplevel"); -} else { - syslog(LOG_ERR, "switching to system configuration $toplevel failed (status $res)"); -} - -close($stc_lock) or die "Could not close lock - $!"; -exit($res); diff --git a/nixos/modules/system/activation/switchable-system.nix b/nixos/modules/system/activation/switchable-system.nix index 4783a0704740..a2e804e8a788 100644 --- a/nixos/modules/system/activation/switchable-system.nix +++ b/nixos/modules/system/activation/switchable-system.nix @@ -5,101 +5,49 @@ ... }: -let - perlWrapped = pkgs.perl.withPackages ( - p: with p; [ - ConfigIniFiles - FileSlurp - ] - ); -in { - options.system.switch = { - enable = lib.mkOption { - type = lib.types.bool; - default = true; - description = '' - Whether to include the capability to switch configurations. - - Disabling this makes the system unable to be reconfigured via `nixos-rebuild`. - - This is good for image based appliances where updates are handled - outside the image. Reducing features makes the image lighter and - slightly more secure. - ''; - }; - - enableNg = lib.mkOption { - type = lib.types.bool; - default = config.system.switch.enable; - defaultText = lib.literalExpression "config.system.switch.enable"; - description = '' - Whether to use `switch-to-configuration-ng`, the Rust-based - re-implementation of the original Perl `switch-to-configuration`. - ''; - }; - }; - - config = lib.mkMerge [ - (lib.mkIf (config.system.switch.enable && !config.system.switch.enableNg) { - warnings = [ - '' - The Perl implementation of switch-to-configuration will be deprecated - and removed in the 25.05 release of NixOS. Please migrate to the - newer implementation by removing `system.switch.enableNg = false` - from your configuration. If you are unable to migrate due to any - issues with the new implementation, please create an issue and tag - the maintainers of `switch-to-configuration-ng`. - '' - ]; - - system.activatableSystemBuilderCommands = '' - mkdir $out/bin - substitute ${./switch-to-configuration.pl} $out/bin/switch-to-configuration \ - --subst-var out \ - --subst-var-by toplevel ''${!toplevelVar} \ - --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.preSwitchChecksScript} \ - --subst-var-by localeArchive "${config.i18n.glibcLocales}/lib/locale/locale-archive" \ - --subst-var-by perl "${perlWrapped}" \ - --subst-var-by shell "${pkgs.bash}/bin/sh" \ - --subst-var-by su "${pkgs.shadow.su}/bin/su" \ - --subst-var-by systemd "${config.systemd.package}" \ - --subst-var-by utillinux "${pkgs.util-linux}" \ - ; - - chmod +x $out/bin/switch-to-configuration - ${lib.optionalString (pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform) '' - if ! output=$(${perlWrapped}/bin/perl -c $out/bin/switch-to-configuration 2>&1); then - echo "switch-to-configuration syntax is not valid:" - echo "$output" - exit 1 - fi - ''} - ''; - }) - (lib.mkIf config.system.switch.enableNg { - # Use a subshell so we can source makeWrapper's setup hook without - # affecting the rest of activatableSystemBuilderCommands. - system.activatableSystemBuilderCommands = '' - ( - source ${pkgs.buildPackages.makeWrapper}/nix-support/setup-hook - - mkdir $out/bin - ln -sf ${lib.getExe pkgs.switch-to-configuration-ng} $out/bin/switch-to-configuration - wrapProgram $out/bin/switch-to-configuration \ - --set OUT $out \ - --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.preSwitchChecksScript} \ - --set LOCALE_ARCHIVE ${config.i18n.glibcLocales}/lib/locale/locale-archive \ - --set SYSTEMD ${config.systemd.package} - ) - ''; - }) + imports = [ + (lib.mkRemovedOptionModule [ "system" "switch" "enableNg" ] '' + This option controlled the usage of the new switch-to-configuration-ng, + which is now the only switch-to-configuration implementation. This option + can be removed from configuration. If there are outstanding issues + preventing you from using the new implementation, please open an issue on + GitHub. + '') ]; + options.system.switch.enable = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Whether to include the capability to switch configurations. + + Disabling this makes the system unable to be reconfigured via `nixos-rebuild`. + + This is good for image based appliances where updates are handled + outside the image. Reducing features makes the image lighter and + slightly more secure. + ''; + }; + + config = lib.mkIf config.system.switch.enable { + # Use a subshell so we can source makeWrapper's setup hook without + # affecting the rest of activatableSystemBuilderCommands. + system.activatableSystemBuilderCommands = '' + ( + source ${pkgs.buildPackages.makeWrapper}/nix-support/setup-hook + + mkdir $out/bin + ln -sf ${lib.getExe pkgs.switch-to-configuration-ng} $out/bin/switch-to-configuration + wrapProgram $out/bin/switch-to-configuration \ + --set OUT $out \ + --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.preSwitchChecksScript} \ + --set LOCALE_ARCHIVE ${config.i18n.glibcLocales}/lib/locale/locale-archive \ + --set SYSTEMD ${config.systemd.package} + ) + ''; + }; } diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 32982001696b..b05096765c00 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -1283,14 +1283,7 @@ in swapspace = handleTestOn [ "aarch64-linux" "x86_64-linux" ] ./swapspace.nix { }; sway = runTest ./sway.nix; swayfx = runTest ./swayfx.nix; - switchTest = runTest { - imports = [ ./switch-test.nix ]; - defaults.system.switch.enableNg = false; - }; - switchTestNg = runTest { - imports = [ ./switch-test.nix ]; - defaults.system.switch.enableNg = true; - }; + switchTest = runTest ./switch-test.nix; sx = runTest ./sx.nix; sympa = runTest ./sympa.nix; syncthing = runTest ./syncthing.nix; diff --git a/nixos/tests/switch-test.nix b/nixos/tests/switch-test.nix index daf605f64667..18defdfc9d76 100644 --- a/nixos/tests/switch-test.nix +++ b/nixos/tests/switch-test.nix @@ -663,7 +663,7 @@ in ''; # Returns a comma separated representation of the given list in sorted - # order, that matches the output format of switch-to-configuration.pl + # order, that matches the output format of switch-to-configuration sortedUnits = xs: lib.concatStringsSep ", " (builtins.sort builtins.lessThan xs); dbusService = diff --git a/pkgs/applications/editors/neovim/utils.nix b/pkgs/applications/editors/neovim/utils.nix index 69aa638d05a0..490753ebb840 100644 --- a/pkgs/applications/editors/neovim/utils.nix +++ b/pkgs/applications/editors/neovim/utils.nix @@ -227,12 +227,9 @@ let ) vimPlugins.nvim-treesitter.grammarPlugins; isNvimGrammar = x: builtins.elem x nvimGrammars; - toNvimTreesitterGrammar = callPackage ( - { }: - makeSetupHook { - name = "to-nvim-treesitter-grammar"; - } ./to-nvim-treesitter-grammar.sh - ) { }; + toNvimTreesitterGrammar = makeSetupHook { + name = "to-nvim-treesitter-grammar"; + } ./to-nvim-treesitter-grammar.sh; in (toVimPlugin ( diff --git a/pkgs/applications/emulators/libretro/cores/handy.nix b/pkgs/applications/emulators/libretro/cores/handy.nix index fe046d5eaf38..4d9f9ec997f7 100644 --- a/pkgs/applications/emulators/libretro/cores/handy.nix +++ b/pkgs/applications/emulators/libretro/cores/handy.nix @@ -5,13 +5,13 @@ }: mkLibretroCore { core = "handy"; - version = "0-unstable-2024-10-21"; + version = "0-unstable-2025-06-16"; src = fetchFromGitHub { owner = "libretro"; repo = "libretro-handy"; - rev = "4e9e072796e5552a9d57f6ab83b3f85f27b17fb6"; - hash = "sha256-ThzFEqLCX2JC06n6GZgkGzX5sFY5CxFDjkeekXRmbXY="; + rev = "fca239207e9c111da3e85d2faf0b1b9d7524e498"; + hash = "sha256-8RpRhGgW5JWY6TZa9CEaXF66WpbjcjprorVqu+FGYu0="; }; makefile = "Makefile"; diff --git a/pkgs/applications/networking/cluster/k3s/docs/USAGE.md b/pkgs/applications/networking/cluster/k3s/docs/USAGE.md index e3f3dfb8d38c..1ddeba7a7132 100644 --- a/pkgs/applications/networking/cluster/k3s/docs/USAGE.md +++ b/pkgs/applications/networking/cluster/k3s/docs/USAGE.md @@ -64,3 +64,37 @@ Tip: If you run into connectivity issues between nodes for specific applications K3s has a config setting `prefer-bundled-bin` (and CLI flag `--prefer-bundled-bin`) that makes k3s use binaries from the `/var/lib/rancher/k3s/data/current/bin/aux/` directory, as unpacked by the k3s binary, before the system `$PATH`. This works with the official distribution of k3s but not with the package from nixpkgs, as it does not bundle the upstream binaries from [`k3s-root`](https://github.com/k3s-io/k3s-root) into the k3s binary. Thus the `prefer-bundled-bin` setting **cannot** be used to work around issues (like [this `mount` regression](https://github.com/util-linux/util-linux/issues/3474)) with binaries used/called by the kubelet. + +### Building from a different source + +Because the package is split into multiple derivations and the build process is generally more complex, it is not very obvious how to build k3s from a different source (fork or arbitrary commit). + +To build k3s from a different source, you must use `.override` together with `overrideBundleAttrs` (for the k3sBundle derivation) and another `.overrideAttrs` (for the final derivation): + +```nix +{ fetchgit, k3s }: +let + k3sRepo = fetchgit { + url = "https://github.com/k3s-io/k3s"; + rev = "99d91538b1327da933356c318dc8040335fbb66c"; + hash = "sha256-vVqZzVp0Tea27s8HDVq4SgqlbHBdZcFzNKmPFi0Yktk="; + }; + vendorHash = "sha256-jrPVY+FVZV9wlbik/I35W8ChcLrHlYbLAwUYU16mJLM="; +in +(k3s.override { + overrideBundleAttrs = { + src = k3sRepo; + inherit vendorHash; + }; +}).overrideAttrs + { + src = k3sRepo; + inherit vendorHash; + } +``` + +- Additionally to `overrideBundleAttrs` there are also: `overrideCniPluginsAttrs` and `overrideContainerdAttrs`. +- `k3s --version` still prints the commit SHA (`k3sCommit` passed into `builder.nix`) from the "base" package instead of the actually used `rev`. +- Depending on the changes made in the fork / commit, the `k3s.override` (without the `overrideAttrs` of the final derivation) might already be enough. +- If the commit is for a different version of k3s, make sure to use the correct "base" package, e.g., `k3s_1_31.override`. Otherwise the build fails with `Tagged version 'v1.33.1+k3s1' does not match expected version 'v1.31.9[+-]*'` +- When adding an entirely new k3s version by calling `builder.nix`, keep in mind that the `k3sCommit` parameter is not used as the `k3sRepo` `rev` (it uses `v${k3sVersion}`). Therefore, you additionally must override the package, as shown above. diff --git a/pkgs/applications/networking/p2p/deluge/default.nix b/pkgs/applications/networking/p2p/deluge/default.nix index 9472c7b0aa0e..668bd4298d66 100644 --- a/pkgs/applications/networking/p2p/deluge/default.nix +++ b/pkgs/applications/networking/p2p/deluge/default.nix @@ -68,7 +68,7 @@ let nativeCheckInputs = with pypkgs; [ pytestCheckHook pytest-twisted - pytest-cov + pytest-cov-stub mock mccabe pylint diff --git a/pkgs/applications/search/recoll/0001-no-qtgui-darwin-bundle.patch b/pkgs/applications/search/recoll/0001-no-qtgui-darwin-bundle.patch index 1f3a71fb3c9b..166700c2d077 100644 --- a/pkgs/applications/search/recoll/0001-no-qtgui-darwin-bundle.patch +++ b/pkgs/applications/search/recoll/0001-no-qtgui-darwin-bundle.patch @@ -1,39 +1,28 @@ -From 9a0102fe1da038ebe08107ead991964df11b0271 Mon Sep 17 00:00:00 2001 -From: annalee <150648636+a-n-n-a-l-e-e@users.noreply.github.com> -Date: Mon, 19 Feb 2024 03:31:20 +0000 -Subject: [PATCH] no qtgui darwin bundle - ---- - qtgui/recoll.pro.in | 11 +++++++++-- - 1 file changed, 9 insertions(+), 2 deletions(-) - -diff --git a/qtgui/recoll.pro.in b/qtgui/recoll.pro.in -index a0ef314..6dbc3b5 100644 --- a/qtgui/recoll.pro.in +++ b/qtgui/recoll.pro.in -@@ -180,7 +180,7 @@ windows { - } +@@ -192,7 +192,7 @@ + } } --macx: { +-macx:macxbundlebuild() { +if (false) { - QCBUILDLOC=Qt_6_4_2_for_macOS - - # QT += webkit webkitwidgets -@@ -375,7 +375,7 @@ macx: { + QCBUILDLOC=Qt_6_7_3_for_macOS + RECOLLDEPS = $$PWD/../../.. + QMAKE_APPLE_DEVICE_ARCHS = x86_64 arm64 +@@ -402,7 +402,7 @@ QMAKE_BUNDLE_DATA = APP_EXAMPLES APP_EXAMPLES_MAC APP_FILTERS APP_IMAGES APP_DOC } --unix:!macx { +-unix:!macxbundlebuild() { +unix { VPATH = @srcdir@ - -@@ -400,6 +400,13 @@ VPATH = @srcdir@ + # For SingleApplication +@@ -425,6 +425,13 @@ SOURCES += crontool.cpp \ rtitool.cpp -+ macx { ++ macxbundlebuild() { + SOURCES += ../utils/closefrom.cpp \ + ../utils/execmd.cpp \ + ../utils/netcon.cpp \ @@ -43,6 +32,3 @@ index a0ef314..6dbc3b5 100644 FORMS += crontool.ui \ rtitool.ui --- -2.43.0 - diff --git a/pkgs/applications/search/recoll/default.nix b/pkgs/applications/search/recoll/default.nix index bad287cc9153..21911c93390d 100644 --- a/pkgs/applications/search/recoll/default.nix +++ b/pkgs/applications/search/recoll/default.nix @@ -75,11 +75,11 @@ in mkDerivation rec { pname = "recoll"; - version = "1.39.1"; + version = "1.43.2"; src = fetchurl { url = "https://www.recoll.org/${pname}-${version}.tar.gz"; - hash = "sha256-Eeadj/AnuztCb7VIYEy4hKbduH3CzK53tADvI9+PWmQ="; + hash = "sha256-FbDXknumjktcikOfAe4FKtPmggJGGHasq8dpD+8mNzE="; }; mesonFlags = @@ -107,13 +107,10 @@ mkDerivation rec { ]; env.NIX_CFLAGS_COMPILE = toString [ - "-DNIXPKGS" "-fpermissive" # libxml2-2.12 changed const qualifiers ]; patches = [ - # fix "No/bad main configuration file" error - ./fix-datadir.patch # use the same configure based build for darwin as linux ./0001-no-qtgui-darwin-bundle.patch ]; diff --git a/pkgs/applications/search/recoll/fix-datadir.patch b/pkgs/applications/search/recoll/fix-datadir.patch deleted file mode 100644 index 7d5471b636e8..000000000000 --- a/pkgs/applications/search/recoll/fix-datadir.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/utils/rclutil.cpp b/utils/rclutil.cpp -index 6bafc119..d997cd17 100644 ---- a/utils/rclutil.cpp -+++ b/utils/rclutil.cpp -@@ -279,7 +279,7 @@ const string& path_pkgdatadir() - "a subfolder of the installation directory. \n" - "Please set the RECOLL_DATADIR environment variable to point to it\n" - "(e.g. setx RECOLL_DATADIR \"C:/Program Files (X86)/Recoll/Share)\"\n"; --#elif defined(__APPLE__) && defined(RECOLL_AS_MAC_BUNDLE) -+#elif defined(__APPLE__) && defined(RECOLL_AS_MAC_BUNDLE) && defined(NIXPKGS) - // The package manager builds (Macports, Homebrew, Nixpkgs ...) all arrange to set a proper - // compiled value for RECOLL_DATADIR. We can't do this when building a native bundle with - // QCreator, in which case we use the executable location. diff --git a/pkgs/applications/window-managers/i3/bumblebee-status/plugins.nix b/pkgs/applications/window-managers/i3/bumblebee-status/plugins.nix index 7881b46eac43..10cb5a565772 100644 --- a/pkgs/applications/window-managers/i3/bumblebee-status/plugins.nix +++ b/pkgs/applications/window-managers/i3/bumblebee-status/plugins.nix @@ -1,12 +1,12 @@ { pkgs, - python, + python3, ... }: # propagatedBuildInputs are for Python libraries and executables # buildInputs are for libraries let - py = python.pkgs; + py = python3.pkgs; in { amixer.propagatedBuildInputs = [ pkgs.alsa-utils ]; diff --git a/pkgs/build-support/rust/hooks/default.nix b/pkgs/build-support/rust/hooks/default.nix index d66804b07ab7..1499380e728b 100644 --- a/pkgs/build-support/rust/hooks/default.nix +++ b/pkgs/build-support/rust/hooks/default.nix @@ -1,16 +1,12 @@ { - buildPackages, - callPackage, - cargo, cargo-nextest, clang, diffutils, lib, makeSetupHook, - maturin, rust, - rustc, stdenv, + pkgsHostTarget, pkgsTargetTarget, # This confusingly-named parameter indicates the *subdirectory of @@ -21,138 +17,118 @@ pkgsCross, }: { - cargoBuildHook = callPackage ( - { }: - makeSetupHook { - name = "cargo-build-hook.sh"; - substitutions = { - inherit (stdenv.targetPlatform.rust) rustcTarget; - inherit (rust.envVars) setEnv; + cargoBuildHook = makeSetupHook { + name = "cargo-build-hook.sh"; + substitutions = { + inherit (stdenv.targetPlatform.rust) rustcTarget; + inherit (rust.envVars) setEnv; + }; + passthru.tests = + { + test = tests.rust-hooks.cargoBuildHook; + } + // lib.optionalAttrs (stdenv.isLinux) { + testCross = pkgsCross.riscv64.tests.rust-hooks.cargoBuildHook; }; - passthru.tests = - { - test = tests.rust-hooks.cargoBuildHook; - } - // lib.optionalAttrs (stdenv.isLinux) { - testCross = pkgsCross.riscv64.tests.rust-hooks.cargoBuildHook; - }; - } ./cargo-build-hook.sh - ) { }; + } ./cargo-build-hook.sh; - cargoCheckHook = callPackage ( - { }: - makeSetupHook { - name = "cargo-check-hook.sh"; - substitutions = { - inherit (stdenv.targetPlatform.rust) rustcTarget; - inherit (rust.envVars) setEnv; + cargoCheckHook = makeSetupHook { + name = "cargo-check-hook.sh"; + substitutions = { + inherit (stdenv.targetPlatform.rust) rustcTarget; + inherit (rust.envVars) setEnv; + }; + passthru.tests = + { + test = tests.rust-hooks.cargoCheckHook; + } + // lib.optionalAttrs (stdenv.isLinux) { + testCross = pkgsCross.riscv64.tests.rust-hooks.cargoCheckHook; }; - passthru.tests = - { - test = tests.rust-hooks.cargoCheckHook; - } - // lib.optionalAttrs (stdenv.isLinux) { - testCross = pkgsCross.riscv64.tests.rust-hooks.cargoCheckHook; - }; - } ./cargo-check-hook.sh - ) { }; + } ./cargo-check-hook.sh; - cargoInstallHook = callPackage ( - { }: - makeSetupHook { - name = "cargo-install-hook.sh"; - substitutions = { - targetSubdirectory = target; + cargoInstallHook = makeSetupHook { + name = "cargo-install-hook.sh"; + substitutions = { + targetSubdirectory = target; + }; + passthru.tests = + { + test = tests.rust-hooks.cargoInstallHook; + } + // lib.optionalAttrs (stdenv.isLinux) { + testCross = pkgsCross.riscv64.tests.rust-hooks.cargoInstallHook; }; - passthru.tests = - { - test = tests.rust-hooks.cargoInstallHook; - } - // lib.optionalAttrs (stdenv.isLinux) { - testCross = pkgsCross.riscv64.tests.rust-hooks.cargoInstallHook; - }; - } ./cargo-install-hook.sh - ) { }; + } ./cargo-install-hook.sh; - cargoNextestHook = callPackage ( - { }: - makeSetupHook { - name = "cargo-nextest-hook.sh"; - propagatedBuildInputs = [ cargo-nextest ]; - substitutions = { - inherit (stdenv.targetPlatform.rust) rustcTarget; + cargoNextestHook = makeSetupHook { + name = "cargo-nextest-hook.sh"; + propagatedBuildInputs = [ cargo-nextest ]; + substitutions = { + inherit (stdenv.targetPlatform.rust) rustcTarget; + }; + passthru.tests = + { + test = tests.rust-hooks.cargoNextestHook; + } + // lib.optionalAttrs (stdenv.isLinux) { + testCross = pkgsCross.riscv64.tests.rust-hooks.cargoNextestHook; }; - passthru.tests = - { - test = tests.rust-hooks.cargoNextestHook; - } - // lib.optionalAttrs (stdenv.isLinux) { - testCross = pkgsCross.riscv64.tests.rust-hooks.cargoNextestHook; - }; - } ./cargo-nextest-hook.sh - ) { }; + } ./cargo-nextest-hook.sh; - cargoSetupHook = callPackage ( - { }: - makeSetupHook { - name = "cargo-setup-hook.sh"; - propagatedBuildInputs = [ ]; - substitutions = { - defaultConfig = ../fetchcargo-default-config.toml; + cargoSetupHook = makeSetupHook { + name = "cargo-setup-hook.sh"; + propagatedBuildInputs = [ ]; + substitutions = { + defaultConfig = ../fetchcargo-default-config.toml; - # Specify the stdenv's `diff` by abspath to ensure that the user's build - # inputs do not cause us to find the wrong `diff`. - diff = "${lib.getBin diffutils}/bin/diff"; + # Specify the stdenv's `diff` by abspath to ensure that the user's build + # inputs do not cause us to find the wrong `diff`. + diff = "${lib.getBin diffutils}/bin/diff"; - cargoConfig = - lib.optionalString (stdenv.hostPlatform.config != stdenv.targetPlatform.config) '' - [target."${stdenv.targetPlatform.rust.rustcTarget}"] - "linker" = "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc" - "rustflags" = [ "-C", "target-feature=${ - if pkgsTargetTarget.stdenv.targetPlatform.isStatic then "+" else "-" - }crt-static" ] - '' - + '' - [target."${stdenv.hostPlatform.rust.rustcTarget}"] - "linker" = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" - ''; + cargoConfig = + lib.optionalString (stdenv.hostPlatform.config != stdenv.targetPlatform.config) '' + [target."${stdenv.targetPlatform.rust.rustcTarget}"] + "linker" = "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}cc" + "rustflags" = [ "-C", "target-feature=${ + if pkgsTargetTarget.stdenv.targetPlatform.isStatic then "+" else "-" + }crt-static" ] + '' + + '' + [target."${stdenv.hostPlatform.rust.rustcTarget}"] + "linker" = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" + ''; + }; + + passthru.tests = + { + test = tests.rust-hooks.cargoSetupHook; + } + // lib.optionalAttrs (stdenv.isLinux) { + testCross = pkgsCross.riscv64.tests.rust-hooks.cargoSetupHook; }; - passthru.tests = - { - test = tests.rust-hooks.cargoSetupHook; - } - // lib.optionalAttrs (stdenv.isLinux) { - testCross = pkgsCross.riscv64.tests.rust-hooks.cargoSetupHook; - }; - } ./cargo-setup-hook.sh - ) { }; + } ./cargo-setup-hook.sh; - maturinBuildHook = callPackage ( - { pkgsHostTarget }: - makeSetupHook { - name = "maturin-build-hook.sh"; - propagatedBuildInputs = [ - pkgsHostTarget.maturin - pkgsHostTarget.cargo - pkgsHostTarget.rustc - ]; - substitutions = { - inherit (stdenv.targetPlatform.rust) rustcTarget; - inherit (rust.envVars) setEnv; + maturinBuildHook = makeSetupHook { + name = "maturin-build-hook.sh"; + propagatedBuildInputs = [ + pkgsHostTarget.maturin + pkgsHostTarget.cargo + pkgsHostTarget.rustc + ]; + substitutions = { + inherit (stdenv.targetPlatform.rust) rustcTarget; + inherit (rust.envVars) setEnv; - }; - } ./maturin-build-hook.sh - ) { }; + }; + } ./maturin-build-hook.sh; - bindgenHook = callPackage ( - { }: - makeSetupHook { - name = "rust-bindgen-hook"; - substitutions = { - libclang = (lib.getLib clang.cc); - inherit clang; - }; - } ./rust-bindgen-hook.sh - ) { }; + bindgenHook = makeSetupHook { + name = "rust-bindgen-hook"; + substitutions = { + libclang = (lib.getLib clang.cc); + inherit clang; + }; + } ./rust-bindgen-hook.sh; } diff --git a/pkgs/by-name/ba/bash-language-server/package.nix b/pkgs/by-name/ba/bash-language-server/package.nix index d1b787529e21..49e85c9f6661 100644 --- a/pkgs/by-name/ba/bash-language-server/package.nix +++ b/pkgs/by-name/ba/bash-language-server/package.nix @@ -1,39 +1,39 @@ { lib, - stdenv, + stdenvNoCC, fetchFromGitHub, - pnpm_8, + pnpm_10, nodejs, makeBinaryWrapper, shellcheck, versionCheckHook, }: -stdenv.mkDerivation (finalAttrs: { +stdenvNoCC.mkDerivation (finalAttrs: { pname = "bash-language-server"; - version = "5.4.0"; + version = "5.6.0"; src = fetchFromGitHub { owner = "bash-lsp"; repo = "bash-language-server"; - rev = "server-${finalAttrs.version}"; - hash = "sha256-yJ81oGd9aNsWQMLvDSgMVVH1//Mw/SVFYFIPsJTQYzE="; + tag = "server-${finalAttrs.version}"; + hash = "sha256-Pe32lQSlyWcyUbqwhfoulwNwhrnWdRcKFIl3Jj0Skac="; }; pnpmWorkspaces = [ "bash-language-server" ]; - pnpmDeps = pnpm_8.fetchDeps { + pnpmDeps = pnpm_10.fetchDeps { inherit (finalAttrs) pname version src pnpmWorkspaces ; - hash = "sha256-W25xehcxncBs9QgQBt17F5YHK0b+GDEmt27XzTkyYWg="; + hash = "sha256-NvyqPv5OKgZi3hW98Da8LhsYatmrzrPX8kLOfLr+BrI="; }; nativeBuildInputs = [ nodejs - pnpm_8.configHook + pnpm_10.configHook makeBinaryWrapper versionCheckHook ]; @@ -45,31 +45,46 @@ stdenv.mkDerivation (finalAttrs: { runHook postBuild ''; + preInstall = '' + # remove unnecessary files + rm node_modules/.modules.yaml + pnpm --ignore-scripts --prod prune + rm -r node_modules/.pnpm/@mixmark-io*/node_modules/@mixmark-io/domino/{test,.yarn} + find -type f \( -name "*.ts" -o -name "*.map" \) -exec rm -rf {} + + # https://github.com/pnpm/pnpm/issues/3645 + find node_modules server/node_modules -xtype l -delete + + # remove non-deterministic files + rm node_modules/{.modules.yaml,.pnpm-workspace-state.json} + ''; + installPhase = '' runHook preInstall - pnpm --offline \ - --frozen-lockfile --ignore-script \ - --filter=bash-language-server \ - deploy --prod $out/lib/bash-language-server + mkdir -p $out/{bin,lib/bash-language-server} + cp -r {node_modules,server} $out/lib/bash-language-server/ # Create the executable, based upon what happens in npmHooks.npmInstallHook makeWrapper ${lib.getExe nodejs} $out/bin/bash-language-server \ --suffix PATH : ${lib.makeBinPath [ shellcheck ]} \ --inherit-argv0 \ - --add-flags $out/lib/bash-language-server/out/cli.js + --add-flags $out/lib/bash-language-server/server/out/cli.js runHook postInstall ''; doInstallCheck = true; - meta = with lib; { + meta = { description = "Language server for Bash"; homepage = "https://github.com/bash-lsp/bash-language-server"; - license = licenses.mit; - maintainers = with maintainers; [ doronbehar ]; + changelog = "https://github.com/bash-lsp/bash-language-server/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ + doronbehar + gepbird + ]; mainProgram = "bash-language-server"; - platforms = platforms.all; + platforms = lib.platforms.all; }; }) diff --git a/pkgs/by-name/be/bepasty/package.nix b/pkgs/by-name/be/bepasty/package.nix index 51309a35da9b..4c7c92a84d8d 100644 --- a/pkgs/by-name/be/bepasty/package.nix +++ b/pkgs/by-name/be/bepasty/package.nix @@ -57,7 +57,7 @@ bepastyPython.pkgs.buildPythonPackage rec { build flake8 pytestCheckHook - pytest-cov + pytest-cov-stub selenium tox twine diff --git a/pkgs/by-name/bu/buku/package.nix b/pkgs/by-name/bu/buku/package.nix index edf76eadacc1..ee862b474df0 100644 --- a/pkgs/by-name/bu/buku/package.nix +++ b/pkgs/by-name/bu/buku/package.nix @@ -40,14 +40,14 @@ buildPythonApplication rec { nativeCheckInputs = [ hypothesis - pytest + pytestCheckHook pytest-recording pyyaml mypy-extensions click pylint flake8 - pytest-cov + pytest-cov-stub pyyaml ]; diff --git a/pkgs/by-name/bu/burpsuite/package.nix b/pkgs/by-name/bu/burpsuite/package.nix index b0602201ac8d..fe76eff92b0b 100644 --- a/pkgs/by-name/bu/burpsuite/package.nix +++ b/pkgs/by-name/bu/burpsuite/package.nix @@ -9,20 +9,20 @@ }: let - version = "2025.6"; + version = "2025.6.1"; product = if proEdition then { productName = "pro"; productDesktop = "Burp Suite Professional Edition"; - hash = "sha256-UtxyhXaXpVp9Ynm6vnHYxr+TEnRau1ZHU563xcUmu/0="; + hash = "sha256-At3+tScMbNrZI2qF+kwt41khou8aP5Qn33v6IT7n9HI="; } else { productName = "community"; productDesktop = "Burp Suite Community Edition"; - hash = "sha256-5kpmLkdnGxnt6bSUgAIJaXdFSmmvOffdQaAOlm9sNlo="; + hash = "sha256-1reZGan6hmXTg7RUjaian6Q5VAsR5iuye4kGWkpREM4="; }; src = fetchurl { diff --git a/pkgs/by-name/ca/canaille/package.nix b/pkgs/by-name/ca/canaille/package.nix index d53f3648d64e..5c2d23b62323 100644 --- a/pkgs/by-name/ca/canaille/package.nix +++ b/pkgs/by-name/ca/canaille/package.nix @@ -58,7 +58,7 @@ python.pkgs.buildPythonApplication rec { coverage flask-webtest pyquery - pytest-cov + pytest-cov-stub pytest-httpserver pytest-lazy-fixtures pytest-smtpd diff --git a/pkgs/by-name/ca/cargo-llvm-cov/package.nix b/pkgs/by-name/ca/cargo-llvm-cov/package.nix index 1ad5df27c772..cddf9e4845da 100644 --- a/pkgs/by-name/ca/cargo-llvm-cov/package.nix +++ b/pkgs/by-name/ca/cargo-llvm-cov/package.nix @@ -52,7 +52,7 @@ rustPlatform.buildRustPackage (finalAttrs: { # pull in fixtures needed for the test suite src = fetchFromGitHub { inherit owner; - repo = pname; + repo = "cargo-llvm-cov"; rev = "v${version}"; sha256 = "sha256-iJrnNDSMich5OzEbPgnQWLVz6Zj/MUIzEsaBzqVdoDg="; }; diff --git a/pkgs/by-name/ca/cargo-xbuild/package.nix b/pkgs/by-name/ca/cargo-xbuild/package.nix index 973edf44d469..f47b9201d981 100644 --- a/pkgs/by-name/ca/cargo-xbuild/package.nix +++ b/pkgs/by-name/ca/cargo-xbuild/package.nix @@ -10,7 +10,7 @@ rustPlatform.buildRustPackage rec { src = fetchFromGitHub { owner = "rust-osdev"; - repo = pname; + repo = "cargo-xbuild"; rev = "v${version}"; hash = "sha256-29rCjmzxxIjR5nBN2J3xxP+r8NnPIJV90FkSQQEBbo4="; }; diff --git a/pkgs/by-name/ch/chawan/package.nix b/pkgs/by-name/ch/chawan/package.nix index 1611018bdb78..0ae78cb3df46 100644 --- a/pkgs/by-name/ch/chawan/package.nix +++ b/pkgs/by-name/ch/chawan/package.nix @@ -11,18 +11,18 @@ pkg-config, brotli, zlib, - unstableGitUpdater, + gitUpdater, }: -stdenv.mkDerivation { +stdenv.mkDerivation (finalAttrs: { pname = "chawan"; - version = "0-unstable-2025-06-14"; + version = "0.2.0"; src = fetchFromSourcehut { owner = "~bptato"; repo = "chawan"; - rev = "288896b6f3da9bb6e4e24190d4163e031f8a2751"; - hash = "sha256-/8pp1E4YAXXh8ORRHseIe48BIG14u8gNkmotA+CXPYY="; + rev = "v${finalAttrs.version}"; + hash = "sha256-DiA7SEXPJTScdoFeGzH45wZP6gZRU8t/fvJLOufuNmU="; }; patches = [ ./mancha-augment-path.diff ]; @@ -73,7 +73,7 @@ stdenv.mkDerivation { wrapProgram $out/bin/mancha ${makeWrapperArgs} ''; - passthru.updateScript = unstableGitUpdater { }; + passthru.updateScript = gitUpdater { rev-prefix = "v"; }; meta = { description = "Lightweight and featureful terminal web browser"; @@ -83,4 +83,4 @@ stdenv.mkDerivation { maintainers = with lib.maintainers; [ ]; mainProgram = "cha"; }; -} +}) diff --git a/pkgs/by-name/cl/cloudsmith-cli/package.nix b/pkgs/by-name/cl/cloudsmith-cli/package.nix index 130676bcc1dc..093ace78d56e 100644 --- a/pkgs/by-name/cl/cloudsmith-cli/package.nix +++ b/pkgs/by-name/cl/cloudsmith-cli/package.nix @@ -51,7 +51,7 @@ python3.pkgs.buildPythonApplication rec { nativeCheckInputs = with python3.pkgs; [ pytestCheckHook - pytest-cov + pytest-cov-stub ]; checkInputs = with python3.pkgs; [ diff --git a/pkgs/by-name/cl/clps2c-compiler/package.nix b/pkgs/by-name/cl/clps2c-compiler/package.nix index ab776f2db4c4..ff73a5399c16 100644 --- a/pkgs/by-name/cl/clps2c-compiler/package.nix +++ b/pkgs/by-name/cl/clps2c-compiler/package.nix @@ -31,7 +31,7 @@ buildDotnetModule rec { (fetchFromGitHub { name = pname; inherit owner; - repo = pname; + repo = "CLPS2C-Compiler"; rev = "CLPS2C-Compiler-${version}"; sha256 = "sha256-4gLdrIxyw9BFSxF+EXZqTgUf9Kik6oK7eO9HBUzk4QM="; }) diff --git a/pkgs/by-name/cp/cpptrace/0001-Use-libdwarf-2-as-the-base-include-path.patch b/pkgs/by-name/cp/cpptrace/0001-Use-libdwarf-2-as-the-base-include-path.patch new file mode 100644 index 000000000000..58b72702449e --- /dev/null +++ b/pkgs/by-name/cp/cpptrace/0001-Use-libdwarf-2-as-the-base-include-path.patch @@ -0,0 +1,51 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Philip Taron +Date: Thu, 19 Jun 2025 09:24:32 -0700 +Subject: [PATCH] Use libdwarf-2 as the base include path + +Signed-off-by: Philip Taron +--- + CMakeLists.txt | 6 +++--- + src/symbols/dwarf/dwarf.hpp | 4 ++-- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1c607bd44e528a41ccd637f5293b4f56049f5770..53e1aedf463c5eb95dcfd77fa40de66f51381b47 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -419,7 +419,7 @@ if(CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF) + target_link_libraries(${target_name} PRIVATE ${LIBDWARF_LIBRARIES}) + endif() + # There seems to be no consistency at all about where libdwarf decides to place its headers........ Figure out if +- # it's libdwarf/libdwarf.h and libdwarf/dwarf.h or just libdwarf.h and dwarf.h ++ # it's libdwarf-2/libdwarf.h and libdwarf-2/dwarf.h or just libdwarf.h and dwarf.h + include(CheckIncludeFileCXX) + # libdwarf's cmake doesn't properly set variables to indicate where its libraries live + if(NOT CPPTRACE_FIND_LIBDWARF_WITH_PKGCONFIG) +@@ -428,9 +428,9 @@ if(CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF) + target_include_directories(${target_name} PRIVATE ${LIBDWARF_INCLUDE_DIRS}) + endif() + set(CMAKE_REQUIRED_INCLUDES ${LIBDWARF_INCLUDE_DIRS}) +- CHECK_INCLUDE_FILE_CXX("libdwarf/libdwarf.h" LIBDWARF_IS_NESTED) ++ CHECK_INCLUDE_FILE_CXX("libdwarf-2/libdwarf.h" LIBDWARF_IS_NESTED) + CHECK_INCLUDE_FILE_CXX("libdwarf.h" LIBDWARF_IS_NOT_NESTED) +- # check_include_file("libdwarf/libdwarf.h" LIBDWARF_IS_NESTED) ++ # check_include_file("libdwarf-2/libdwarf.h" LIBDWARF_IS_NESTED) + # check_support(LIBDWARF_IS_NESTED nested_libdwarf_include.cpp "" "" "") + if(${LIBDWARF_IS_NESTED}) + target_compile_definitions(${target_name} PRIVATE CPPTRACE_USE_NESTED_LIBDWARF_HEADER_PATH) +diff --git a/src/symbols/dwarf/dwarf.hpp b/src/symbols/dwarf/dwarf.hpp +index 50b2696148584b7a16da602017793797ba98cb58..53fe275492f4fd7e8e905064696e86f837a55f72 100644 +--- a/src/symbols/dwarf/dwarf.hpp ++++ b/src/symbols/dwarf/dwarf.hpp +@@ -10,8 +10,8 @@ + #include + + #ifdef CPPTRACE_USE_NESTED_LIBDWARF_HEADER_PATH +- #include +- #include ++ #include ++ #include + #else + #include + #include diff --git a/pkgs/by-name/cp/cpptrace/package.nix b/pkgs/by-name/cp/cpptrace/package.nix index 0a9b0cc43d51..7e174005a80d 100644 --- a/pkgs/by-name/cp/cpptrace/package.nix +++ b/pkgs/by-name/cp/cpptrace/package.nix @@ -14,21 +14,26 @@ stdenv.mkDerivation (finalAttrs: { pname = "cpptrace"; - version = "0.8.3"; + version = "1.0.1"; src = fetchFromGitHub { owner = "jeremy-rifkin"; repo = "cpptrace"; tag = "v${finalAttrs.version}"; - hash = "sha256-oFwRFFDLl4/3szVj/ge8cSrpuuHEzf4VsCPGTE0dxRc="; + hash = "sha256-HUUyH9N+e98Gp6TPeT6TCGpdzd09knHVDaQ3KeDp8LY="; }; + patches = [ + ./0001-Use-libdwarf-2-as-the-base-include-path.patch + ]; + nativeBuildInputs = [ cmake pkg-config ]; - buildInputs = [ libdwarf ]; + buildInputs = [ (lib.getDev libdwarf) ]; + propagatedBuildInputs = [ zstd ] ++ (lib.optionals static [ libdwarf ]); cmakeFlags = [ @@ -40,6 +45,7 @@ stdenv.mkDerivation (finalAttrs: { ]; checkInputs = [ gtest ]; + doCheck = true; passthru = { diff --git a/pkgs/by-name/de/defaultbrowser/package.nix b/pkgs/by-name/de/defaultbrowser/package.nix index a08d7aa2516c..b8c82b800345 100644 --- a/pkgs/by-name/de/defaultbrowser/package.nix +++ b/pkgs/by-name/de/defaultbrowser/package.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "kerma"; - repo = pname; + repo = "defaultbrowser"; rev = "d2860c00dd7fbb5d615232cc819d7d492a6a6ddb"; sha256 = "sha256-SelUQXoKtShcDjq8uKg3wM0kG2opREa2DGQCDd6IsOQ="; }; diff --git a/pkgs/by-name/de/dep-tree/package.nix b/pkgs/by-name/de/dep-tree/package.nix index 3b63c653b10e..0cc31f828d4c 100644 --- a/pkgs/by-name/de/dep-tree/package.nix +++ b/pkgs/by-name/de/dep-tree/package.nix @@ -39,7 +39,7 @@ buildGoModule { src = fetchFromGitHub { owner = "gabotechs"; - repo = pname; + repo = "dep-tree"; rev = "v${version}"; hash = "sha256-m+afcnwVvPrD+S7c/kfE8mqlD7kO+VPI6sSXCCjXWZM="; }; diff --git a/pkgs/by-name/du/duti/package.nix b/pkgs/by-name/du/duti/package.nix index 6d46f002ae13..e9175191a3b6 100644 --- a/pkgs/by-name/du/duti/package.nix +++ b/pkgs/by-name/du/duti/package.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { version = "1.5.5pre"; src = fetchFromGitHub { owner = "moretension"; - repo = pname; + repo = "duti"; rev = "fe3d3dc411bcea6af7a8cbe53c0e08ed5ecacdb2"; sha256 = "1pg4i6ghpib2gy1sqpml7dbnhr1vbr43fs2pqkd09i4w3nmgpic9"; }; diff --git a/pkgs/by-name/ed/edk2/package.nix b/pkgs/by-name/ed/edk2/package.nix index 04b2905dee99..9b244672a146 100644 --- a/pkgs/by-name/ed/edk2/package.nix +++ b/pkgs/by-name/ed/edk2/package.nix @@ -29,8 +29,6 @@ let "LOONGARCH64" else throw "Unsupported architecture"; - - buildType = if stdenv.hostPlatform.isDarwin then "CLANGPDB" else "GCC5"; in stdenv.mkDerivation (finalAttrs: { @@ -172,6 +170,7 @@ stdenv.mkDerivation (finalAttrs: { finalAttrsInner: let attrs = lib.toFunction attrsOrFun finalAttrsInner; + buildType = attrs.buildType or (if stdenv.hostPlatform.isDarwin then "CLANGPDB" else "GCC5"); in { inherit (finalAttrs) src; diff --git a/pkgs/by-name/em/embellish/package.nix b/pkgs/by-name/em/embellish/package.nix index 7e3ef1eea662..0c7256568c0e 100644 --- a/pkgs/by-name/em/embellish/package.nix +++ b/pkgs/by-name/em/embellish/package.nix @@ -15,6 +15,7 @@ gjs, gnome-autoar, libsoup_3, + nix-update-script, }: stdenv.mkDerivation (finalAttrs: { pname = "embellish"; @@ -47,6 +48,8 @@ stdenv.mkDerivation (finalAttrs: { libsoup_3 ]; + passthru.updateScript = nix-update-script { }; + meta = { description = "User-friendly application designed for managing Nerd Fonts on your system"; longDescription = '' diff --git a/pkgs/by-name/fa/fastcov/package.nix b/pkgs/by-name/fa/fastcov/package.nix index a118d28f7128..861199298db3 100644 --- a/pkgs/by-name/fa/fastcov/package.nix +++ b/pkgs/by-name/fa/fastcov/package.nix @@ -32,7 +32,7 @@ python3Packages.buildPythonPackage rec { dontUseCmakeConfigure = true; # cmake is used for testing nativeCheckInputs = with python3Packages; [ - pytest + pytestCheckHook pytest-cov-stub ]; diff --git a/pkgs/by-name/gi/git-machete/package.nix b/pkgs/by-name/gi/git-machete/package.nix index 8582ef0285ba..325a3975344a 100644 --- a/pkgs/by-name/gi/git-machete/package.nix +++ b/pkgs/by-name/gi/git-machete/package.nix @@ -13,7 +13,7 @@ python3.pkgs.buildPythonApplication rec { src = fetchFromGitHub { owner = "virtuslab"; - repo = pname; + repo = "git-machete"; rev = "v${version}"; hash = "sha256-iSuOiQC+dKqcDCS4nTPMrNFpo3ipPUQhfoofM11UInI="; }; diff --git a/pkgs/by-name/gi/git-pw/package.nix b/pkgs/by-name/gi/git-pw/package.nix index cf9bce02d574..083bea01547c 100644 --- a/pkgs/by-name/gi/git-pw/package.nix +++ b/pkgs/by-name/gi/git-pw/package.nix @@ -36,7 +36,7 @@ python3.pkgs.buildPythonApplication rec { nativeCheckInputs = with python3.pkgs; [ pytest-cov-stub - pytest + pytestCheckHook git ]; diff --git a/pkgs/by-name/gi/gitfs/package.nix b/pkgs/by-name/gi/gitfs/package.nix index 3b9cf7cfe17b..94c4b3868edd 100644 --- a/pkgs/by-name/gi/gitfs/package.nix +++ b/pkgs/by-name/gi/gitfs/package.nix @@ -27,8 +27,8 @@ python3Packages.buildPythonApplication rec { ''; nativeCheckInputs = with python3Packages; [ - pytest - pytest-cov + pytestCheckHook + pytest-cov-stub mock ]; propagatedBuildInputs = with python3Packages; [ @@ -38,8 +38,7 @@ python3Packages.buildPythonApplication rec { six ]; - checkPhase = "py.test"; - doCheck = false; + pythonImportsCheck = [ "gitfs" ]; meta = { description = "FUSE filesystem that fully integrates with git"; @@ -53,5 +52,8 @@ python3Packages.buildPythonApplication rec { platforms = lib.platforms.unix; maintainers = [ lib.maintainers.robbinch ]; mainProgram = "gitfs"; + # requires <=python39, otherwise you get this at runtime: + # AttributeError: module 'collections' has no attribute 'MutableMapping' + broken = true; }; } diff --git a/pkgs/by-name/gi/gitify/package.nix b/pkgs/by-name/gi/gitify/package.nix index b5c18a84eb26..19547d81247d 100644 --- a/pkgs/by-name/gi/gitify/package.nix +++ b/pkgs/by-name/gi/gitify/package.nix @@ -95,7 +95,7 @@ stdenv.mkDerivation (finalAttrs: { desktopName = "Gitify"; exec = "gitify %U"; icon = "gitify"; - comment = "GitHub Notifications on your menu bar."; + comment = "GitHub notifications on your menu bar"; categories = [ "Development" ]; startupWMClass = "Gitify"; }) @@ -104,9 +104,9 @@ stdenv.mkDerivation (finalAttrs: { passthru.updateScript = nix-update-script { }; meta = { - homepage = "https://www.gitify.io/"; + homepage = "https://gitify.io/"; changelog = "https://github.com/gitify-app/gitify/releases/tag/v${finalAttrs.version}"; - description = "GitHub Notifications on your menu bar"; + description = "GitHub notifications on your menu bar"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ pineapplehunter ]; platforms = lib.platforms.all; diff --git a/pkgs/by-name/gn/gnome-session/ctl.nix b/pkgs/by-name/gn/gnome-session/ctl.nix index 45c676f1c7ab..5aecef4ce161 100644 --- a/pkgs/by-name/gn/gnome-session/ctl.nix +++ b/pkgs/by-name/gn/gnome-session/ctl.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "nix-community"; - repo = pname; + repo = "gnome-session-ctl"; rev = version; hash = "sha256-RY0+iIwwjd7268m3EYrZ1yUBLHXmaWddtSxqgUUH6qQ="; }; diff --git a/pkgs/by-name/gr/graphite-gtk-theme/package.nix b/pkgs/by-name/gr/graphite-gtk-theme/package.nix index 1cfef4fcfaaf..9545941f2568 100644 --- a/pkgs/by-name/gr/graphite-gtk-theme/package.nix +++ b/pkgs/by-name/gr/graphite-gtk-theme/package.nix @@ -66,7 +66,7 @@ lib.checkListOfEnum "${pname}: theme variants" src = fetchFromGitHub { owner = "vinceliuice"; - repo = pname; + repo = "graphite-gtk-theme"; rev = version; hash = "sha256-k93l/7DF0HSKPfiIxzBLz0mBflgbdYJyGLEmWZx3q7o="; }; diff --git a/pkgs/by-name/gt/gtk-mac-integration/package.nix b/pkgs/by-name/gt/gtk-mac-integration/package.nix index d2d56bec0da0..b999d13ab46d 100644 --- a/pkgs/by-name/gt/gtk-mac-integration/package.nix +++ b/pkgs/by-name/gt/gtk-mac-integration/package.nix @@ -18,8 +18,8 @@ stdenv.mkDerivation rec { src = fetchFromGitLab { domain = "gitlab.gnome.org"; owner = "GNOME"; - repo = pname; - rev = "${pname}-${version}"; + repo = "gtk-mac-integration"; + rev = "gtk-mac-integration-${version}"; sha256 = "0sc0m3p8r5xfh5i4d7dg72kfixx9yi4f800y43bszyr88y52jkga"; }; diff --git a/pkgs/by-name/ha/hacompanion/package.nix b/pkgs/by-name/ha/hacompanion/package.nix index 327d54960ba0..9ec01b8dee44 100644 --- a/pkgs/by-name/ha/hacompanion/package.nix +++ b/pkgs/by-name/ha/hacompanion/package.nix @@ -2,6 +2,7 @@ lib, fetchFromGitHub, buildGoModule, + nix-update-script, }: buildGoModule rec { @@ -17,6 +18,8 @@ buildGoModule rec { vendorHash = "sha256-y2eSuMCDZTGdCs70zYdA8NKbuPPN5xmnRfMNK+AE/q8="; + passthru.updateScript = nix-update-script { }; + meta = { changelog = "https://github.com/tobias-kuendig/hacompanion/releases/tag/v${version}"; description = "Daemon that sends local hardware information to Home Assistant"; diff --git a/pkgs/by-name/ho/holo-build/package.nix b/pkgs/by-name/ho/holo-build/package.nix index 0ed9d9232b56..81ed3e7a23bf 100644 --- a/pkgs/by-name/ho/holo-build/package.nix +++ b/pkgs/by-name/ho/holo-build/package.nix @@ -13,7 +13,7 @@ buildGoModule rec { src = fetchFromGitHub { owner = "holocm"; - repo = pname; + repo = "holo-build"; rev = "v${version}"; sha256 = "0lypbgf96bcc4m3968xa4il1zwprsdyc0pw6pl9mqq7djxabikd0"; }; diff --git a/pkgs/by-name/it/itch/package.nix b/pkgs/by-name/it/itch/package.nix index 5ce46f34f1d8..52724e4d6aff 100644 --- a/pkgs/by-name/it/itch/package.nix +++ b/pkgs/by-name/it/itch/package.nix @@ -15,7 +15,7 @@ let version = "26.1.9"; itch-setup = fetchzip { - url = "https://broth.itch.ovh/itch-setup/linux-amd64/1.26.0/itch-setup.zip"; + url = "https://broth.itch.zone/itch-setup/linux-amd64/1.26.0/itch-setup.zip"; stripRoot = false; hash = "sha256-5MP6X33Jfu97o5R1n6Og64Bv4ZMxVM0A8lXeQug+bNA="; }; @@ -36,7 +36,7 @@ stdenvNoCC.mkDerivation (finalAttrs: { inherit version; src = fetchzip { - url = "https://broth.itch.ovh/itch/linux-amd64/${finalAttrs.version}/archive/default#.zip"; + url = "https://broth.itch.zone/itch/linux-amd64/${finalAttrs.version}/archive/default#.zip"; stripRoot = false; hash = "sha256-4k6afBgOKGs7rzXAtIBpmuQeeT/Va8/0bZgNYjuJhgI="; }; diff --git a/pkgs/by-name/ka/kanidm/generic.nix b/pkgs/by-name/ka/kanidm/generic.nix index 08ac4c490901..cd4e9e4af0e5 100644 --- a/pkgs/by-name/ka/kanidm/generic.nix +++ b/pkgs/by-name/ka/kanidm/generic.nix @@ -43,8 +43,8 @@ rustPlatform.buildRustPackage rec { cargoDepsName = "kanidm"; src = fetchFromGitHub { - owner = pname; - repo = pname; + owner = "kanidm"; + repo = "kanidm"; rev = "refs/tags/v${version}"; inherit hash; }; diff --git a/pkgs/by-name/kd/kddockwidgets/package.nix b/pkgs/by-name/kd/kddockwidgets/package.nix index 6b3afa39ad12..4799d8cb31e8 100644 --- a/pkgs/by-name/kd/kddockwidgets/package.nix +++ b/pkgs/by-name/kd/kddockwidgets/package.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "KDAB"; - repo = pname; + repo = "KDDockWidgets"; rev = "v${version}"; sha256 = "sha256-4xaTfNwfAIQox2YcusEZJt5f9/Kld+zveFEiIVw5dRc="; }; diff --git a/pkgs/by-name/ke/keeperrl/package.nix b/pkgs/by-name/ke/keeperrl/package.nix index ea8c74e92d14..373c1473a9ec 100644 --- a/pkgs/by-name/ke/keeperrl/package.nix +++ b/pkgs/by-name/ke/keeperrl/package.nix @@ -21,7 +21,7 @@ let free_src = fetchFromGitHub { owner = "miki151"; - repo = pname; + repo = "keeperrl"; rev = version; sha256 = "sha256-0sww+ppctXvxMouclG3OdXpcNgrrOZJw9z8s2GhJ+IE="; }; diff --git a/pkgs/by-name/ke/keycloak/keycloak-metrics-spi/default.nix b/pkgs/by-name/ke/keycloak/keycloak-metrics-spi/default.nix index a595dab70333..49acf107c312 100644 --- a/pkgs/by-name/ke/keycloak/keycloak-metrics-spi/default.nix +++ b/pkgs/by-name/ke/keycloak/keycloak-metrics-spi/default.nix @@ -10,7 +10,7 @@ maven.buildMavenPackage rec { src = fetchFromGitHub { owner = "aerogear"; - repo = pname; + repo = "keycloak-metrics-spi"; rev = "refs/tags/${version}"; hash = "sha256-MMonBRau8FpfCqija6NEdvp4zJfEub2Kwk4MA7FYWHI="; }; diff --git a/pkgs/by-name/li/libcrossguid/package.nix b/pkgs/by-name/li/libcrossguid/package.nix index 3a165303f5ad..ac743a2452a7 100644 --- a/pkgs/by-name/li/libcrossguid/package.nix +++ b/pkgs/by-name/li/libcrossguid/package.nix @@ -6,13 +6,13 @@ }: stdenv.mkDerivation rec { - name = "lib" + pname + "-" + version; + name = "lib" + "crossguid" + "-" + version; pname = "crossguid"; version = "2016-02-21"; src = fetchFromGitHub { owner = "graeme-hill"; - repo = pname; + repo = "crossguid"; rev = "8f399e8bd4252be9952f3dfa8199924cc8487ca4"; sha256 = "1i29y207qqddvaxbn39pk2fbh3gx8zvdprfp35wasj9rw2wjk3s9"; }; diff --git a/pkgs/by-name/li/libdwarf/common.nix b/pkgs/by-name/li/libdwarf/common.nix deleted file mode 100644 index 39abf711bbb0..000000000000 --- a/pkgs/by-name/li/libdwarf/common.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ - lib, - stdenv, - fetchurl, - buildInputs, - hash, - version, - url, - knownVulnerabilities, -}: - -stdenv.mkDerivation { - pname = "libdwarf"; - inherit version; - - src = fetchurl { - inherit url hash; - }; - - configureFlags = [ - "--enable-shared" - "--disable-nonshared" - ]; - - inherit buildInputs; - - outputs = [ - "bin" - "lib" - "dev" - "out" - ]; - - meta = { - homepage = "https://github.com/davea42/libdwarf-code"; - platforms = lib.platforms.unix; - license = lib.licenses.lgpl21Plus; - maintainers = [ lib.maintainers.atry ]; - inherit knownVulnerabilities; - }; -} diff --git a/pkgs/by-name/li/libdwarf/package.nix b/pkgs/by-name/li/libdwarf/package.nix index 539940259b58..9c61445ee549 100644 --- a/pkgs/by-name/li/libdwarf/package.nix +++ b/pkgs/by-name/li/libdwarf/package.nix @@ -1,16 +1,48 @@ { - callPackage, + lib, + stdenv, + fetchFromGitHub, + meson, + ninja, zlib, zstd, }: -callPackage ./common.nix rec { - version = "0.11.1"; - url = "https://www.prevanders.net/libdwarf-${version}.tar.xz"; - hash = "sha512:d927b1d0e8dd1540c2f5da2a9d39b2914bb48225b2b9bdca94e7b36349358e1f537044eadc345f11d75de717fdda07ad99a8a7a5eb45e64fe4c79c37e165012f"; +stdenv.mkDerivation (finalAttrs: { + pname = "libdwarf"; + version = "2.0.0"; + + src = fetchFromGitHub { + owner = "davea42"; + repo = "libdwarf-code"; + tag = "v${finalAttrs.version}"; + hash = "sha256-SsFg+7zGBEGxDSzfiIP5bxdttlBkhEiEQWaU12hINas="; + }; + + nativeBuildInputs = [ + meson + ninja + ]; + buildInputs = [ zlib zstd ]; - knownVulnerabilities = [ ]; -} + + outputs = [ + "bin" + "lib" + "dev" + "out" + ]; + + meta = { + description = "Library for reading DWARF2 and later DWARF"; + mainProgram = "dwarfdump"; + homepage = "https://github.com/davea42/libdwarf-code"; + changelog = "https://github.com/davea42/libdwarf-code/releases/tag/v${finalAttrs.version}/CHANGELOG.md"; + platforms = lib.platforms.unix; + license = lib.licenses.lgpl21Plus; + maintainers = [ lib.maintainers.atry ]; + }; +}) diff --git a/pkgs/by-name/li/librespeed-cli/package.nix b/pkgs/by-name/li/librespeed-cli/package.nix index 893183bee5d8..b2a64f0fdbcb 100644 --- a/pkgs/by-name/li/librespeed-cli/package.nix +++ b/pkgs/by-name/li/librespeed-cli/package.nix @@ -7,16 +7,16 @@ buildGoModule rec { pname = "librespeed-cli"; - version = "1.0.10"; + version = "1.0.12"; src = fetchFromGitHub { owner = "librespeed"; repo = "speedtest-cli"; tag = "v${version}"; - hash = "sha256-LFGlKYWUaHi/byoRPD6zsdr0U5r0zWxxRa2NJNB2yb8="; + hash = "sha256-njaQ/Be5rDCqkZJkij0nRi8aIO5uZYo8t3BjIcdKoCM="; }; - vendorHash = "sha256-psZyyySpY06J+ji+9uHUtX7Ks1hzZC3zINszYP75NfQ="; + vendorHash = "sha256-dmaq9+0FjqYh2ZLg8bu8cPJZ9QClcvwid1nmsftmrf0="; # Tests have additional requirements doCheck = false; diff --git a/pkgs/by-name/li/lite-xl/package.nix b/pkgs/by-name/li/lite-xl/package.nix index 44c478e7209e..c690b84dff08 100644 --- a/pkgs/by-name/li/lite-xl/package.nix +++ b/pkgs/by-name/li/lite-xl/package.nix @@ -5,46 +5,53 @@ lua5_4, meson, ninja, + cmake, pcre2, pkg-config, - SDL2, + sdl3, stdenv, }: - -stdenv.mkDerivation rec { +let pname = "lite-xl"; - version = "2.1.7"; + version = "2.1.8"; +in +stdenv.mkDerivation { + inherit pname version; src = fetchFromGitHub { owner = "lite-xl"; repo = "lite-xl"; rev = "v${version}"; - hash = "sha256-Ig0XDxnll/zruAwWHwuXiqumBXgAPxuK0E1ELupvcXo="; + hash = "sha256-9JpD7f5vOGhLW8dBjjYUI5PSaz/XWW5sIOZCAbKhxtE="; }; nativeBuildInputs = [ meson ninja pkg-config + cmake ]; buildInputs = [ freetype lua5_4 pcre2 - SDL2 + sdl3 ]; mesonFlags = [ "-Duse_system_lua=true" ]; - meta = with lib; { + meta = { description = "Lightweight text editor written in Lua"; homepage = "https://github.com/lite-xl/lite-xl"; - license = licenses.mit; - maintainers = with maintainers; [ sefidel ]; - platforms = platforms.unix; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ + luftmensch-luftmensch + sefidel + ]; + platforms = lib.platforms.unix; mainProgram = "lite-xl"; }; } diff --git a/pkgs/by-name/lx/lxqt-panel-profiles/package.nix b/pkgs/by-name/lx/lxqt-panel-profiles/package.nix index 0587b72220cf..6055982917c2 100644 --- a/pkgs/by-name/lx/lxqt-panel-profiles/package.nix +++ b/pkgs/by-name/lx/lxqt-panel-profiles/package.nix @@ -13,14 +13,14 @@ let in stdenv.mkDerivation rec { pname = "lxqt-panel-profiles"; - version = "1.1"; + version = "1.2"; src = fetchFromGitea { domain = "codeberg.org"; owner = "MrReplikant"; repo = "lxqt-panel-profiles"; rev = version; - hash = "sha256-YGjgTLodVTtDzP/SOEg+Ehf1LYggTnG1H1rN5m1jaNM="; + hash = "sha256-V76R3mWF/PgweMaDYTr6eJ3IDBsSJ8BSP5MYpKAWxM8="; }; postPatch = '' @@ -35,7 +35,7 @@ stdenv.mkDerivation rec { --replace-fail "python3" "${pythonWithPyqt6}/bin/python" substituteInPlace usr/share/lxqt-panel-profiles/lxqt-panel-profiles.py \ - --replace-fail "qdbus" "${qt6.qttools}/bin/qdbus" + --replace-fail "qdbus6" "${qt6.qttools}/bin/qdbus" ''; installPhase = '' diff --git a/pkgs/by-name/m-/m-cli/package.nix b/pkgs/by-name/m-/m-cli/package.nix index 4faa5c6dc184..6d207a8606b6 100644 --- a/pkgs/by-name/m-/m-cli/package.nix +++ b/pkgs/by-name/m-/m-cli/package.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "rgcr"; - repo = pname; + repo = "m-cli"; rev = "v${version}"; sha256 = "sha256-KzlE1DdVMLnGmcOS1a2HK4pASofD1EHpdqbzVVIxeb4="; }; diff --git a/pkgs/by-name/ma/marge-bot/package.nix b/pkgs/by-name/ma/marge-bot/package.nix index c914bd8a2ffa..4072d3244879 100644 --- a/pkgs/by-name/ma/marge-bot/package.nix +++ b/pkgs/by-name/ma/marge-bot/package.nix @@ -9,14 +9,14 @@ python3.pkgs.buildPythonApplication rec { pname = "marge-bot"; - version = "0.15.3"; + version = "0.16.0"; pyproject = true; src = fetchFromGitLab { owner = "marge-org"; repo = "marge-bot"; rev = version; - hash = "sha256-i/hnfoBxgP1mo4RV4F10+QOOkPP/fkcwqaLKBlOuP0I="; + hash = "sha256-UgdbeJegeTFP6YF6oMxAeQDI9AO2k6yk4WAFZ/Xspu8="; }; nativeBuildInputs = [ diff --git a/pkgs/by-name/ma/matcha-gtk-theme/package.nix b/pkgs/by-name/ma/matcha-gtk-theme/package.nix index 61b923022bb7..2f0f5d338649 100644 --- a/pkgs/by-name/ma/matcha-gtk-theme/package.nix +++ b/pkgs/by-name/ma/matcha-gtk-theme/package.nix @@ -28,7 +28,7 @@ lib.checkListOfEnum "${pname}: color variants" [ "standard" "light" "dark" ] col src = fetchFromGitHub { owner = "vinceliuice"; - repo = pname; + repo = "matcha-gtk-theme"; rev = version; sha256 = "sha256-vPAGEa3anWAynEg2AYme4qpHJdLDKk2CmL5iQ1mBYgM="; }; @@ -60,8 +60,8 @@ lib.checkListOfEnum "${pname}: color variants" [ "standard" "light" "dark" ] col ${lib.optionalString (themeVariants != [ ]) "--theme " + builtins.toString themeVariants} \ --dest $out/share/themes - mkdir -p $out/share/doc/${pname} - cp -a src/extra/firefox $out/share/doc/${pname} + mkdir -p $out/share/doc/matcha-gtk-theme + cp -a src/extra/firefox $out/share/doc/matcha-gtk-theme jdupes --quiet --link-soft --recurse $out/share diff --git a/pkgs/by-name/mc/mcp-grafana/package.nix b/pkgs/by-name/mc/mcp-grafana/package.nix index 8c484ab118f1..34d43a071955 100644 --- a/pkgs/by-name/mc/mcp-grafana/package.nix +++ b/pkgs/by-name/mc/mcp-grafana/package.nix @@ -6,16 +6,16 @@ buildGoModule (finalAttrs: { pname = "mcp-grafana"; - version = "0.4.2"; + version = "0.5.0"; src = fetchFromGitHub { owner = "grafana"; repo = "mcp-grafana"; tag = "v${finalAttrs.version}"; - hash = "sha256-3w6xnDAcuDMZPr6lGGh0FpcyG2fRpkeVcJlZMdszu/g="; + hash = "sha256-oFtih2X3ZXKeo0xP8PBafu9HXgzcLUkLCeHm47qZhNA="; }; - vendorHash = "sha256-61nn/p6Un+uHuPK4hipJ3A2DhAEqpWTGefM8ENAOP1E="; + vendorHash = "sha256-AVU1HE3RlEjkL0xO6j/Mii0B9BtUSdALUvSphCTwjrc="; ldflags = [ "-s" diff --git a/pkgs/by-name/me/mediawriter/package.nix b/pkgs/by-name/me/mediawriter/package.nix index 4fd9019fc85b..a123c3dcbd05 100644 --- a/pkgs/by-name/me/mediawriter/package.nix +++ b/pkgs/by-name/me/mediawriter/package.nix @@ -12,13 +12,13 @@ stdenv.mkDerivation rec { pname = "mediawriter"; - version = "5.2.5"; + version = "5.2.6"; src = fetchFromGitHub { owner = "FedoraQt"; repo = "MediaWriter"; tag = version; - hash = "sha256-acKLKnAXTp1w8+pPVXO2gCi3GELEi3skYCYN13QjWyY="; + hash = "sha256-3O+b55H2/qbr8RrHNGz8dPQTt+ecVHtUWSDa24l2Dwc="; }; nativeBuildInputs = [ diff --git a/pkgs/by-name/me/memray/package.nix b/pkgs/by-name/me/memray/package.nix index b2a1bc80d454..09140b5e9bc2 100644 --- a/pkgs/by-name/me/memray/package.nix +++ b/pkgs/by-name/me/memray/package.nix @@ -44,7 +44,7 @@ python3Packages.buildPythonApplication rec { with python3Packages; [ ipython - pytest-cov # fix Unknown pytest.mark.no_cover + pytest-cov-stub # fix Unknown pytest.mark.no_cover pytest-textual-snapshot pytestCheckHook ] diff --git a/pkgs/by-name/mi/microsocks/package.nix b/pkgs/by-name/mi/microsocks/package.nix index 8cd33c602e02..1f935426dd4b 100644 --- a/pkgs/by-name/mi/microsocks/package.nix +++ b/pkgs/by-name/mi/microsocks/package.nix @@ -2,6 +2,7 @@ stdenv, fetchFromGitHub, lib, + nix-update-script, }: stdenv.mkDerivation rec { @@ -23,6 +24,8 @@ stdenv.mkDerivation rec { runHook postInstall ''; + passthru.updateScript = nix-update-script { }; + meta = { changelog = "https://github.com/rofl0r/microsocks/releases/tag/v${version}"; description = "Tiny, portable SOCKS5 server with very moderate resource usage"; diff --git a/pkgs/by-name/mi/mitra/package.nix b/pkgs/by-name/mi/mitra/package.nix index 1a51c6ee0057..5192212c7efe 100644 --- a/pkgs/by-name/mi/mitra/package.nix +++ b/pkgs/by-name/mi/mitra/package.nix @@ -6,18 +6,18 @@ rustPlatform.buildRustPackage rec { pname = "mitra"; - version = "4.4.0"; + version = "4.5.0"; src = fetchFromGitea { domain = "codeberg.org"; owner = "silverpill"; repo = "mitra"; rev = "v${version}"; - hash = "sha256-ZonEMbafZWfURW7WKUAVmDq7bvi7oXBpKVudbrTF6eE="; + hash = "sha256-y77wLGmSJbGmqUXURjqp6Gz9+xpMvnUEcB9OZ4uF3M8="; }; useFetchCargoVendor = true; - cargoHash = "sha256-n96B51fVkJcBDwcbYHNP6ZWWdU8fu0a0Y72IVbNAAMQ="; + cargoHash = "sha256-sfPnhB1GWIG8tA6Jqr1+03qxwS1DBbRAv4ZY+wKB/jY="; # require running database doCheck = false; diff --git a/pkgs/by-name/ml/mlxbf-bootctl/package.nix b/pkgs/by-name/ml/mlxbf-bootctl/package.nix index 624c510eef39..8db85e010dd5 100644 --- a/pkgs/by-name/ml/mlxbf-bootctl/package.nix +++ b/pkgs/by-name/ml/mlxbf-bootctl/package.nix @@ -10,8 +10,8 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "Mellanox"; - repo = pname; - rev = "${pname}-${version}"; + repo = "mlxbf-bootctl"; + rev = "mlxbf-bootctl-${version}"; hash = "sha256-F49ZZtty+NARXA/doAFLhsQn4XkPW6GWLXGy4waIaM0="; }; diff --git a/pkgs/by-name/mo/mojave-gtk-theme/package.nix b/pkgs/by-name/mo/mojave-gtk-theme/package.nix index 8cf39693599f..b483b58f762c 100644 --- a/pkgs/by-name/mo/mojave-gtk-theme/package.nix +++ b/pkgs/by-name/mo/mojave-gtk-theme/package.nix @@ -27,14 +27,14 @@ let main_src = fetchFromGitHub { owner = "vinceliuice"; - repo = pname; + repo = "mojave-gtk-theme"; rev = version; hash = "sha256-uL4lO6aWiDfOQkhpTnr/iVx1fI7n/fx7WYr5jDWPfYM="; }; wallpapers_src = fetchFromGitHub { owner = "vinceliuice"; - repo = pname; + repo = "mojave-gtk-theme"; rev = "1dc23c2b45d7e073e080cfb02f43aab0e59b6b2c"; hash = "sha256-nkw8gXYx8fN1yn0A5M2fWwOvfUQ6izynxRw5JA61InM="; name = "wallpapers"; diff --git a/pkgs/by-name/mu/mumps/package.nix b/pkgs/by-name/mu/mumps/package.nix index fb2fbc92ccd3..9d613b4b057d 100644 --- a/pkgs/by-name/mu/mumps/package.nix +++ b/pkgs/by-name/mu/mumps/package.nix @@ -1,19 +1,21 @@ { - blas, - fetchzip, - gfortran, - lapack, lib, + stdenv, + fetchzip, + mpi, + gfortran, + fixDarwinDylibNames, + blas, + lapack, + scalapack, + scotch, metis, parmetis, - withParmetis ? false, # default to false due to unfree license - scotch, - withPtScotch ? mpiSupport, - stdenv, - fixDarwinDylibNames, - mpiSupport ? false, mpiCheckPhaseHook, - scalapack, + static ? stdenv.hostPlatform.isStatic, + mpiSupport ? false, + withParmetis ? false, # default to false due to unfree license + withPtScotch ? mpiSupport, }: assert withParmetis -> mpiSupport; assert withPtScotch -> mpiSupport; @@ -46,14 +48,16 @@ let in stdenv.mkDerivation (finalAttrs: { name = "mumps"; - version = "5.7.3"; + version = "5.8.0"; # makeFlags contain space and one should use makeFlagsArray+ # Setting this magic var is an optional solution __structuredAttrs = true; + strictDeps = true; + src = fetchzip { url = "https://mumps-solver.org/MUMPS_${finalAttrs.version}.tar.gz"; - hash = "sha256-ZnIfAuvOBJDYqCtKGlWs0r39nG6X2lAVRuUmeIJenZw="; + hash = "sha256-opJW7+Z/YhyUFwYTTTuWZuykz8Z4do6/XTBThHyTVCs="; }; postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' @@ -74,7 +78,7 @@ stdenv.mkDerivation (finalAttrs: { "LIBEXT_SHARED=.dylib" ] ++ [ - "ISCOTCH=-I${scotch.dev}/include" + "ISCOTCH=-I${lib.getDev scotch}/include" "LMETIS=${LMETIS}" "LSCOTCH=${LSCOTCH}" "ORDERINGSF=${ORDERINGSF}" @@ -82,7 +86,7 @@ stdenv.mkDerivation (finalAttrs: { "OPTC=-O3" "OPTL=-O3" "SCALAP=-lscalapack" - "allshared" + "${if static then "all" else "allshared"}" ]; installPhase = @@ -98,9 +102,12 @@ stdenv.mkDerivation (finalAttrs: { ln -s $out/include/mumps_seq/mpi.h $out/include/mumps_mpi.h ''; - nativeBuildInputs = [ - gfortran - ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; + nativeBuildInputs = + [ + gfortran + ] + ++ lib.optional mpiSupport mpi + ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; # Parmetis should be placed before scotch to avoid conflict of header file "parmetis.h" buildInputs = @@ -114,9 +121,12 @@ stdenv.mkDerivation (finalAttrs: { ]; doInstallCheck = true; + nativeInstallCheckInputs = lib.optional mpiSupport mpiCheckPhaseHook; + installCheckPhase = '' runHook preInstallCheck + ${lib.optionalString stdenv.hostPlatform.isDarwin "export DYLD_LIBRARY_PATH=$out/lib\n"} ${lib.optionalString mpiSupport "export MPIRUN='mpirun -n 2'\n"} cd examples @@ -131,6 +141,7 @@ stdenv.mkDerivation (finalAttrs: { $MPIRUN ./csimpletest_save_restore version > 2.7 , a nested dependency (pythonPackages.hypothesis) fails. disabled = !pythonAtLeast "3.5"; nativeCheckInputs = [ - pytest - pytest-cov + pytestCheckHook + pytest-cov-stub ]; propagatedBuildInputs = [ ansicolor @@ -29,10 +31,13 @@ buildPythonApplication rec { setuptools ]; - # Unpin test dependency versions. This is fixed in master but not yet released. preCheck = '' - sed -i 's/==.*//g' test-requirements.txt - sed -i 's/mock == 1.0.1/mock/g' setup.py + substituteInPlace \ + test/acceptance/test_cli.py \ + test/acceptance/test_cli_vital.py \ + --replace-fail \ + "cmd = ['bin/vint'" \ + "cmd = ['$out/bin/vint'" ''; meta = with lib; { diff --git a/pkgs/by-name/vu/vulnix/package.nix b/pkgs/by-name/vu/vulnix/package.nix index 7ce9413457d8..a31a513a6402 100644 --- a/pkgs/by-name/vu/vulnix/package.nix +++ b/pkgs/by-name/vu/vulnix/package.nix @@ -28,8 +28,8 @@ python3Packages.buildPythonApplication rec { nativeCheckInputs = with python3Packages; [ freezegun - pytest - pytest-cov + pytestCheckHook + pytest-cov-stub ]; propagatedBuildInputs = @@ -48,7 +48,7 @@ python3Packages.buildPythonApplication rec { postBuild = "make -C doc"; - checkPhase = "py.test src/vulnix"; + pytestFlagsArray = [ "src/vulnix" ]; postInstall = '' install -D -t $doc/share/doc/vulnix README.rst CHANGES.rst diff --git a/pkgs/by-name/we/werf/package.nix b/pkgs/by-name/we/werf/package.nix index b22b2e1f65a9..8ddc80fe6dcc 100644 --- a/pkgs/by-name/we/werf/package.nix +++ b/pkgs/by-name/we/werf/package.nix @@ -10,17 +10,17 @@ }: buildGoModule (finalAttrs: { pname = "werf"; - version = "2.37.1"; + version = "2.38.0"; src = fetchFromGitHub { owner = "werf"; repo = "werf"; tag = "v${finalAttrs.version}"; - hash = "sha256-FIahppFWQx1UCR7mo3oiFT1SDOoySmqc7Fc2E5XMglY="; + hash = "sha256-cZUzkThVKgPc8bsxmDc2+gsq9YxVswokO1rORvKVIws="; }; proxyVendor = true; - vendorHash = "sha256-u/sG/UZt76Sr3Ckiv8Nn2JnMrVsAIlSWWTvs+Yfn6eU="; + vendorHash = "sha256-aQVDt6VDtQjHCkY2xcbmoKn+UUplJ+a6xfdwPSF/j9Y="; subPackages = [ "cmd/werf" ]; diff --git a/pkgs/by-name/zu/zulip-term/package.nix b/pkgs/by-name/zu/zulip-term/package.nix index d8e3da694844..3ce923be7dba 100644 --- a/pkgs/by-name/zu/zulip-term/package.nix +++ b/pkgs/by-name/zu/zulip-term/package.nix @@ -67,7 +67,7 @@ buildPythonApplication rec { ] ++ (with python3.pkgs; [ pytestCheckHook - pytest-cov + pytest-cov-stub pytest-mock ]); diff --git a/pkgs/development/compilers/rust/make-rust-platform.nix b/pkgs/development/compilers/rust/make-rust-platform.nix index 03564bc068f7..29a7e5f95194 100644 --- a/pkgs/development/compilers/rust/make-rust-platform.nix +++ b/pkgs/development/compilers/rust/make-rust-platform.nix @@ -56,9 +56,6 @@ (callPackages ../../../build-support/rust/hooks { inherit stdenv - cargo - rustc - callPackage ; }) cargoBuildHook diff --git a/pkgs/development/interpreters/lua-5/hooks/default.nix b/pkgs/development/interpreters/lua-5/hooks/default.nix index cdc44e344d62..9f7396f2a518 100644 --- a/pkgs/development/interpreters/lua-5/hooks/default.nix +++ b/pkgs/development/interpreters/lua-5/hooks/default.nix @@ -1,9 +1,7 @@ # Hooks for building lua packages. { lua, - lib, makeSetupHook, - runCommand, }: let @@ -21,11 +19,8 @@ in # luarocks installs data in a non-overridable location. Until a proper luarocks patch, # we move the files around ourselves - luarocksMoveDataFolder = callPackage ( - { }: - makeSetupHook { - name = "luarocks-move-rock"; - propagatedBuildInputs = [ ]; - } ./luarocks-move-data.sh - ) { }; + luarocksMoveDataFolder = makeSetupHook { + name = "luarocks-move-rock"; + propagatedBuildInputs = [ ]; + } ./luarocks-move-data.sh; } diff --git a/pkgs/development/interpreters/octave/hooks/default.nix b/pkgs/development/interpreters/octave/hooks/default.nix index 8e7acafd8489..633187654b6f 100644 --- a/pkgs/development/interpreters/octave/hooks/default.nix +++ b/pkgs/development/interpreters/octave/hooks/default.nix @@ -1,16 +1,10 @@ # Hooks for building Octave packages. { - octave, - lib, - callPackage, makeSetupHook, }: -rec { - writeRequiredOctavePackagesHook = callPackage ( - { }: - makeSetupHook { - name = "write-required-octave-packages-hook"; - } ./write-required-octave-packages-hook.sh - ) { }; +{ + writeRequiredOctavePackagesHook = makeSetupHook { + name = "write-required-octave-packages-hook"; + } ./write-required-octave-packages-hook.sh; } diff --git a/pkgs/development/php-packages/xdebug/default.nix b/pkgs/development/php-packages/xdebug/default.nix index 00a3edc6c178..ccc7da3193c9 100644 --- a/pkgs/development/php-packages/xdebug/default.nix +++ b/pkgs/development/php-packages/xdebug/default.nix @@ -5,7 +5,7 @@ }: let - version = "3.4.3"; + version = "3.4.4"; in buildPecl { inherit version; @@ -16,7 +16,7 @@ buildPecl { owner = "xdebug"; repo = "xdebug"; rev = version; - hash = "sha256-B0sGUwCSKh/AZ9I4rwE22EitgkQWwWh4H+p8N02YAeY="; + hash = "sha256-IYyDolRfzIpIfaJPWLOKdZhGlG4TMR5v7p56fw76JOc="; }; doCheck = true; diff --git a/pkgs/development/python-modules/colcon-mixin/default.nix b/pkgs/development/python-modules/colcon-mixin/default.nix index b2821cda8e44..d5a7b7bdb4f0 100644 --- a/pkgs/development/python-modules/colcon-mixin/default.nix +++ b/pkgs/development/python-modules/colcon-mixin/default.nix @@ -3,7 +3,7 @@ buildPythonPackage, fetchFromGitHub, colcon, - pytest-cov, + pytest-cov-stub, pytestCheckHook, setuptools, scspell, @@ -29,7 +29,7 @@ buildPythonPackage rec { ]; nativeCheckInputs = [ - pytest-cov + pytest-cov-stub pytestCheckHook scspell writableTmpDirAsHomeHook diff --git a/pkgs/development/python-modules/colcon-ros-domain-id-coordinator/default.nix b/pkgs/development/python-modules/colcon-ros-domain-id-coordinator/default.nix index cf3c58ee1142..84650e2d6352 100644 --- a/pkgs/development/python-modules/colcon-ros-domain-id-coordinator/default.nix +++ b/pkgs/development/python-modules/colcon-ros-domain-id-coordinator/default.nix @@ -4,7 +4,7 @@ colcon, fetchFromGitHub, pytestCheckHook, - pytest-cov, + pytest-cov-stub, pytest-repeat, pytest-rerunfailures, scspell, @@ -30,7 +30,7 @@ buildPythonPackage { nativeCheckInputs = [ pytestCheckHook - pytest-cov + pytest-cov-stub pytest-repeat pytest-rerunfailures scspell diff --git a/pkgs/development/python-modules/deltalake/default.nix b/pkgs/development/python-modules/deltalake/default.nix index 5318e09a17ac..8732a1b2aa1a 100644 --- a/pkgs/development/python-modules/deltalake/default.nix +++ b/pkgs/development/python-modules/deltalake/default.nix @@ -12,7 +12,7 @@ polars, pytestCheckHook, pytest-benchmark, - pytest-cov, + pytest-cov-stub, pytest-mock, pandas, azure-storage-blob, @@ -64,7 +64,7 @@ buildPythonPackage rec { pandas polars pytest-benchmark - pytest-cov + pytest-cov-stub pytest-mock azure-storage-blob ]; diff --git a/pkgs/development/python-modules/dramatiq-abort/default.nix b/pkgs/development/python-modules/dramatiq-abort/default.nix index 165a209f21ee..b4130f701bfe 100644 --- a/pkgs/development/python-modules/dramatiq-abort/default.nix +++ b/pkgs/development/python-modules/dramatiq-abort/default.nix @@ -4,7 +4,7 @@ fetchFromGitHub, gevent, pytestCheckHook, - pytest-cov, + pytest-cov-stub, dramatiq, redis, setuptools, @@ -37,7 +37,7 @@ buildPythonPackage rec { nativeCheckInputs = [ redis pytestCheckHook - pytest-cov + pytest-cov-stub ]; pythonImportsCheck = [ "dramatiq_abort" ]; diff --git a/pkgs/development/python-modules/garth/default.nix b/pkgs/development/python-modules/garth/default.nix index ba78675bdc35..bb6ced542eb3 100644 --- a/pkgs/development/python-modules/garth/default.nix +++ b/pkgs/development/python-modules/garth/default.nix @@ -13,14 +13,14 @@ buildPythonPackage rec { pname = "garth"; - version = "0.5.15"; + version = "0.5.16"; pyproject = true; disabled = pythonOlder "3.10"; src = fetchPypi { inherit pname version; - hash = "sha256-GAhgngt+MjvpsFc1irRKOTqlhVhyMgST7Z9GiaLBzgc="; + hash = "sha256-5ZmxL5JYHZB5sFrpaCF8vrCo45LAKVYfP/yfilmHprI="; }; pythonRelaxDeps = [ "requests-oauthlib" ]; diff --git a/pkgs/development/python-modules/haystack-ai/default.nix b/pkgs/development/python-modules/haystack-ai/default.nix index 2c367cc70cb1..dec9d6684d27 100644 --- a/pkgs/development/python-modules/haystack-ai/default.nix +++ b/pkgs/development/python-modules/haystack-ai/default.nix @@ -42,7 +42,7 @@ pylint, pytest, pytest-asyncio, - pytest-cov-stub, + pytest-cov, # , pytest-custom-exit-code python-multipart, reno, @@ -167,7 +167,7 @@ buildPythonPackage rec { pylint pytest pytest-asyncio - pytest-cov-stub + pytest-cov # pytest-custom-exit-code python-multipart reno diff --git a/pkgs/development/python-modules/iocapture/default.nix b/pkgs/development/python-modules/iocapture/default.nix index 0e44cad6916b..715abd657b56 100644 --- a/pkgs/development/python-modules/iocapture/default.nix +++ b/pkgs/development/python-modules/iocapture/default.nix @@ -3,7 +3,7 @@ buildPythonPackage, fetchPypi, flexmock, - pytest, + pytestCheckHook, pytest-cov-stub, six, }: @@ -20,7 +20,7 @@ buildPythonPackage rec { nativeCheckInputs = [ flexmock - pytest + pytestCheckHook pytest-cov-stub six ]; diff --git a/pkgs/development/python-modules/langchain-perplexity/default.nix b/pkgs/development/python-modules/langchain-perplexity/default.nix index 22d471f80f47..acc783d3b46b 100644 --- a/pkgs/development/python-modules/langchain-perplexity/default.nix +++ b/pkgs/development/python-modules/langchain-perplexity/default.nix @@ -13,7 +13,7 @@ # tests langchain-tests, pytest-asyncio, - pytest-cov, + pytest-cov-stub, pytest-mock, pytestCheckHook, @@ -51,7 +51,7 @@ buildPythonPackage rec { nativeCheckInputs = [ langchain-tests pytest-asyncio - pytest-cov + pytest-cov-stub pytest-mock pytestCheckHook ]; diff --git a/pkgs/development/python-modules/nonbloat-db/default.nix b/pkgs/development/python-modules/nonbloat-db/default.nix index 7e3d3f9a70d2..b87e03a9604c 100644 --- a/pkgs/development/python-modules/nonbloat-db/default.nix +++ b/pkgs/development/python-modules/nonbloat-db/default.nix @@ -14,7 +14,7 @@ # tests pytestCheckHook, pytest-asyncio, - pytest-cov, + pytest-cov-stub, pytest-mock, pytest-randomly, faker, @@ -45,7 +45,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook pytest-asyncio - pytest-cov + pytest-cov-stub pytest-mock pytest-randomly faker diff --git a/pkgs/development/python-modules/pdfplumber/default.nix b/pkgs/development/python-modules/pdfplumber/default.nix index 6a8b080339cf..876324a0c03c 100644 --- a/pkgs/development/python-modules/pdfplumber/default.nix +++ b/pkgs/development/python-modules/pdfplumber/default.nix @@ -11,7 +11,7 @@ pdfminer-six, pillow, pypdfium2, - pytest-cov, + pytest-cov-stub, pytest-parallel, pytestCheckHook, types-pillow, @@ -44,7 +44,7 @@ buildPythonPackage rec { nbexec pandas pandas-stubs - pytest-cov + pytest-cov-stub pytest-parallel pytestCheckHook types-pillow diff --git a/pkgs/development/python-modules/plaster/default.nix b/pkgs/development/python-modules/plaster/default.nix index 0651404dc477..b01e94bc1d57 100644 --- a/pkgs/development/python-modules/plaster/default.nix +++ b/pkgs/development/python-modules/plaster/default.nix @@ -1,7 +1,8 @@ { + lib, buildPythonPackage, fetchPypi, - pytest, + pytestCheckHook, pytest-cov-stub, }: @@ -15,12 +16,15 @@ buildPythonPackage rec { hash = "sha256-+L78VL+MEUfBCrQCl+yEwmdvotTqXW9STZQ2qAB075g="; }; - checkPhase = '' - py.test - ''; - nativeCheckInputs = [ - pytest + pytestCheckHook pytest-cov-stub ]; + + meta = { + description = "Loader interface around multiple config file formats"; + homepage = "https://pypi.org/project/plaster/"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ ]; + }; } diff --git a/pkgs/development/python-modules/polars/default.nix b/pkgs/development/python-modules/polars/default.nix index 0cbeee4d65a1..c2dafd53a442 100644 --- a/pkgs/development/python-modules/polars/default.nix +++ b/pkgs/development/python-modules/polars/default.nix @@ -9,7 +9,7 @@ pkgs, # zstd hidden by python3Packages.zstd pytestCheckHook, pytest-codspeed ? null, # Not in Nixpkgs - pytest-cov, + pytest-cov-stub, pytest-xdist, pytest-benchmark, rustc, @@ -229,7 +229,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook pytest-codspeed - pytest-cov + pytest-cov-stub pytest-xdist pytest-benchmark ]; diff --git a/pkgs/development/python-modules/property-manager/default.nix b/pkgs/development/python-modules/property-manager/default.nix index 71fa0e1aeddb..02c0b6accd46 100644 --- a/pkgs/development/python-modules/property-manager/default.nix +++ b/pkgs/development/python-modules/property-manager/default.nix @@ -5,7 +5,7 @@ humanfriendly, verboselogs, coloredlogs, - pytest, + pytestCheckHook, pytest-cov-stub, }: @@ -27,7 +27,7 @@ buildPythonPackage rec { verboselogs ]; nativeCheckInputs = [ - pytest + pytestCheckHook pytest-cov-stub ]; diff --git a/pkgs/development/python-modules/pygerber/default.nix b/pkgs/development/python-modules/pygerber/default.nix index 79017768fd90..cd5c62f8dc9f 100644 --- a/pkgs/development/python-modules/pygerber/default.nix +++ b/pkgs/development/python-modules/pygerber/default.nix @@ -26,7 +26,6 @@ dulwich, tzlocal, pytest-xdist, - pytest-cov, pytest-lsp, pytest-asyncio, pytest-mock, @@ -77,7 +76,6 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-asyncio - pytest-cov pytest-xdist pytest-lsp pytest-mock @@ -94,6 +92,8 @@ buildPythonPackage rec { "test/gerberx3/test_language_server/tests.py" ]; + pytestFlagsArray = [ "--override-ini required_plugins=''" ]; + pythonImportsCheck = [ "pygerber" ]; meta = { diff --git a/pkgs/development/python-modules/pyscaffold/default.nix b/pkgs/development/python-modules/pyscaffold/default.nix index 5a0b13086071..127ca5bb96c2 100644 --- a/pkgs/development/python-modules/pyscaffold/default.nix +++ b/pkgs/development/python-modules/pyscaffold/default.nix @@ -23,7 +23,7 @@ certifi, flake8, pytest, - pytest-cov-stub, + pytest-cov, pytest-randomly, pytest-xdist, sphinx, @@ -80,7 +80,7 @@ buildPythonPackage rec { flake8 pre-commit pytest - pytest-cov-stub + pytest-cov pytest-randomly pytest-xdist setuptools diff --git a/pkgs/development/python-modules/pyscaffoldext-cookiecutter/default.nix b/pkgs/development/python-modules/pyscaffoldext-cookiecutter/default.nix index d5ba7c9b6d82..a34bf93334e9 100644 --- a/pkgs/development/python-modules/pyscaffoldext-cookiecutter/default.nix +++ b/pkgs/development/python-modules/pyscaffoldext-cookiecutter/default.nix @@ -11,7 +11,7 @@ configupdater, pre-commit, pytest, - pytest-cov-stub, + pytest-cov, pytest-xdist, tox, virtualenv, @@ -44,7 +44,7 @@ buildPythonPackage rec { configupdater pre-commit pytest - pytest-cov-stub + pytest-cov pytest-xdist setuptools-scm tox diff --git a/pkgs/development/python-modules/pyscaffoldext-custom-extension/default.nix b/pkgs/development/python-modules/pyscaffoldext-custom-extension/default.nix index 0ee14743b5e9..ee4bc3aa728b 100644 --- a/pkgs/development/python-modules/pyscaffoldext-custom-extension/default.nix +++ b/pkgs/development/python-modules/pyscaffoldext-custom-extension/default.nix @@ -11,7 +11,7 @@ pyscaffold, pre-commit, pytest, - pytest-cov-stub, + pytest-cov, pytest-xdist, tox, virtualenv, @@ -45,7 +45,7 @@ buildPythonPackage rec { configupdater pre-commit pytest - pytest-cov-stub + pytest-cov pytest-xdist setuptools-scm tox diff --git a/pkgs/development/python-modules/pyscaffoldext-django/default.nix b/pkgs/development/python-modules/pyscaffoldext-django/default.nix index 6270dbc2d1d5..e0e9ca4cf69f 100644 --- a/pkgs/development/python-modules/pyscaffoldext-django/default.nix +++ b/pkgs/development/python-modules/pyscaffoldext-django/default.nix @@ -10,7 +10,7 @@ configupdater, pre-commit, pytest, - pytest-cov-stub, + pytest-cov, pytest-xdist, tox, virtualenv, @@ -42,7 +42,7 @@ buildPythonPackage rec { configupdater pre-commit pytest - pytest-cov-stub + pytest-cov pytest-xdist setuptools-scm tox diff --git a/pkgs/development/python-modules/pyscaffoldext-dsproject/default.nix b/pkgs/development/python-modules/pyscaffoldext-dsproject/default.nix index cc70d4098ab8..9763ba8ace95 100644 --- a/pkgs/development/python-modules/pyscaffoldext-dsproject/default.nix +++ b/pkgs/development/python-modules/pyscaffoldext-dsproject/default.nix @@ -11,7 +11,7 @@ configupdater, pre-commit, pytest, - pytest-cov-stub, + pytest-cov, pytest-xdist, tox, virtualenv, @@ -44,7 +44,7 @@ buildPythonPackage rec { configupdater pre-commit pytest - pytest-cov-stub + pytest-cov pytest-xdist setuptools-scm tox diff --git a/pkgs/development/python-modules/pyscaffoldext-markdown/default.nix b/pkgs/development/python-modules/pyscaffoldext-markdown/default.nix index d84320a77a95..4d6157ed4d99 100644 --- a/pkgs/development/python-modules/pyscaffoldext-markdown/default.nix +++ b/pkgs/development/python-modules/pyscaffoldext-markdown/default.nix @@ -11,7 +11,7 @@ configupdater, pre-commit, pytest, - pytest-cov-stub, + pytest-cov, pytest-xdist, tox, twine, @@ -46,7 +46,7 @@ buildPythonPackage rec { configupdater pre-commit pytest - pytest-cov-stub + pytest-cov pytest-xdist setuptools-scm tox diff --git a/pkgs/development/python-modules/pyscaffoldext-travis/default.nix b/pkgs/development/python-modules/pyscaffoldext-travis/default.nix index 4eeaafd14c22..6c08f6c23adc 100644 --- a/pkgs/development/python-modules/pyscaffoldext-travis/default.nix +++ b/pkgs/development/python-modules/pyscaffoldext-travis/default.nix @@ -10,7 +10,7 @@ configupdater, pre-commit, pytest, - pytest-cov-stub, + pytest-cov, pytest-xdist, tox, virtualenv, @@ -42,7 +42,7 @@ buildPythonPackage rec { configupdater pre-commit pytest - pytest-cov-stub + pytest-cov pytest-xdist setuptools-scm tox diff --git a/pkgs/development/python-modules/reikna/default.nix b/pkgs/development/python-modules/reikna/default.nix index 6dee74d2b712..ab32dd6e5aaf 100644 --- a/pkgs/development/python-modules/reikna/default.nix +++ b/pkgs/development/python-modules/reikna/default.nix @@ -4,7 +4,7 @@ buildPythonPackage, sphinx, pytest-cov-stub, - pytest, + pytestCheckHook, mako, numpy, funcsigs, @@ -27,7 +27,7 @@ buildPythonPackage rec { nativeCheckInputs = [ sphinx pytest-cov-stub - pytest + pytestCheckHook ]; propagatedBuildInputs = @@ -39,10 +39,6 @@ buildPythonPackage rec { ++ lib.optional withCuda pycuda ++ lib.optional withOpenCL pyopencl; - checkPhase = '' - py.test - ''; - # Requires device doCheck = false; diff --git a/pkgs/development/python-modules/sanic-ext/default.nix b/pkgs/development/python-modules/sanic-ext/default.nix index 581b44962816..17c33e3563fa 100644 --- a/pkgs/development/python-modules/sanic-ext/default.nix +++ b/pkgs/development/python-modules/sanic-ext/default.nix @@ -18,7 +18,7 @@ msgspec, pydantic, pytest, - pytest-cov, + pytest-cov-stub, pytest-asyncio, tox, jinja2, @@ -51,7 +51,7 @@ buildPythonPackage rec { msgspec pydantic pytest - pytest-cov + pytest-cov-stub pytest-asyncio tox jinja2 diff --git a/pkgs/development/python-modules/sklearn-compat/default.nix b/pkgs/development/python-modules/sklearn-compat/default.nix index 3fd17c6cade4..e4bdc1a2d85f 100644 --- a/pkgs/development/python-modules/sklearn-compat/default.nix +++ b/pkgs/development/python-modules/sklearn-compat/default.nix @@ -6,7 +6,7 @@ scikit-learn, pandas, pytestCheckHook, - pytest-cov, + pytest-cov-stub, pytest-xdist, pytz, }: @@ -34,7 +34,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pandas pytestCheckHook - pytest-cov + pytest-cov-stub pytest-xdist pytz ]; diff --git a/pkgs/development/python-modules/tencentcloud-sdk-python/default.nix b/pkgs/development/python-modules/tencentcloud-sdk-python/default.nix index 3bd919d30e7e..6346431da7fd 100644 --- a/pkgs/development/python-modules/tencentcloud-sdk-python/default.nix +++ b/pkgs/development/python-modules/tencentcloud-sdk-python/default.nix @@ -10,7 +10,7 @@ buildPythonPackage rec { pname = "tencentcloud-sdk-python"; - version = "3.0.1403"; + version = "3.0.1404"; pyproject = true; disabled = pythonOlder "3.9"; @@ -19,7 +19,7 @@ buildPythonPackage rec { owner = "TencentCloud"; repo = "tencentcloud-sdk-python"; tag = version; - hash = "sha256-t38Lx5xW1R/LkUp4WKXXSXuEN5b4zI5i6D9iLBNJw88="; + hash = "sha256-3T/Y5qGbJvsqrB972iV4FkVYuv3YPRwH2B7B4SnjRhg="; }; build-system = [ setuptools ]; diff --git a/pkgs/development/r-modules/default.nix b/pkgs/development/r-modules/default.nix index 78483cd61b7e..cfe8af1583b3 100644 --- a/pkgs/development/r-modules/default.nix +++ b/pkgs/development/r-modules/default.nix @@ -2523,7 +2523,7 @@ let Rhtslib = old.Rhtslib.overrideAttrs (attrs: { preConfigure = '' - substituteInPlace R/zzz.R --replace "-lcurl" "-L${pkgs.curl.out}/lib -lcurl" + substituteInPlace R/zzz.R --replace-fail "-lcurl" "-L${pkgs.curl.out}/lib -lcurl" ''; }); @@ -2534,7 +2534,7 @@ let # during runtime the package directory is not writable as it's in the # nix store, so store the jar in the user's cache directory instead - substituteInPlace R/connection.R --replace \ + substituteInPlace R/connection.R --replace-fail \ 'dest_file <- file.path(dest_folder, "h2o.jar")' \ 'dest_file <- file.path("~/.cache/", "h2o.jar")' ''; @@ -2572,18 +2572,17 @@ let sparklyr = old.sparklyr.overrideAttrs (attrs: { # Pyspark's spark is full featured and better maintained than pkgs.spark preConfigure = '' - substituteInPlace R/zzz.R \ - --replace ".onLoad <- function(...) {" \ - ".onLoad <- function(...) { - Sys.setenv(\"SPARK_HOME\" = Sys.getenv(\"SPARK_HOME\", unset = \"${pkgs.python3Packages.pyspark}/${pkgs.python3Packages.python.sitePackages}/pyspark\")) - Sys.setenv(\"JAVA_HOME\" = Sys.getenv(\"JAVA_HOME\", unset = \"${pkgs.jdk}\"))" - ''; - }); + if grep "onLoad" R/zzz.R; then + echo "onLoad is already present, patch needs to be updated!" + exit 1 + fi - proj4 = old.proj4.overrideAttrs (attrs: { - preConfigure = '' - substituteInPlace configure \ - --replace "-lsqlite3" "-L${lib.makeLibraryPath [ pkgs.sqlite ]} -lsqlite3" + cat >> R/zzz.R <