Skip to content

Commit

Permalink
Merge #281828: staging-next 2024-01-18
Browse files Browse the repository at this point in the history
  • Loading branch information
vcunat committed Jan 25, 2024
2 parents 6d11e88 + 9187b70 commit 03cd3a6
Show file tree
Hide file tree
Showing 223 changed files with 2,206 additions and 1,565 deletions.
6 changes: 3 additions & 3 deletions doc/languages-frameworks/emscripten.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ One advantage is that when `pkgs.zlib` is updated, it will automatically update
postPatch = pkgs.lib.optionalString pkgs.stdenv.isDarwin ''
substituteInPlace configure \
--replace '/usr/bin/libtool' 'ar' \
--replace 'AR="libtool"' 'AR="ar"' \
--replace 'ARFLAGS="-o"' 'ARFLAGS="-r"'
--replace-fail '/usr/bin/libtool' 'ar' \
--replace-fail 'AR="libtool"' 'AR="ar"' \
--replace-fail 'ARFLAGS="-o"' 'ARFLAGS="-r"'
'';
})
```
Expand Down
2 changes: 1 addition & 1 deletion doc/languages-frameworks/rust.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ with import <nixpkgs> {};
hello = attrs: lib.optionalAttrs (lib.versionAtLeast attrs.version "1.0") {
postPatch = ''
substituteInPlace lib/zoneinfo.rs \
--replace "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo"
--replace-fail "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo"
'';
};
};
Expand Down
2 changes: 1 addition & 1 deletion doc/stdenv/platform-notes.chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Some common issues when packaging software for Darwin:
# ...
prePatch = ''
substituteInPlace Makefile \
--replace '/usr/bin/xcrun clang' clang
--replace-fail '/usr/bin/xcrun clang' clang
'';
}
```
Expand Down
23 changes: 17 additions & 6 deletions doc/stdenv/stdenv.chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ stdenv.mkDerivation rec {
postInstall = ''
substituteInPlace $out/bin/solo5-virtio-mkimage \
--replace "/usr/lib/syslinux" "${syslinux}/share/syslinux" \
--replace "/usr/share/syslinux" "${syslinux}/share/syslinux" \
--replace "cp " "cp --no-preserve=mode "
--replace-fail "/usr/lib/syslinux" "${syslinux}/share/syslinux" \
--replace-fail "/usr/share/syslinux" "${syslinux}/share/syslinux" \
--replace-fail "cp " "cp --no-preserve=mode "
wrapProgram $out/bin/solo5-virtio-mkimage \
--prefix PATH : ${lib.makeBinPath [ dosfstools mtools parted syslinux ]}
Expand Down Expand Up @@ -1253,9 +1253,20 @@ postInstall = ''

Performs string substitution on the contents of \<infile\>, writing the result to \<outfile\>. The substitutions in \<subs\> are of the following form:

#### `--replace` \<s1\> \<s2\> {#fun-substitute-replace}
#### `--replace-fail` \<s1\> \<s2\> {#fun-substitute-replace-fail}

Replace every occurrence of the string \<s1\> by \<s2\>.
Will error if no change is made.

#### `--replace-warn` \<s1\> \<s2\> {#fun-substitute-replace-warn}

Replace every occurrence of the string \<s1\> by \<s2\>.
Will print a warning if no change is made.

#### `--replace-quiet` \<s1\> \<s2\> {#fun-substitute-replace-quiet}

Replace every occurrence of the string \<s1\> by \<s2\>.
Will do nothing if no change can be made.

#### `--subst-var` \<varName\> {#fun-substitute-subst-var}

Expand All @@ -1269,8 +1280,8 @@ Example:

```shell
substitute ./foo.in ./foo.out \
--replace /usr/bin/bar $bar/bin/bar \
--replace "a string containing spaces" "some other text" \
--replace-fail /usr/bin/bar $bar/bin/bar \
--replace-fail "a string containing spaces" "some other text" \
--subst-var someVar
```

Expand Down
18 changes: 18 additions & 0 deletions nixos/doc/manual/configuration/linux-kernel.chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,24 @@ To use your custom kernel package in your NixOS configuration, set
boot.kernelPackages = pkgs.linuxPackagesFor yourCustomKernel;
```

## Rust {#sec-linux-rust}

The Linux kernel does not have Rust language support enabled by
default. For kernel versions 6.7 or newer, experimental Rust support
can be enabled. In a NixOS configuration, set:

```nix
boot.kernelPatches = [
{
name = "Rust Support";
patch = null;
features = {
rust = true;
};
}
];
```

## Developing kernel modules {#sec-linux-config-developing-modules}

This section was moved to the [Nixpkgs manual](https://nixos.org/nixpkgs/manual#sec-linux-kernel-developing-modules).
Expand Down
4 changes: 4 additions & 0 deletions nixos/doc/manual/release-notes/rl-2405.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m

- `services.resolved.fallbackDns` can now be used to disable the upstream fallback servers entirely by setting it to an empty list. To get the previous behaviour of the upstream defaults set it to null, the new default, instead.

- `xxd` has been moved from `vim` default output to its own output to reduce closure size. The canonical way to reference it across all platforms is `unixtools.xxd`.

- `services.avahi.nssmdns` got split into `services.avahi.nssmdns4` and `services.avahi.nssmdns6` which enable the mDNS NSS switch for IPv4 and IPv6 respectively.
Since most mDNS responders only register IPv4 addresses, most users want to keep the IPv6 support disabled to avoid long timeouts.

Expand Down Expand Up @@ -231,6 +233,8 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m
- The option [`services.nextcloud.config.dbport`] of the Nextcloud module was removed to match upstream.
The port can be specified in [`services.nextcloud.config.dbhost`](#opt-services.nextcloud.config.dbhost).

- `stdenv`: The `--replace` flag in `substitute`, `substituteInPlace`, `substituteAll`, `substituteAllStream`, and `substituteStream` is now deprecated if favor of the new `--replace-fail`, `--replace-warn` and `--replace-quiet`. The deprecated `--replace` equates to `--replace-warn`.

- The Yama LSM is now enabled by default in the kernel, which prevents ptracing
non-child processes. This means you will not be able to attach gdb to an
existing process, but will need to start that process from gdb (so it is a
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/system/boot/luksroot.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1076,15 +1076,15 @@ in
boot.initrd.systemd = {
contents."/etc/crypttab".source = stage1Crypttab;

extraBin.systemd-cryptsetup = "${config.boot.initrd.systemd.package}/lib/systemd/systemd-cryptsetup";
extraBin.systemd-cryptsetup = "${config.boot.initrd.systemd.package}/bin/systemd-cryptsetup";

additionalUpstreamUnits = [
"cryptsetup-pre.target"
"cryptsetup.target"
"remote-cryptsetup.target"
];
storePaths = [
"${config.boot.initrd.systemd.package}/lib/systemd/systemd-cryptsetup"
"${config.boot.initrd.systemd.package}/bin/systemd-cryptsetup"
"${config.boot.initrd.systemd.package}/lib/systemd/system-generators/systemd-cryptsetup-generator"
];

Expand Down
3 changes: 3 additions & 0 deletions nixos/modules/system/boot/systemd/initrd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ let
"systemd-tmpfiles-setup.service"
"timers.target"
"umount.target"
"systemd-bsod.service"
] ++ cfg.additionalUpstreamUnits;

upstreamWants = [
Expand Down Expand Up @@ -424,6 +425,7 @@ in {

storePaths = [
# systemd tooling
"${cfg.package}/lib/systemd/systemd-executor"
"${cfg.package}/lib/systemd/systemd-fsck"
"${cfg.package}/lib/systemd/systemd-hibernate-resume"
"${cfg.package}/lib/systemd/systemd-journald"
Expand All @@ -433,6 +435,7 @@ in {
"${cfg.package}/lib/systemd/systemd-shutdown"
"${cfg.package}/lib/systemd/systemd-sulogin-shell"
"${cfg.package}/lib/systemd/systemd-sysctl"
"${cfg.package}/lib/systemd/systemd-bsod"

# generators
"${cfg.package}/lib/systemd/system-generators/systemd-debug-generator"
Expand Down
1 change: 1 addition & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ in {
kerberos = handleTest ./kerberos/default.nix {};
kernel-generic = handleTest ./kernel-generic.nix {};
kernel-latest-ath-user-regd = handleTest ./kernel-latest-ath-user-regd.nix {};
kernel-rust = runTestOn ["x86_64-linux"] ./kernel-rust.nix;
keter = handleTest ./keter.nix {};
kexec = handleTest ./kexec.nix {};
keycloak = discoverTests (import ./keycloak.nix);
Expand Down
30 changes: 30 additions & 0 deletions nixos/tests/kernel-rust.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{ pkgs, ... }: {
name = "kernel-rust";
meta = with pkgs.lib.maintainers; {
maintainers = [ blitz ];
};

nodes.machine = { config, pkgs, ... }:
{
boot.kernelPackages = pkgs.linuxPackages_testing;

boot.extraModulePackages = [
config.boot.kernelPackages.rust-out-of-tree-module
];

boot.kernelPatches = [
{
name = "Rust Support";
patch = null;
features = {
rust = true;
};
}
];
};

testScript = ''
machine.wait_for_unit("default.target")
machine.succeed("modprobe rust_out_of_tree")
'';
}
4 changes: 2 additions & 2 deletions pkgs/applications/audio/mpg123/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ assert withConplay -> !libOnly;

stdenv.mkDerivation rec {
pname = "${lib.optionalString libOnly "lib"}mpg123";
version = "1.32.3";
version = "1.32.4";

src = fetchurl {
url = "mirror://sourceforge/mpg123/mpg123-${version}.tar.bz2";
hash = "sha256-LZkTpX1O6PSXoYLG6CWCYCQJeCpPtIHpif7r9ENYZ7Q=";
hash = "sha256-WplmQzj7L3UbZi9A7iWATQydtrV13LXOdBxtxkIkoIo=";
};

outputs = [ "out" "dev" "man" ] ++ lib.optional withConplay "conplay";
Expand Down
33 changes: 18 additions & 15 deletions pkgs/applications/editors/neovim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@

# now defaults to false because some tests can be flaky (clipboard etc), see
# also: https://github.com/neovim/neovim/issues/16233
, doCheck ? false
, nodejs ? null, fish ? null, python3 ? null
}:

let
stdenv.mkDerivation (finalAttrs:
let
nvim-lpeg-dylib = luapkgs: if stdenv.isDarwin
then (luapkgs.lpeg.overrideAttrs (oa: {
preConfigure = ''
Expand All @@ -42,7 +41,7 @@ let
(nvim-lpeg-dylib ps)
luabitop
mpack
] ++ lib.optionals doCheck [
] ++ lib.optionals finalAttrs.doCheck [
luv
coxpcall
busted
Expand All @@ -64,17 +63,17 @@ let
in deterministicLuajit.withPackages(ps: [ ps.mpack (nvim-lpeg-dylib ps) ])
else lua.luaOnBuild;

pyEnv = python3.withPackages(ps: with ps; [ pynvim msgpack ]);

in
stdenv.mkDerivation rec {
in {
pname = "neovim-unwrapped";
version = "0.9.5";

__structuredAttrs = true;

src = fetchFromGitHub {
owner = "neovim";
repo = "neovim";
rev = "v${version}";
rev = "v${finalAttrs.version}";
hash = "sha256-CcaBqA0yFCffNPmXOJTo8c9v1jrEBiqAl8CG5Dj5YxE=";
};

Expand All @@ -87,7 +86,7 @@ in

dontFixCmake = true;

inherit lua;
inherit lua treesitter-parsers;

buildInputs = [
gperf
Expand All @@ -105,15 +104,17 @@ in
tree-sitter
unibilium
] ++ lib.optionals stdenv.isDarwin [ libiconv CoreServices ]
++ lib.optionals doCheck [ glibcLocales procps ]
++ lib.optionals finalAttrs.doCheck [ glibcLocales procps ]
;

inherit doCheck;
doCheck = false;

# to be exhaustive, one could run
# make oldtests too
checkPhase = ''
runHook preCheck
make functionaltest
runHook postCheck
'';

nativeBuildInputs = [
Expand All @@ -123,7 +124,9 @@ in
];

# extra programs test via `make functionaltest`
nativeCheckInputs = [
nativeCheckInputs = let
pyEnv = python3.withPackages(ps: with ps; [ pynvim msgpack ]);
in [
fish
nodejs
pyEnv # for src/clint.py
Expand Down Expand Up @@ -166,11 +169,11 @@ in
ln -s \
${tree-sitter.buildGrammar {
inherit language src;
version = "neovim-${version}";
version = "neovim-${finalAttrs.version}";
}}/parser \
$out/lib/nvim/parser/${language}.so
'')
treesitter-parsers);
finalAttrs.treesitter-parsers);

shellHook=''
export VIMRUNTIME=$PWD/runtime
Expand Down Expand Up @@ -199,4 +202,4 @@ in
maintainers = with maintainers; [ manveru rvolosatovs ];
platforms = platforms.unix;
};
}
})
28 changes: 20 additions & 8 deletions pkgs/applications/editors/vim/common.nix
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
{ lib, fetchFromGitHub }:
rec {
version = "9.0.2116";
version = "9.1.0004";

outputs = [ "out" "xxd" ];

src = fetchFromGitHub {
owner = "vim";
repo = "vim";
rev = "v${version}";
hash = "sha256-ZKcNg/RrjvEsxpIcTjzQYi1xig3zLeTV+PXaBb4gUuM=";
hash = "sha256-Y5ZSJLEFdptEMA0xvstr6H1G4iiaYXpkJGSSFwoTfc0=";
};

enableParallelBuilding = true;
enableParallelInstalling = false;

hardeningDisable = [ "fortify" ];

postPatch =
# Use man from $PATH; escape sequences are still problematic.
''
substituteInPlace runtime/ftplugin/man.vim \
--replace "/usr/bin/man " "man "
'';
# Use man from $PATH; escape sequences are still problematic.
postPatch = ''
substituteInPlace runtime/ftplugin/man.vim \
--replace "/usr/bin/man " "man "
'';

# man page moving is done in postFixup instead of postInstall otherwise fixupPhase moves it right back where it was
postFixup = ''
moveToOutput bin/xxd "$xxd"
moveToOutput share/man/man1/xxd.1.gz "$xxd"
for manFile in $out/share/man/*/man1/xxd.1*; do
# moveToOutput does not take full paths or wildcards...
moveToOutput "share/man/$(basename "$(dirname "$(dirname "$manFile")")")/man1/xxd.1.gz" "$xxd"
done
'';

meta = with lib; {
description = "The most popular clone of the VI editor";
Expand All @@ -28,5 +39,6 @@ rec {
maintainers = with maintainers; [ das_j equirosa ];
platforms = platforms.unix;
mainProgram = "vim";
outputsToInstall = [ "out" "xxd" ];
};
}
9 changes: 1 addition & 8 deletions pkgs/applications/editors/vim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ in
stdenv.mkDerivation {
pname = "vim";

inherit (common) version src postPatch hardeningDisable enableParallelBuilding enableParallelInstalling meta;
inherit (common) version outputs src postPatch hardeningDisable enableParallelBuilding enableParallelInstalling postFixup meta;

nativeBuildInputs = [ gettext pkg-config ];
buildInputs = [ ncurses bash gawk ]
Expand Down Expand Up @@ -62,11 +62,4 @@ stdenv.mkDerivation {
'';

__impureHostDeps = [ "/dev/ptmx" ];

# To fix the trouble in vim73, that it cannot cross-build with this patch
# to bypass a configure script check that cannot be done cross-building.
# http://groups.google.com/group/vim_dev/browse_thread/thread/66c02efd1523554b?pli=1
# patchPhase = ''
# sed -i -e 's/as_fn_error.*int32.*/:/' src/auto/configure
# '';
}
Loading

0 comments on commit 03cd3a6

Please sign in to comment.