From f96e840bbcc9de826f9e38f1e3010c05769c5d28 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Sat, 1 Nov 2025 21:16:54 +0800 Subject: [PATCH 01/29] few more readme tweaks --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7776ecb..6179e70 100644 --- a/README.md +++ b/README.md @@ -22,21 +22,28 @@ Run: $ sudo dnf install nix nix-system --exclude nix-daemon $ sudo usermod -G nixbld -a $USER ``` +and restart your login shell. + +This avoids the need to run nix-daemon. + +## nix store under /home hack Alternatively you can try this hack to have the nix store within your homedir: ``` $ dnf install nix nix-filesystem --exclude nix-daemon --exclude nix-system $ sudo ln -s ~/.local/share/nix/root/nix/store /nix/ ``` -(the symlink is needed for interactive bash - otherwise one gets error like: +(the symlink is needed for interactive bash - otherwise one gets an error like: `error: executing shell '/nix/store/2j7r5np0vaz4cnqkymp1mqivmjj1x9xl-bash-interactive-5.3p3/bin/bash': No such file or directory`). (Note this only works without `/nix/var/nix/`.) +This also allows sharing one's nix store with toolboxes, etc. + # Testing A simple way to check nix is working is to run e.g. `nix-shell -p hello`. After a short while of downloading, this should put you in a nix shell subprocess where you should be able to run `hello`. -Run `nix help` to learn more about the nix CLI +Run `nix --help` to learn more about the nix CLI or read . From 1c9e64f5668aa548dfefd2321123a1c9c0acc490 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Sun, 2 Nov 2025 21:10:29 +0800 Subject: [PATCH 02/29] fix example/flake with flake-utils --- examples/flake/flake.nix | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/examples/flake/flake.nix b/examples/flake/flake.nix index e7e63c1..8f8c3f9 100644 --- a/examples/flake/flake.nix +++ b/examples/flake/flake.nix @@ -1,20 +1,13 @@ { - description = "A basic dev shell for a single system."; - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; - }; - - outputs = { self, nixpkgs, builtins }: - let - # or hardcode "x86_64-linux" - system = builtins.currentSystem; - pkgs = import nixpkgs { inherit system; }; - in - { - devShells.${system}.default = pkgs.mkShell { - packages = with pkgs; [ hello ]; - }; - }; + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + devShells.default = pkgs.mkShell { + packages = with pkgs; [ hello ]; + }; + }); } # Run with: nix develop From 3745d1e7f13b26c5b000fa929794b106efbf2386 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Sun, 2 Nov 2025 21:28:22 +0800 Subject: [PATCH 03/29] readme: rewrite home hack as rootless nix mode --- README.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6179e70..76fbba7 100644 --- a/README.md +++ b/README.md @@ -26,16 +26,13 @@ and restart your login shell. This avoids the need to run nix-daemon. -## nix store under /home hack +## rootless nix store under /home -Alternatively you can try this hack to have the nix store within your homedir: +Alternatively one can run rootless nix with just: ``` -$ dnf install nix nix-filesystem --exclude nix-daemon --exclude nix-system -$ sudo ln -s ~/.local/share/nix/root/nix/store /nix/ +$ dnf install nix --exclude nix-daemon --exclude nix-system ``` -(the symlink is needed for interactive bash - otherwise one gets an error like: -`error: executing shell '/nix/store/2j7r5np0vaz4cnqkymp1mqivmjj1x9xl-bash-interactive-5.3p3/bin/bash': No such file or directory`). -(Note this only works without `/nix/var/nix/`.) +The user nix store is: `~/.local/share/nix/root/nix/store`. This also allows sharing one's nix store with toolboxes, etc. From eedfe652dacd627ee4482155d163c8269ba73090 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Mon, 3 Nov 2025 01:30:13 +0800 Subject: [PATCH 04/29] Convert to %autorelease and %autochangelog [skip changelog] --- changelog | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ nix.spec | 71 ++----------------------------------------------------- 2 files changed, 70 insertions(+), 69 deletions(-) create mode 100644 changelog diff --git a/changelog b/changelog new file mode 100644 index 0000000..e5e06d1 --- /dev/null +++ b/changelog @@ -0,0 +1,68 @@ +* Mon Oct 27 2025 Jens Petersen - 2.31.2-8 +- drop redundant sysusers and tmpfiles.d scriptlets (#2388768) +- add obsoletes for petersen/nix copr subpackages + +* Sat Oct 25 2025 Jens Petersen - 2.31.2-7 +- recommends nix-daemon if systemd + +* Sat Oct 25 2025 Jens Petersen - 2.31.2-6 +- rename users subpackage to system +- improve /nix/var dirs ownership and perms +- rename sysusers file to nix.conf +- move nix-daemon tmpfiles.d to nix-daemon + +* Sat Oct 25 2025 Jens Petersen - 2.31.2-5 +- split nix-users from nix-daemon and drop nix-singleuser +- drop all conflicts + +* Fri Oct 24 2025 Jens Petersen - 2.31.2-4 +- drop filesystem subpackage and ghost singleuser dirs +- nix-daemon and nix-singleuser conflict with each other + +* Thu Oct 23 2025 Jens Petersen - 2.31.2-3 +- use tmpfiles.d for nix-filesystem +- improve the readme +- list bin files explicitly +- nix-singleuser now owns its dirs +- add nix-daemon conflicts for ostree and containers +- add nix-singleuser recommends for containers + +* Sat Oct 18 2025 Jens Petersen - 2.31.2-2 +- FHS Exception for /nix was approved (https://pagure.io/fesco/issue/3473) +- add multiuser setup to daemon subpackage +- add singleuser and nix-filesystem subpackages + +* Mon Sep 22 2025 Jens Petersen - 2.31.2-1 +- update to 2.31.2 + +* Wed Sep 17 2025 Jens Petersen - 2.31.1-6 +- list .so files explicitly without globbing (#2388768) +- disable /usr/lib/tmpfiles.d/nix-daemon.conf for now (#2388768) + +* Mon Sep 15 2025 Jens Petersen - 2.31.1-5 +- set the soversion to the nix version (#13995, #14001, #14005) + +* Sun Sep 14 2025 Jens Petersen - 2.31.1-4 +- add simple check with LD_LIBRARY_PATH + +* Fri Sep 12 2025 Jens Petersen - 2.31.1-3 +- revert to shared libs, add libs subpackage and restore devel +- apply upstream submitted PR to enable soname versioning (#13966) + +* Thu Sep 11 2025 Jens Petersen - 2.31.1-2 +- noarch nix-daemon subpackage cannot use _isa requires + +* Wed Sep 10 2025 Jens Petersen - 2.31.1-1 +- https://github.com/NixOS/nix/blob/2.31.1/doc/manual/source/release-notes/rl-2.31.md +- rename nix-core to base package +- use readline (#2388768) +- improve MESON_OPTS setup (zbyszek, #2388768) +- use static libs and drop devel package +- disable perl binding + +* Sat Aug 16 2025 Jens Petersen - 2.30.2-2 +- fix nix-devel requires +- add systemd scriptlets for nix-daemon + +* Fri Aug 15 2025 Jens Petersen - 2.30.2-1 +- initial packaging of nix programs without /nix diff --git a/nix.spec b/nix.spec index 8d7c8db..7179e1e 100644 --- a/nix.spec +++ b/nix.spec @@ -10,7 +10,7 @@ Name: nix # 2.32 needs boost >= 1.87 (https://bugzilla.redhat.com/show_bug.cgi?id=2406036) # (https://github.com/NixOS/nix/pull/14340) Version: 2.31.2 -Release: 8%{?dist} +Release: %autorelease Summary: A purely functional package manager License: LGPL-2.1-or-later @@ -347,71 +347,4 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %changelog -* Mon Oct 27 2025 Jens Petersen - 2.31.2-8 -- drop redundant sysusers and tmpfiles.d scriptlets (#2388768) -- add obsoletes for petersen/nix copr subpackages - -* Sat Oct 25 2025 Jens Petersen - 2.31.2-7 -- recommends nix-daemon if systemd - -* Sat Oct 25 2025 Jens Petersen - 2.31.2-6 -- rename users subpackage to system -- improve /nix/var dirs ownership and perms -- rename sysusers file to nix.conf -- move nix-daemon tmpfiles.d to nix-daemon - -* Sat Oct 25 2025 Jens Petersen - 2.31.2-5 -- split nix-users from nix-daemon and drop nix-singleuser -- drop all conflicts - -* Fri Oct 24 2025 Jens Petersen - 2.31.2-4 -- drop filesystem subpackage and ghost singleuser dirs -- nix-daemon and nix-singleuser conflict with each other - -* Thu Oct 23 2025 Jens Petersen - 2.31.2-3 -- use tmpfiles.d for nix-filesystem -- improve the readme -- list bin files explicitly -- nix-singleuser now owns its dirs -- add nix-daemon conflicts for ostree and containers -- add nix-singleuser recommends for containers - -* Sat Oct 18 2025 Jens Petersen - 2.31.2-2 -- FHS Exception for /nix was approved (https://pagure.io/fesco/issue/3473) -- add multiuser setup to daemon subpackage -- add singleuser and nix-filesystem subpackages - -* Mon Sep 22 2025 Jens Petersen - 2.31.2-1 -- update to 2.31.2 - -* Wed Sep 17 2025 Jens Petersen - 2.31.1-6 -- list .so files explicitly without globbing (#2388768) -- disable /usr/lib/tmpfiles.d/nix-daemon.conf for now (#2388768) - -* Mon Sep 15 2025 Jens Petersen - 2.31.1-5 -- set the soversion to the nix version (#13995, #14001, #14005) - -* Sun Sep 14 2025 Jens Petersen - 2.31.1-4 -- add simple check with LD_LIBRARY_PATH - -* Fri Sep 12 2025 Jens Petersen - 2.31.1-3 -- revert to shared libs, add libs subpackage and restore devel -- apply upstream submitted PR to enable soname versioning (#13966) - -* Thu Sep 11 2025 Jens Petersen - 2.31.1-2 -- noarch nix-daemon subpackage cannot use _isa requires - -* Wed Sep 10 2025 Jens Petersen - 2.31.1-1 -- https://github.com/NixOS/nix/blob/2.31.1/doc/manual/source/release-notes/rl-2.31.md -- rename nix-core to base package -- use readline (#2388768) -- improve MESON_OPTS setup (zbyszek, #2388768) -- use static libs and drop devel package -- disable perl binding - -* Sat Aug 16 2025 Jens Petersen - 2.30.2-2 -- fix nix-devel requires -- add systemd scriptlets for nix-daemon - -* Fri Aug 15 2025 Jens Petersen - 2.30.2-1 -- initial packaging of nix programs without /nix +%autochangelog From bc560500145e3a6dfca4d96181773f6d358f558f Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Mon, 3 Nov 2025 01:31:32 +0800 Subject: [PATCH 05/29] add core and legacy commands subpackages --- nix.spec | 61 +++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 20 deletions(-) diff --git a/nix.spec b/nix.spec index 7179e1e..ef80391 100644 --- a/nix.spec +++ b/nix.spec @@ -78,14 +78,10 @@ BuildRequires: sqlite-devel BuildRequires: systemd-rpm-macros BuildRequires: toml11-devel BuildRequires: xz-devel -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: %{name}-core = %{version}-%{release} Recommends: (%{name}-daemon = %{version}-%{release} if systemd) +Recommends: %{name}-legacy = %{version}-%{release} Recommends: %{name}-system = %{version}-%{release} -%ifarch x86_64 aarch64 ppc64le -Recommends: busybox -%endif -# added at F43 -Obsoletes: nix-core < %{version}-%{release} %description Nix is a purely functional package manager. It allows multiple @@ -98,6 +94,20 @@ it can be used equally well under other Unix systems. See the README.fedora.md file for setup instructions. +%package core +Summary: Core nix tool +Requires: %{name}-libs%{?_isa} = %{version}-%{release} +%ifarch x86_64 aarch64 ppc64le +Recommends: busybox +%endif + +%description core +This package provides the core nix tool for modern flake-based commands. + +Most users should probably install the main nix package instead, +or also nix-legacy if you need the older pre-flake nix-* commands. + + %package daemon Summary: The nix daemon for multiuser mode BuildArch: noarch @@ -137,6 +147,15 @@ Obsoletes: nix-singleuser < %{version}-%{release} The package provides the /nix root directory for the nix package manager. +%package legacy +Summary: nix classical commands +BuildArch: noarch +Requires: nix-core = %{version}-%{release} + +%description legacy +This package provides the symlinks for the older nix-* commands. + + %package libs Summary: Runtime libraries for %{name} @@ -238,22 +257,11 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %files + + +%files core %doc README.md README.fedora.md %{_bindir}/nix -%{_bindir}/nix-build -%{_bindir}/nix-channel -%{_bindir}/nix-collect-garbage -%{_bindir}/nix-copy-closure -%{_bindir}/nix-env -%{_bindir}/nix-hash -%{_bindir}/nix-instantiate -%{_bindir}/nix-prefetch-url -%{_bindir}/nix-shell -%{_bindir}/nix-store -%if %{with tests} -%exclude %{_bindir}/nix*-test -%endif -%exclude %{_bindir}/nix-daemon %{_libexecdir}/nix %config(noreplace) %{_sysconfdir}/nix/nix.conf %config(noreplace) %{_sysconfdir}/nix/registry.json @@ -306,6 +314,19 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %ghost %dir /nix +%files legacy +%{_bindir}/nix-build +%{_bindir}/nix-channel +%{_bindir}/nix-collect-garbage +%{_bindir}/nix-copy-closure +%{_bindir}/nix-env +%{_bindir}/nix-hash +%{_bindir}/nix-instantiate +%{_bindir}/nix-prefetch-url +%{_bindir}/nix-shell +%{_bindir}/nix-store + + %files libs %license COPYING %{_libdir}/libnixcmd.so.%{version} From 4ff55bf8c70486d5bee929dabfd58f3189d90c78 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Thu, 13 Nov 2025 12:48:35 +0800 Subject: [PATCH 06/29] enable manpages by patch to disable mdbook manual --- nix-disable-mdbook.patch | 46 ++++++++++++++++++++++++++++++++++++++++ nix.spec | 18 +++++++++++++++- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 nix-disable-mdbook.patch diff --git a/nix-disable-mdbook.patch b/nix-disable-mdbook.patch new file mode 100644 index 0000000..bf3a6c1 --- /dev/null +++ b/nix-disable-mdbook.patch @@ -0,0 +1,46 @@ +--- nix-2.31.2/doc/manual/meson.build~ 2025-09-18 04:25:38.000000000 +0800 ++++ nix-2.31.2/doc/manual/meson.build 2025-11-13 00:26:04.673032194 +0800 +@@ -7,7 +7,7 @@ + + nix = find_program('nix', native : true) + +-mdbook = find_program('mdbook', native : true) ++# mdbook = find_program('mdbook', native : true) + bash = find_program('bash', native : true) + rsync = find_program('rsync', required : true, native : true) + +@@ -89,13 +89,14 @@ + @0@ @INPUT1@ summary @2@ < @CURRENT_SOURCE_DIR@/source/SUMMARY.md.in > @2@/source/SUMMARY.md + sed -e 's|@version@|@3@|g' < @INPUT2@ > @2@/book.toml + @4@ -r --include='*.md' @CURRENT_SOURCE_DIR@/ @2@/ +- (cd @2@; RUST_LOG=warn @1@ build -d @2@ 3>&2 2>&1 1>&3) | { grep -Fv "because fragment resolution isn't implemented" || :; } 3>&2 2>&1 1>&3 +- rm -rf @2@/manual +- mv @2@/html @2@/manual +- find @2@/manual -iname meson.build -delete ++ # (cd @2@; RUST_LOG=warn @1@ build -d @2@ 3>&2 2>&1 1>&3) | { grep -Fv "because fragment resolution isn't implemented" || :; } 3>&2 2>&1 1>&3 ++ #rm -rf @2@/manual ++ #mv @2@/html @2@/manual ++ #find @2@/manual -iname meson.build -delete ++ ln -s source @2@/markdown + '''.format( + python.full_path(), +- mdbook.full_path(), ++ 'no-mdbk', + meson.current_build_dir(), + meson.project_version(), + rsync.full_path(), +@@ -130,10 +130,10 @@ + manual_html = manual[0] + manual_md = manual[1] + +-install_subdir( +- manual_html.full_path(), +- install_dir : get_option('datadir') / 'doc/nix', +-) ++# install_subdir( ++# manual_html.full_path(), ++# install_dir : get_option('datadir') / 'doc/nix', ++# ) + + nix_nested_manpages = [ + [ diff --git a/nix.spec b/nix.spec index ef80391..6b2c507 100644 --- a/nix.spec +++ b/nix.spec @@ -1,7 +1,7 @@ %global nixbld_group nixbld # needs mdbook: https://bugzilla.redhat.com/show_bug.cgi?id=2332609 -%bcond docs 0 +%bcond docs 1 # test failures complain NIX_STORE undefined # and missing rapidcheck %bcond tests 0 @@ -30,6 +30,9 @@ Patch1: https://patch-diff.githubusercontent.com/raw/NixOS/nix/pull/1400 Patch2: https://patch-diff.githubusercontent.com/raw/NixOS/nix/pull/14005.patch # https://github.com/NixOS/nix/pull/14018 Patch3: https://patch-diff.githubusercontent.com/raw/NixOS/nix/pull/14018.patch +# disable mdbook +# https://github.com/NixOS/nix/issues/14548 +Patch4: nix-disable-mdbook.patch # https://nixos.org/manual/nix/unstable/installation/prerequisites-source # missing aws-cpp-sdk-s3 aws-c-auth aws-c-s3 @@ -47,6 +50,7 @@ BuildRequires: busybox BuildRequires: cmake %if %{with docs} BuildRequires: doxygen +BuildRequires: rsync %endif BuildRequires: flex BuildRequires: gc-devel @@ -271,6 +275,12 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %{fish_completions_dir}/nix.fish %{zsh_completions_dir}/_nix %{zsh_completions_dir}/run-help-nix +%if %{with docs} +%{_mandir}/man1/nix.1* +%{_mandir}/man1/nix3-*.1* +%{_mandir}/man5/nix.conf.5* +%{_mandir}/man5/nix-profiles.5* +%endif %files daemon @@ -280,6 +290,9 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %{_tmpfilesdir}/nix-daemon.conf %ghost /nix/var/nix/daemon-socket %ghost /nix/var/nix/builds +%if %{with docs} +%{_mandir}/man8/nix-daemon.8* +%endif %files devel @@ -325,6 +338,9 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %{_bindir}/nix-prefetch-url %{_bindir}/nix-shell %{_bindir}/nix-store +%if %{with docs} +%{_mandir}/man1/nix-*.1* +%endif %files libs From d14e25bc8bc5e76aa07379f9c8e574460120e1e5 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Thu, 13 Nov 2025 22:40:02 +0800 Subject: [PATCH 07/29] simplify nix-disable-mdbook.patch: disable 2 more manual cmds --- nix-disable-mdbook.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nix-disable-mdbook.patch b/nix-disable-mdbook.patch index bf3a6c1..1453525 100644 --- a/nix-disable-mdbook.patch +++ b/nix-disable-mdbook.patch @@ -9,9 +9,9 @@ bash = find_program('bash', native : true) rsync = find_program('rsync', required : true, native : true) -@@ -89,13 +89,14 @@ - @0@ @INPUT1@ summary @2@ < @CURRENT_SOURCE_DIR@/source/SUMMARY.md.in > @2@/source/SUMMARY.md - sed -e 's|@version@|@3@|g' < @INPUT2@ > @2@/book.toml +@@ -89,13 +89,12 @@ +- @0@ @INPUT1@ summary @2@ < @CURRENT_SOURCE_DIR@/source/SUMMARY.md.in > @2@/source/SUMMARY.md +- sed -e 's|@version@|@3@|g' < @INPUT2@ > @2@/book.toml @4@ -r --include='*.md' @CURRENT_SOURCE_DIR@/ @2@/ - (cd @2@; RUST_LOG=warn @1@ build -d @2@ 3>&2 2>&1 1>&3) | { grep -Fv "because fragment resolution isn't implemented" || :; } 3>&2 2>&1 1>&3 - rm -rf @2@/manual From dc975f57c674ebfd011e22018f902dfe089ef93f Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Sat, 15 Nov 2025 14:14:39 +0800 Subject: [PATCH 08/29] filter out rellinks from manpages (#2415126) thanks Dennis Schridde for reporting sed expression generation assisted by Gemini Pro --- 14593.patch | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ nix.spec | 8 +++++++ 2 files changed, 69 insertions(+) create mode 100644 14593.patch diff --git a/14593.patch b/14593.patch new file mode 100644 index 0000000..e406e61 --- /dev/null +++ b/14593.patch @@ -0,0 +1,61 @@ +From ef6dbe76dc25e67b47dc9a8caa6dd29ff5996a20 Mon Sep 17 00:00:00 2001 +From: Jens Petersen +Date: Wed, 19 Nov 2025 15:50:43 +0800 +Subject: [PATCH] docs: fixup some rellinks to use ./ prefix for consistency + +"./" prefix is already used almost everywhere +--- + doc/manual/source/command-ref/nix-build.md | 6 +++--- + doc/manual/source/command-ref/nix-instantiate.md | 2 +- + src/nix/profile-diff-closures.md | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/doc/manual/source/command-ref/nix-build.md b/doc/manual/source/command-ref/nix-build.md +index 3bb59cbed12..860a1fc9745 100644 +--- a/doc/manual/source/command-ref/nix-build.md ++++ b/doc/manual/source/command-ref/nix-build.md +@@ -36,7 +36,7 @@ to a temporary location. The tarball must include a single top-level + directory containing at least a file named `default.nix`. + + `nix-build` is essentially a wrapper around +-[`nix-instantiate`](nix-instantiate.md) (to translate a high-level Nix ++[`nix-instantiate`](./nix-instantiate.md) (to translate a high-level Nix + expression to a low-level [store derivation]) and [`nix-store + --realise`](@docroot@/command-ref/nix-store/realise.md) (to build the store + derivation). +@@ -52,8 +52,8 @@ derivation). + # Options + + All options not listed here are passed to +-[`nix-store --realise`](nix-store/realise.md), +-except for `--arg` and `--attr` / `-A` which are passed to [`nix-instantiate`](nix-instantiate.md). ++[`nix-store --realise`](./nix-store/realise.md), ++except for `--arg` and `--attr` / `-A` which are passed to [`nix-instantiate`](./nix-instantiate.md). + + - [`--no-out-link`](#opt-no-out-link) + +diff --git a/doc/manual/source/command-ref/nix-instantiate.md b/doc/manual/source/command-ref/nix-instantiate.md +index 38454515d57..bac9f365933 100644 +--- a/doc/manual/source/command-ref/nix-instantiate.md ++++ b/doc/manual/source/command-ref/nix-instantiate.md +@@ -32,7 +32,7 @@ standard input. + + - `--add-root` *path* + +- See the [corresponding option](nix-store.md) in `nix-store`. ++ See the [corresponding option](./nix-store.md) in `nix-store`. + + - `--parse` + +diff --git a/src/nix/profile-diff-closures.md b/src/nix/profile-diff-closures.md +index 295d1252bcd..1cfed160f31 100644 +--- a/src/nix/profile-diff-closures.md ++++ b/src/nix/profile-diff-closures.md +@@ -23,6 +23,6 @@ R""( + + This command shows the difference between the closures of subsequent + versions of a profile. See [`nix store +-diff-closures`](nix3-store-diff-closures.md) for details. ++diff-closures`](./nix3-store-diff-closures.md) for details. + + )"" diff --git a/nix.spec b/nix.spec index 6b2c507..f636d51 100644 --- a/nix.spec +++ b/nix.spec @@ -33,6 +33,8 @@ Patch3: https://patch-diff.githubusercontent.com/raw/NixOS/nix/pull/1401 # disable mdbook # https://github.com/NixOS/nix/issues/14548 Patch4: nix-disable-mdbook.patch +# https://github.com/NixOS/nix/pull/14593 +Patch5: https://patch-diff.githubusercontent.com/raw/NixOS/nix/pull/14593.patch # https://nixos.org/manual/nix/unstable/installation/prerequisites-source # missing aws-cpp-sdk-s3 aws-c-auth aws-c-s3 @@ -239,6 +241,12 @@ touch %{buildroot}/nix/var/nix/gc.lock install -p -D -m 0644 %{SOURCE4} %{buildroot}%{_sysusersdir}/nix.conf install -p -D -m 0644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/nix-filesystem.conf +# filter out relative doc links +# https://bugzilla.redhat.com/show_bug.cgi?id=2415126 +# https://github.com/kristapsdz/lowdown/issues/170 +# (sed expression generated by Gemini Pro: removes .UR and .UE lines) +sed -i -e '/^\.UR [@#.]/,/^\.UE/{ /^\.UR [@#.]/d; /^\.UE/d}' %{buildroot}%{_mandir}/man*/* + %check LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help From b039f0f78ec84526baee9f01f49c2a3927239c72 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Tue, 25 Nov 2025 19:16:40 +0800 Subject: [PATCH 09/29] nix-system: drop the explicit nix requires In principle one could install nix-system and then use a custom nix binary. The Requires was a leftover from the old multiuser toplevel subpackage --- nix.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/nix.spec b/nix.spec index f636d51..9163b37 100644 --- a/nix.spec +++ b/nix.spec @@ -182,7 +182,6 @@ This package provides the nix-test programs. %package system Summary: Nix directories and sysusers setup BuildArch: noarch -Requires: %{name} = %{version}-%{release} Requires: %{name}-filesystem = %{version}-%{release} %description system From 8565b643b01f0a259230ccf5a488bc96b8e11543 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Tue, 25 Nov 2025 19:20:20 +0800 Subject: [PATCH 10/29] trivial: drop %name usage Seems redundant --- nix.spec | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/nix.spec b/nix.spec index 9163b37..dc3901e 100644 --- a/nix.spec +++ b/nix.spec @@ -84,10 +84,10 @@ BuildRequires: sqlite-devel BuildRequires: systemd-rpm-macros BuildRequires: toml11-devel BuildRequires: xz-devel -Requires: %{name}-core = %{version}-%{release} -Recommends: (%{name}-daemon = %{version}-%{release} if systemd) -Recommends: %{name}-legacy = %{version}-%{release} -Recommends: %{name}-system = %{version}-%{release} +Requires: nix-core = %{version}-%{release} +Recommends: (nix-daemon = %{version}-%{release} if systemd) +Recommends: nix-legacy = %{version}-%{release} +Recommends: nix-system = %{version}-%{release} %description Nix is a purely functional package manager. It allows multiple @@ -102,7 +102,7 @@ See the README.fedora.md file for setup instructions. %package core Summary: Core nix tool -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: nix-libs%{?_isa} = %{version}-%{release} %ifarch x86_64 aarch64 ppc64le Recommends: busybox %endif @@ -117,34 +117,34 @@ or also nix-legacy if you need the older pre-flake nix-* commands. %package daemon Summary: The nix daemon for multiuser mode BuildArch: noarch -Requires: %{name} = %{version}-%{release} -Requires: %{name}-system = %{version}-%{release} +Requires: nix = %{version}-%{release} +Requires: nix-system = %{version}-%{release} %description daemon This package provides nix-daemon and associated files. %package devel -Summary: Development files for %{name} -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Summary: Development files for nix +Requires: nix-libs%{?_isa} = %{version}-%{release} %description devel -The %{name}-devel package contains libraries and header files for -developing applications that use %{name}. +This package contains libraries and header files for +developing applications that use nix. %if %{with docs} %package doc -Summary: Documentation files for %{name} +Summary: Documentation files for nix BuildArch: noarch %description doc -The %{name}-doc package contains documentation files for %{name}. +This package contains documentation files for nix. %endif %package filesystem -Summary: Filesystem for %{name} +Summary: Filesystem for nix BuildArch: noarch # added at f43 Obsoletes: nix-singleuser < %{version}-%{release} @@ -163,16 +163,16 @@ This package provides the symlinks for the older nix-* commands. %package libs -Summary: Runtime libraries for %{name} +Summary: Runtime libraries for nix %description libs -The package provides the the runtime libraries for %{name}. +The package provides the the runtime libraries for nix. %if %{with tests} %package test Summary: Nix test programs -Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: nix%{?_isa} = %{version}-%{release} %description test This package provides the nix-test programs. @@ -182,7 +182,7 @@ This package provides the nix-test programs. %package system Summary: Nix directories and sysusers setup BuildArch: noarch -Requires: %{name}-filesystem = %{version}-%{release} +Requires: nix-filesystem = %{version}-%{release} %description system This package sets up the nix directories and sysusers. @@ -324,7 +324,7 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %if %{with docs} %files doc -%{_defaultdocdir}/%{name} +%{_defaultdocdir}/nix %endif From c12859be46361a3be4fef582e948ec24af1b9bc9 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Tue, 28 Oct 2025 01:34:18 +0800 Subject: [PATCH 11/29] use 2.24 for epel10 2.25 needs newer libgit2-1.9 2.24 was the nix version in nixos/nixpkgs 24.11 --- .gitignore | 1 + nix-2.24-meson-subprojects.patch | 46 +++++++++++ nix.spec | 135 +++++++++++-------------------- sources | 2 +- 4 files changed, 93 insertions(+), 91 deletions(-) create mode 100644 nix-2.24-meson-subprojects.patch diff --git a/.gitignore b/.gitignore index cfa454c..beabd4b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /nix-2.31.2.tar.gz +/nix-2.24.15.tar.gz diff --git a/nix-2.24-meson-subprojects.patch b/nix-2.24-meson-subprojects.patch new file mode 100644 index 0000000..f904472 --- /dev/null +++ b/nix-2.24-meson-subprojects.patch @@ -0,0 +1,46 @@ +--- nix-2.24.15/meson.build~ 2025-06-24 22:08:50.000000000 +0800 ++++ nix-2.24.15/meson.build 2025-10-27 20:16:46.076734050 +0800 +@@ -18,9 +18,9 @@ + # Executables + subproject('nix') + +-# Docs +-subproject('internal-api-docs') +-subproject('external-api-docs') ++# # Docs ++# subproject('internal-api-docs') ++# subproject('external-api-docs') + + # External C wrapper libraries + subproject('libutil-c') +@@ -28,17 +28,17 @@ + subproject('libexpr-c') + subproject('libmain-c') + +-# Language Bindings +-if not meson.is_cross_build() +- subproject('perl') +-endif ++# # Language Bindings ++# if not meson.is_cross_build() ++# subproject('perl') ++# endif + +-# Testing +-subproject('nix-util-test-support') +-subproject('nix-util-tests') +-subproject('nix-store-test-support') +-subproject('nix-store-tests') +-subproject('nix-fetchers-tests') +-subproject('nix-expr-test-support') +-subproject('nix-expr-tests') +-subproject('nix-flake-tests') ++# # Testing ++# subproject('nix-util-test-support') ++# subproject('nix-util-tests') ++# subproject('nix-store-test-support') ++# subproject('nix-store-tests') ++# subproject('nix-fetchers-tests') ++# subproject('nix-expr-test-support') ++# subproject('nix-expr-tests') ++# subproject('nix-flake-tests') diff --git a/nix.spec b/nix.spec index 8d7c8db..293c382 100644 --- a/nix.spec +++ b/nix.spec @@ -7,10 +7,9 @@ %bcond tests 0 Name: nix -# 2.32 needs boost >= 1.87 (https://bugzilla.redhat.com/show_bug.cgi?id=2406036) -# (https://github.com/NixOS/nix/pull/14340) -Version: 2.31.2 -Release: 8%{?dist} +# 2.25 needs libgit2-1.9 +Version: 2.24.15 +Release: 1%{?dist} Summary: A purely functional package manager License: LGPL-2.1-or-later @@ -31,6 +30,8 @@ Patch2: https://patch-diff.githubusercontent.com/raw/NixOS/nix/pull/1400 # https://github.com/NixOS/nix/pull/14018 Patch3: https://patch-diff.githubusercontent.com/raw/NixOS/nix/pull/14018.patch +Patch10: nix-2.24-meson-subprojects.patch + # https://nixos.org/manual/nix/unstable/installation/prerequisites-source # missing aws-cpp-sdk-s3 aws-c-auth aws-c-s3 #BuildRequires: aws-c-common @@ -38,7 +39,6 @@ BuildRequires: bison BuildRequires: blake3-devel BuildRequires: bzip2-devel BuildRequires: boost-devel -BuildRequires: boost-url BuildRequires: brotli-devel %ifarch x86_64 aarch64 ppc64le BuildRequires: busybox @@ -175,20 +175,11 @@ MESON_OPTS=( --sysconfdir=%{_sysconfdir} --localstatedir=/nix/var --libexecdir=%{_libexecdir} - -Dbindings=false - -Ddoc-gen=%[%{with docs}?"true":"false"] -Dlibcmd:readline-flavor=readline -Dlibstore:sandbox-shell=%{_bindir}/busybox - -Dnix:profile-dir=%{_sysconfdir}/profile.d - -Dunit-tests=%[%{with tests}?"true":"false"] -%ifarch x86_64 -# missing from epel10: https://bugzilla.redhat.com/show_bug.cgi?id=2368495 -%if %{undefined fedora} + # -Dnix:profile-dir=%%{_sysconfdir}/profile.d + # [x86_64] missing from epel10: https://bugzilla.redhat.com/show_bug.cgi?id=2368495 -Dlibutil:cpuid=disabled -%endif -%else - -Dlibutil:cpuid=disabled -%endif ) %meson "${MESON_OPTS[@]}" @@ -210,12 +201,38 @@ mkdir -p %{buildroot}/nix/store mkdir -p %{buildroot}/nix/var/log/nix/drvs # make per-user directories mkdir -p %{buildroot}/nix/var/nix/{gcroots,profiles}/per-user -mkdir %{buildroot}/nix/var/nix/{db,temproots} +mkdir %{buildroot}/nix/var/nix/{builds,db,temproots} touch %{buildroot}/nix/var/nix/gc.lock install -p -D -m 0644 %{SOURCE4} %{buildroot}%{_sysusersdir}/nix.conf install -p -D -m 0644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/nix-filesystem.conf +( cd %{buildroot}%{_bindir} + for i in build channel collect-garbage copy-closure daemon env hash instantiate prefetch-url shell store; do + ln -s nix nix-$i + done +) +mkdir -p %{buildroot}%{_libexecdir}/nix +ln -s ../../bin/nix %{buildroot}%{_libexecdir}/nix/build-remote + +mkdir -p %{buildroot}%{_sysconfdir}/profile.d +for i in sh fish; do + cat scripts/nix-daemon.$i.in | sed -e 's!@localstatedir@!/nix/var!' > %{buildroot}%{_sysconfdir}/profile.d/nix.$i + cat scripts/nix-profile-daemon.$i.in | sed -e 's!@localstatedir@!/nix/var!' > %{buildroot}%{_sysconfdir}/profile.d/nix-daemon.$i +done + +install -m 644 -D misc/bash/completion.sh %{buildroot}%{bash_completions_dir}/nix +install -m 644 -D misc/fish/completion.fish %{buildroot}%{fish_completions_dir}/nix.fish +install -m 644 -D misc/zsh/completion.zsh %{buildroot}%{zsh_completions_dir}/_nix +install -m 644 -D misc/zsh/run-help-nix %{buildroot}%{zsh_completions_dir}/run-help-nix + +mkdir -p %{buildroot}%{_unitdir} +for i in service socket; do + cat misc/systemd/nix-daemon.$i.in | sed -e 's!@localstatedir@!/nix/var!' -e 's!@storedir@!/nix/store!' -e 's!@@bindir@!%{_bindir}!' > %{buildroot}%{_unitdir}/nix-daemon.$i +done +mkdir -p %{buildroot}%{_tmpfilesdir} +cat misc/systemd/nix-daemon.conf.in | sed -e 's!@localstatedir@!/nix/var!' > %{buildroot}%{_tmpfilesdir}/nix-daemon.conf + %check LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help @@ -237,6 +254,14 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %systemd_postun_with_restart nix-daemon.service +%pre filesystem +%tmpfiles_create_package nix-filesystem %SOURCE5 + + +%pre system +%sysusers_create_package nix-system %SOURCE4 + + %files %doc README.md README.fedora.md %{_bindir}/nix @@ -271,20 +296,16 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %{_unitdir}/nix-daemon.* %{_tmpfilesdir}/nix-daemon.conf %ghost /nix/var/nix/daemon-socket -%ghost /nix/var/nix/builds +%dir /nix/var/nix/builds %files devel %{_includedir}/nix -%{_includedir}/nix_api_*.h -%{_includedir}/nix_api_*.hh %{_libdir}/libnixcmd.so %{_libdir}/libnixexpr.so %{_libdir}/libnixexprc.so %{_libdir}/libnixfetchers.so -%{_libdir}/libnixfetchersc.so %{_libdir}/libnixflake.so -%{_libdir}/libnixflakec.so %{_libdir}/libnixmain.so %{_libdir}/libnixmainc.so %{_libdir}/libnixstore.so @@ -347,71 +368,5 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %changelog -* Mon Oct 27 2025 Jens Petersen - 2.31.2-8 -- drop redundant sysusers and tmpfiles.d scriptlets (#2388768) -- add obsoletes for petersen/nix copr subpackages - -* Sat Oct 25 2025 Jens Petersen - 2.31.2-7 -- recommends nix-daemon if systemd - -* Sat Oct 25 2025 Jens Petersen - 2.31.2-6 -- rename users subpackage to system -- improve /nix/var dirs ownership and perms -- rename sysusers file to nix.conf -- move nix-daemon tmpfiles.d to nix-daemon - -* Sat Oct 25 2025 Jens Petersen - 2.31.2-5 -- split nix-users from nix-daemon and drop nix-singleuser -- drop all conflicts - -* Fri Oct 24 2025 Jens Petersen - 2.31.2-4 -- drop filesystem subpackage and ghost singleuser dirs -- nix-daemon and nix-singleuser conflict with each other - -* Thu Oct 23 2025 Jens Petersen - 2.31.2-3 -- use tmpfiles.d for nix-filesystem -- improve the readme -- list bin files explicitly -- nix-singleuser now owns its dirs -- add nix-daemon conflicts for ostree and containers -- add nix-singleuser recommends for containers - -* Sat Oct 18 2025 Jens Petersen - 2.31.2-2 -- FHS Exception for /nix was approved (https://pagure.io/fesco/issue/3473) -- add multiuser setup to daemon subpackage -- add singleuser and nix-filesystem subpackages - -* Mon Sep 22 2025 Jens Petersen - 2.31.2-1 -- update to 2.31.2 - -* Wed Sep 17 2025 Jens Petersen - 2.31.1-6 -- list .so files explicitly without globbing (#2388768) -- disable /usr/lib/tmpfiles.d/nix-daemon.conf for now (#2388768) - -* Mon Sep 15 2025 Jens Petersen - 2.31.1-5 -- set the soversion to the nix version (#13995, #14001, #14005) - -* Sun Sep 14 2025 Jens Petersen - 2.31.1-4 -- add simple check with LD_LIBRARY_PATH - -* Fri Sep 12 2025 Jens Petersen - 2.31.1-3 -- revert to shared libs, add libs subpackage and restore devel -- apply upstream submitted PR to enable soname versioning (#13966) - -* Thu Sep 11 2025 Jens Petersen - 2.31.1-2 -- noarch nix-daemon subpackage cannot use _isa requires - -* Wed Sep 10 2025 Jens Petersen - 2.31.1-1 -- https://github.com/NixOS/nix/blob/2.31.1/doc/manual/source/release-notes/rl-2.31.md -- rename nix-core to base package -- use readline (#2388768) -- improve MESON_OPTS setup (zbyszek, #2388768) -- use static libs and drop devel package -- disable perl binding - -* Sat Aug 16 2025 Jens Petersen - 2.30.2-2 -- fix nix-devel requires -- add systemd scriptlets for nix-daemon - -* Fri Aug 15 2025 Jens Petersen - 2.30.2-1 -- initial packaging of nix programs without /nix +* Wed Nov 26 2025 Jens Petersen - 2.24.15-1 +- initial epel10 package diff --git a/sources b/sources index 5485fe4..1bd2674 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nix-2.31.2.tar.gz) = ba2aa53cfb2527c7702340ac862a427a07d4a7bac8149cfc24d34ce2e0f980a8e70103e1ddf1c231cb5cd0bf4ddfe56a6fa618cd561501a03b8b064cea84bfcf +SHA512 (nix-2.24.15.tar.gz) = d731b8dee5cd43670c117922c2d550fc8ba42791072928839fbcb81c7ef5d7b4908d02c0daf91ad923ee1e32030c9f319b1fccec3ae1027682770fccb9b79b88 From c823eaafee839a10b5781c4aa2ff67249c10d63e Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Tue, 28 Oct 2025 14:25:09 +0800 Subject: [PATCH 12/29] backport meson soversion changes from 2.32 --- nix-2.24-meson-soversion.patch | 131 +++++++++++++++++++++++++++++++++ nix.spec | 17 ++--- 2 files changed, 137 insertions(+), 11 deletions(-) create mode 100644 nix-2.24-meson-soversion.patch diff --git a/nix-2.24-meson-soversion.patch b/nix-2.24-meson-soversion.patch new file mode 100644 index 0000000..f8745de --- /dev/null +++ b/nix-2.24-meson-soversion.patch @@ -0,0 +1,131 @@ +diff -up nix-2.24.15/build-utils-meson/deps-lists/meson.build~ nix-2.24.15/build-utils-meson/deps-lists/meson.build +--- nix-2.24.15/build-utils-meson/deps-lists/meson.build~ 2025-06-24 22:08:50.000000000 +0800 ++++ nix-2.24.15/build-utils-meson/deps-lists/meson.build 2025-10-28 14:08:08.310546077 +0800 +@@ -34,3 +34,6 @@ deps_public_subproject = [ ] + # These are dependencencies without pkg-config files. Ideally they are + # just private, but they may also be public (e.g. boost). + deps_other = [ ] ++ ++# backport from 2.32 ++nix_soversion = meson.project_version().split('pre')[0] +diff -up nix-2.24.15/src/libcmd/meson.build~ nix-2.24.15/src/libcmd/meson.build +--- nix-2.24.15/src/libcmd/meson.build~ 2025-06-24 22:08:50.000000000 +0800 ++++ nix-2.24.15/src/libcmd/meson.build 2025-10-28 14:11:15.897054822 +0800 +@@ -120,6 +120,7 @@ headers = [config_h] + files( + this_library = library( + 'nixcmd', + sources, ++ soversion : nix_soversion, + dependencies : deps_public + deps_private + deps_other, + prelink : true, # For C++ static initializers + install : true, +diff -up nix-2.24.15/src/libexpr-c/meson.build~ nix-2.24.15/src/libexpr-c/meson.build +--- nix-2.24.15/src/libexpr-c/meson.build~ 2025-06-24 22:08:50.000000000 +0800 ++++ nix-2.24.15/src/libexpr-c/meson.build 2025-10-28 14:11:44.075833247 +0800 +@@ -79,6 +79,7 @@ subdir('build-utils-meson/export-all-sym + this_library = library( + 'nixexprc', + sources, ++ soversion : nix_soversion, + dependencies : deps_public + deps_private + deps_other, + include_directories : include_dirs, + link_args: linker_export_flags, +diff -up nix-2.24.15/src/libexpr/meson.build~ nix-2.24.15/src/libexpr/meson.build +--- nix-2.24.15/src/libexpr/meson.build~ 2025-06-24 22:08:50.000000000 +0800 ++++ nix-2.24.15/src/libexpr/meson.build 2025-10-28 14:17:42.434477907 +0800 +@@ -196,6 +196,7 @@ + parser_tab, + lexer_tab, + generated_headers, ++ soversion : nix_soversion, + dependencies : deps_public + deps_private + deps_other, + prelink : true, # For C++ static initializers + install : true, +diff -up nix-2.24.15/src/libfetchers/meson.build~ nix-2.24.15/src/libfetchers/meson.build +--- nix-2.24.15/src/libfetchers/meson.build~ 2025-06-24 22:08:50.000000000 +0800 ++++ nix-2.24.15/src/libfetchers/meson.build 2025-10-28 14:12:33.066448037 +0800 +@@ -83,6 +83,7 @@ headers = files( + this_library = library( + 'nixfetchers', + sources, ++ soversion : nix_soversion, + dependencies : deps_public + deps_private + deps_other, + prelink : true, # For C++ static initializers + install : true, +diff -up nix-2.24.15/src/libflake/meson.build~ nix-2.24.15/src/libflake/meson.build +--- nix-2.24.15/src/libflake/meson.build~ 2025-06-24 22:08:50.000000000 +0800 ++++ nix-2.24.15/src/libflake/meson.build 2025-10-28 14:12:55.184274120 +0800 +@@ -65,6 +65,7 @@ headers = files( + this_library = library( + 'nixflake', + sources, ++ soversion : nix_soversion, + dependencies : deps_public + deps_private + deps_other, + prelink : true, # For C++ static initializers + install : true, +diff -up nix-2.24.15/src/libmain-c/meson.build~ nix-2.24.15/src/libmain-c/meson.build +--- nix-2.24.15/src/libmain-c/meson.build~ 2025-06-24 22:08:50.000000000 +0800 ++++ nix-2.24.15/src/libmain-c/meson.build 2025-10-28 14:13:37.008945244 +0800 +@@ -72,6 +72,7 @@ subdir('build-utils-meson/export-all-sym + this_library = library( + 'nixmainc', + sources, ++ soversion : nix_soversion, + dependencies : deps_public + deps_private + deps_other, + include_directories : include_dirs, + link_args: linker_export_flags, +diff -up nix-2.24.15/src/libmain/meson.build~ nix-2.24.15/src/libmain/meson.build +--- nix-2.24.15/src/libmain/meson.build~ 2025-06-24 22:08:50.000000000 +0800 ++++ nix-2.24.15/src/libmain/meson.build 2025-10-28 14:13:17.906095454 +0800 +@@ -89,6 +89,7 @@ headers = [config_h] + files( + this_library = library( + 'nixmain', + sources, ++ soversion : nix_soversion, + dependencies : deps_public + deps_private + deps_other, + prelink : true, # For C++ static initializers + install : true, +diff -up nix-2.24.15/src/libstore-c/meson.build~ nix-2.24.15/src/libstore-c/meson.build +--- nix-2.24.15/src/libstore-c/meson.build~ 2025-06-24 22:08:50.000000000 +0800 ++++ nix-2.24.15/src/libstore-c/meson.build 2025-10-28 14:14:19.875608176 +0800 +@@ -71,6 +71,7 @@ subdir('build-utils-meson/export-all-sym + this_library = library( + 'nixstorec', + sources, ++ soversion : nix_soversion, + dependencies : deps_public + deps_private + deps_other, + include_directories : include_dirs, + link_args: linker_export_flags, +diff -up nix-2.24.15/src/libstore/meson.build~ nix-2.24.15/src/libstore/meson.build +--- nix-2.24.15/src/libstore/meson.build~ 2025-06-24 22:08:50.000000000 +0800 ++++ nix-2.24.15/src/libstore/meson.build 2025-10-28 14:14:07.585704814 +0800 +@@ -416,6 +416,7 @@ this_library = library( + 'nixstore', + generated_headers, + sources, ++ soversion : nix_soversion, + dependencies : deps_public + deps_private + deps_other, + include_directories : include_dirs, + cpp_args : cpp_args, +diff -up nix-2.24.15/src/libutil-c/meson.build~ nix-2.24.15/src/libutil-c/meson.build +--- nix-2.24.15/src/libutil-c/meson.build~ 2025-06-24 22:08:50.000000000 +0800 ++++ nix-2.24.15/src/libutil-c/meson.build 2025-10-28 14:14:38.424462323 +0800 +@@ -67,6 +67,7 @@ subdir('build-utils-meson/export-all-sym + this_library = library( + 'nixutilc', + sources, ++ soversion : nix_soversion, + dependencies : deps_public + deps_private + deps_other, + include_directories : include_dirs, + link_args: linker_export_flags, +diff -up nix-2.24.15/src/libutil/meson.build~ nix-2.24.15/src/libutil/meson.build +--- nix-2.24.15/src/libutil/meson.build~ 2025-06-24 22:08:50.000000000 +0800 ++++ nix-2.24.15/src/libutil/meson.build 2025-10-28 14:03:41.692680809 +0800 +@@ -258,6 +258,7 @@ subdir('build-utils-meson/export-all-sym + this_library = library( + 'nixutil', + sources, ++ soversion : nix_soversion, + dependencies : deps_public + deps_private + deps_other, + include_directories : include_dirs, + link_args: linker_export_flags, diff --git a/nix.spec b/nix.spec index 293c382..8d3f628 100644 --- a/nix.spec +++ b/nix.spec @@ -20,17 +20,14 @@ Source2: registry.json Source3: README.md Source4: nix.sysusers Source5: nix-filesystem.conf -# soversion patches: -# https://github.com/NixOS/nix/pull/13995 -Patch0: https://patch-diff.githubusercontent.com/raw/NixOS/nix/pull/13995.patch -# https://github.com/NixOS/nix/pull/14001 -Patch1: https://patch-diff.githubusercontent.com/raw/NixOS/nix/pull/14001.patch -# https://github.com/NixOS/nix/pull/14005 -Patch2: https://patch-diff.githubusercontent.com/raw/NixOS/nix/pull/14005.patch -# https://github.com/NixOS/nix/pull/14018 -Patch3: https://patch-diff.githubusercontent.com/raw/NixOS/nix/pull/14018.patch Patch10: nix-2.24-meson-subprojects.patch +# backport 2.32 soversion patches: +# https://github.com/NixOS/nix/pull/13995 +# https://github.com/NixOS/nix/pull/14001 +# https://github.com/NixOS/nix/pull/14005 +# https://github.com/NixOS/nix/pull/14018 +Patch11: nix-2.24-meson-soversion.patch # https://nixos.org/manual/nix/unstable/installation/prerequisites-source # missing aws-cpp-sdk-s3 aws-c-auth aws-c-s3 @@ -333,9 +330,7 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %{_libdir}/libnixexpr.so.%{version} %{_libdir}/libnixexprc.so.%{version} %{_libdir}/libnixfetchers.so.%{version} -%{_libdir}/libnixfetchersc.so.%{version} %{_libdir}/libnixflake.so.%{version} -%{_libdir}/libnixflakec.so.%{version} %{_libdir}/libnixmain.so.%{version} %{_libdir}/libnixmainc.so.%{version} %{_libdir}/libnixstore.so.%{version} From 1c7a003fe14be004ec78b56a53abdd48ac9e8ccd Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Tue, 28 Oct 2025 19:01:32 +0800 Subject: [PATCH 13/29] nix.conf: define system to help older nix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise get: $ nix-shell -p hello error: … while evaluating a branch condition at /nix/store/yjjfcydivzfdhpqwrm4pwa3v26r9cdxf-source/pkgs/stdenv/booter.nix:68:9: 67| pred: n: 68| if n == len then | ^ 69| rnul pred … while calling the 'length' builtin at /nix/store/yjjfcydivzfdhpqwrm4pwa3v26r9cdxf-source/pkgs/stdenv/booter.nix:65:13: 64| let 65| len = builtins.length list; | ^ 66| go = (stack trace truncated; use '--show-trace' to show the full, detailed trace) error: system string 'linux' with 1 component is ambiguous --- nix.conf | 1 + nix.spec | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/nix.conf b/nix.conf index fd3e6cc..723bbe4 100644 --- a/nix.conf +++ b/nix.conf @@ -5,3 +5,4 @@ bash-prompt-prefix = (nix:$name)\040 experimental-features = nix-command flakes extra-nix-path = nixpkgs=flake:nixpkgs max-jobs = auto +system = @ARCH@-linux diff --git a/nix.spec b/nix.spec index 8d3f628..95b0a98 100644 --- a/nix.spec +++ b/nix.spec @@ -188,7 +188,9 @@ MESON_OPTS=( # nix config mkdir -p %{buildroot}/etc/nix -cp %{SOURCE1} %{SOURCE2} %{buildroot}/etc/nix/ +# for older nix to avoid "error: system string 'linux' with 1 component is ambiguous" +cat %{SOURCE1} | sed -e "s/@ARCH@/%{_arch}/" > %{buildroot}/etc/nix/nix.conf +cp %{SOURCE2} %{buildroot}/etc/nix/ # Nix has multiuser and singleuser installation modes From 011f62545e09bd420e6c5c39f7ff4dc14b1d3c8d Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Wed, 26 Nov 2025 19:21:59 +0800 Subject: [PATCH 14/29] backport packaging changes from fedora: add nix-core and nix-legacy --- nix.spec | 108 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 70 insertions(+), 38 deletions(-) diff --git a/nix.spec b/nix.spec index 95b0a98..b037c72 100644 --- a/nix.spec +++ b/nix.spec @@ -75,14 +75,10 @@ BuildRequires: sqlite-devel BuildRequires: systemd-rpm-macros BuildRequires: toml11-devel BuildRequires: xz-devel -Requires: %{name}-libs%{?_isa} = %{version}-%{release} -Recommends: (%{name}-daemon = %{version}-%{release} if systemd) -Recommends: %{name}-system = %{version}-%{release} -%ifarch x86_64 aarch64 ppc64le -Recommends: busybox -%endif -# added at F43 -Obsoletes: nix-core < %{version}-%{release} +Requires: nix-core = %{version}-%{release} +Recommends: (nix-daemon = %{version}-%{release} if systemd) +Recommends: nix-legacy = %{version}-%{release} +Recommends: nix-system = %{version}-%{release} %description Nix is a purely functional package manager. It allows multiple @@ -95,37 +91,51 @@ it can be used equally well under other Unix systems. See the README.fedora.md file for setup instructions. +%package core +Summary: Core nix tool +Requires: nix-libs%{?_isa} = %{version}-%{release} +%ifarch x86_64 aarch64 ppc64le +Recommends: busybox +%endif + +%description core +This package provides the core nix tool for modern flake-based commands. + +Most users should probably install the main nix package instead, +or also nix-legacy if you need the older pre-flake nix-* commands. + + %package daemon Summary: The nix daemon for multiuser mode BuildArch: noarch -Requires: %{name} = %{version}-%{release} -Requires: %{name}-system = %{version}-%{release} +Requires: nix = %{version}-%{release} +Requires: nix-system = %{version}-%{release} %description daemon This package provides nix-daemon and associated files. %package devel -Summary: Development files for %{name} -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Summary: Development files for nix +Requires: nix-libs%{?_isa} = %{version}-%{release} %description devel -The %{name}-devel package contains libraries and header files for -developing applications that use %{name}. +This package contains libraries and header files for +developing applications that use nix. %if %{with docs} %package doc -Summary: Documentation files for %{name} +Summary: Documentation files for nix BuildArch: noarch %description doc -The %{name}-doc package contains documentation files for %{name}. +This package contains documentation files for nix. %endif %package filesystem -Summary: Filesystem for %{name} +Summary: Filesystem for nix BuildArch: noarch # added at f43 Obsoletes: nix-singleuser < %{version}-%{release} @@ -134,17 +144,26 @@ Obsoletes: nix-singleuser < %{version}-%{release} The package provides the /nix root directory for the nix package manager. +%package legacy +Summary: nix classical commands +BuildArch: noarch +Requires: nix-core = %{version}-%{release} + +%description legacy +This package provides the symlinks for the older nix-* commands. + + %package libs -Summary: Runtime libraries for %{name} +Summary: Runtime libraries for nix %description libs -The package provides the the runtime libraries for %{name}. +The package provides the the runtime libraries for nix. %if %{with tests} %package test Summary: Nix test programs -Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: nix%{?_isa} = %{version}-%{release} %description test This package provides the nix-test programs. @@ -154,8 +173,7 @@ This package provides the nix-test programs. %package system Summary: Nix directories and sysusers setup BuildArch: noarch -Requires: %{name} = %{version}-%{release} -Requires: %{name}-filesystem = %{version}-%{release} +Requires: nix-filesystem = %{version}-%{release} %description system This package sets up the nix directories and sysusers. @@ -262,22 +280,11 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %files + + +%files core %doc README.md README.fedora.md %{_bindir}/nix -%{_bindir}/nix-build -%{_bindir}/nix-channel -%{_bindir}/nix-collect-garbage -%{_bindir}/nix-copy-closure -%{_bindir}/nix-env -%{_bindir}/nix-hash -%{_bindir}/nix-instantiate -%{_bindir}/nix-prefetch-url -%{_bindir}/nix-shell -%{_bindir}/nix-store -%if %{with tests} -%exclude %{_bindir}/nix*-test -%endif -%exclude %{_bindir}/nix-daemon %{_libexecdir}/nix %config(noreplace) %{_sysconfdir}/nix/nix.conf %config(noreplace) %{_sysconfdir}/nix/registry.json @@ -287,6 +294,12 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %{fish_completions_dir}/nix.fish %{zsh_completions_dir}/_nix %{zsh_completions_dir}/run-help-nix +%if %{with docs} +%{_mandir}/man1/nix.1* +%{_mandir}/man1/nix3-*.1* +%{_mandir}/man5/nix.conf.5* +%{_mandir}/man5/nix-profiles.5* +%endif %files daemon @@ -295,7 +308,10 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %{_unitdir}/nix-daemon.* %{_tmpfilesdir}/nix-daemon.conf %ghost /nix/var/nix/daemon-socket -%dir /nix/var/nix/builds +%ghost /nix/var/nix/builds +%if %{with docs} +%{_mandir}/man8/nix-daemon.8* +%endif %files devel @@ -316,7 +332,7 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %if %{with docs} %files doc -%{_defaultdocdir}/%{name} +%{_defaultdocdir}/nix %endif @@ -326,6 +342,22 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %ghost %dir /nix +%files legacy +%{_bindir}/nix-build +%{_bindir}/nix-channel +%{_bindir}/nix-collect-garbage +%{_bindir}/nix-copy-closure +%{_bindir}/nix-env +%{_bindir}/nix-hash +%{_bindir}/nix-instantiate +%{_bindir}/nix-prefetch-url +%{_bindir}/nix-shell +%{_bindir}/nix-store +%if %{with docs} +%{_mandir}/man1/nix-*.1* +%endif + + %files libs %license COPYING %{_libdir}/libnixcmd.so.%{version} From 901563692b98d683db55f08950cfe9b1104581ee Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Thu, 27 Nov 2025 14:57:20 +0800 Subject: [PATCH 15/29] remove unicode RLO chars from rl-2.26.md https://github.com/NixOS/nix/issues/14666 rpminspect says: BAD A forbidden code point, 0x202E, was found in the nix-2.31.2/doc/manual/source/release-notes/rl-2.26.md source file on line 115 at column 2. This source file is used by nix.spec. [Security] --- nix.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nix.spec b/nix.spec index dc3901e..122b116 100644 --- a/nix.spec +++ b/nix.spec @@ -193,6 +193,10 @@ This package sets up the nix directories and sysusers. install -p -m 0644 %{SOURCE3} README.fedora.md +# https://github.com/NixOS/nix/issues/14666 +# remove unicode RLO (0x202E) characters +sed -i 's/\xe2\x80\xae//g' doc/manual/source/release-notes/rl-2.26.md + %build MESON_OPTS=( From 80a7a7982b1562c1499d58282b65e4469853471b Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Fri, 28 Nov 2025 11:08:47 +0800 Subject: [PATCH 16/29] move /nix/var dirs to nix-filesystem where they are actually created --- nix.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nix.spec b/nix.spec index 122b116..cab6257 100644 --- a/nix.spec +++ b/nix.spec @@ -336,6 +336,9 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help # FHS Exception: https://pagure.io/fesco/issue/3473 %{_tmpfilesdir}/nix-filesystem.conf %ghost %dir /nix +%ghost %dir /nix/var +%ghost %dir /nix/var/log +%ghost %dir /nix/var/log/nix %files legacy @@ -380,9 +383,6 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %files system %{_sysusersdir}/nix.conf %dir %attr(1775,root,%{nixbld_group}) /nix/store -%dir /nix/var -%dir /nix/var/log -%dir /nix/var/log/nix %dir %attr(1775,root,%{nixbld_group}) /nix/var/log/nix/drvs %dir %attr(775,root,%{nixbld_group}) /nix/var/nix %dir %attr(775,root,%{nixbld_group}) /nix/var/nix/db From dfa17d8c501b73296faaa7951b3f87d717261403 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Thu, 27 Nov 2025 21:07:33 +0800 Subject: [PATCH 17/29] nix-daemon: requires nix-core instead of base package --- nix.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix.spec b/nix.spec index cab6257..859ac89 100644 --- a/nix.spec +++ b/nix.spec @@ -117,7 +117,7 @@ or also nix-legacy if you need the older pre-flake nix-* commands. %package daemon Summary: The nix daemon for multiuser mode BuildArch: noarch -Requires: nix = %{version}-%{release} +Requires: nix-core = %{version}-%{release} Requires: nix-system = %{version}-%{release} %description daemon From 64346930c91ced448db57a50d76486cf57afcfc0 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Fri, 28 Nov 2025 11:11:22 +0800 Subject: [PATCH 18/29] only stick bit for /nix/store; move /nix/var/nix/builds to nix-system --- nix.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nix.spec b/nix.spec index 859ac89..9a8aa0b 100644 --- a/nix.spec +++ b/nix.spec @@ -300,7 +300,6 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %{_unitdir}/nix-daemon.* %{_tmpfilesdir}/nix-daemon.conf %ghost /nix/var/nix/daemon-socket -%ghost /nix/var/nix/builds %if %{with docs} %{_mandir}/man8/nix-daemon.8* %endif @@ -383,14 +382,15 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %files system %{_sysusersdir}/nix.conf %dir %attr(1775,root,%{nixbld_group}) /nix/store -%dir %attr(1775,root,%{nixbld_group}) /nix/var/log/nix/drvs +%dir %attr(775,root,%{nixbld_group}) /nix/var/log/nix/drvs %dir %attr(775,root,%{nixbld_group}) /nix/var/nix +%dir %attr(775,root,%{nixbld_group}) /nix/var/nix/builds %dir %attr(775,root,%{nixbld_group}) /nix/var/nix/db %attr(664,root,%{nixbld_group}) /nix/var/nix/gc.lock %dir %attr(775,root,%{nixbld_group}) /nix/var/nix/gcroots -%dir %attr(1755,root,%{nixbld_group}) /nix/var/nix/gcroots/per-user +%dir %attr(755,root,%{nixbld_group}) /nix/var/nix/gcroots/per-user %dir %attr(775,root,%{nixbld_group}) /nix/var/nix/profiles -%dir %attr(1755,root,%{nixbld_group}) /nix/var/nix/profiles/per-user +%dir %attr(755,root,%{nixbld_group}) /nix/var/nix/profiles/per-user %attr(775,root,%{nixbld_group}) /nix/var/nix/temproots From 0d43c987949a41dc79e11637735b52f2ba6890b6 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Fri, 28 Nov 2025 10:50:22 +0800 Subject: [PATCH 19/29] base package now requires nix-system: drop owning /nix/var/nix/* This allows nix-system to work for both nix-daemon and single-user setups (following discussion in #nix-dev) --- README.md | 26 ++++++++++++++------------ nix.spec | 16 ++-------------- 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 76fbba7..3d8b4e4 100644 --- a/README.md +++ b/README.md @@ -5,42 +5,44 @@ Nix has two different modes of operation: ## Daemon mode for multi-user setup This is recommended by upstream and more seamless. +The `nix-daemon` requires functioning systemd. -Just install the `nix` or `nix-daemon` package -(the latter is recommended by the `nix` package) and run: +Just install the `nix` package, which pulls in `nix-daemon`, +by running: ``` -$ sudo dnf install nix-daemon +$ sudo dnf install nix nix-daemon $ sudo systemctl enable --now nix-daemon ``` ## Single-user mode without nix-daemon -This mode works in rootless containers without systemd. +This mode also works in rootless containers and without systemd. Run: ``` -$ sudo dnf install nix nix-system --exclude nix-daemon -$ sudo usermod -G nixbld -a $USER +$ sudo dnf install nix --exclude nix-daemon +$ sudo usermod -aG nixbld $USER ``` -and restart your login shell. +and restart your login session. This avoids the need to run nix-daemon. -## rootless nix store under /home +## Rootless nix store under /home -Alternatively one can run rootless nix with just: +Alternatively one can run rootless nix (which uses chroots) with just: ``` -$ dnf install nix --exclude nix-daemon --exclude nix-system +$ dnf install nix-core nix-legacy ``` The user nix store is: `~/.local/share/nix/root/nix/store`. This also allows sharing one's nix store with toolboxes, etc. +However then nix profiles can only be used inside nix shells. # Testing A simple way to check nix is working is to run e.g. `nix-shell -p hello`. -After a short while of downloading, this should put you in +After a while of downloading, this should put you in a nix shell subprocess where you should be able to run `hello`. Run `nix --help` to learn more about the nix CLI -or read . +or read . diff --git a/nix.spec b/nix.spec index 9a8aa0b..f74f87f 100644 --- a/nix.spec +++ b/nix.spec @@ -85,9 +85,9 @@ BuildRequires: systemd-rpm-macros BuildRequires: toml11-devel BuildRequires: xz-devel Requires: nix-core = %{version}-%{release} +Requires: nix-system = %{version}-%{release} Recommends: (nix-daemon = %{version}-%{release} if systemd) Recommends: nix-legacy = %{version}-%{release} -Recommends: nix-system = %{version}-%{release} %description Nix is a purely functional package manager. It allows multiple @@ -230,16 +230,12 @@ MESON_OPTS=( mkdir -p %{buildroot}/etc/nix cp %{SOURCE1} %{SOURCE2} %{buildroot}/etc/nix/ - # Nix has multiuser and singleuser installation modes # https://nix.dev/manual/nix/stable/installation/nix-security.html mkdir -p %{buildroot}/nix/store mkdir -p %{buildroot}/nix/var/log/nix/drvs -# make per-user directories -mkdir -p %{buildroot}/nix/var/nix/{gcroots,profiles}/per-user -mkdir %{buildroot}/nix/var/nix/{db,temproots} -touch %{buildroot}/nix/var/nix/gc.lock +mkdir -p %{buildroot}/nix/var/nix install -p -D -m 0644 %{SOURCE4} %{buildroot}%{_sysusersdir}/nix.conf install -p -D -m 0644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/nix-filesystem.conf @@ -384,14 +380,6 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %dir %attr(1775,root,%{nixbld_group}) /nix/store %dir %attr(775,root,%{nixbld_group}) /nix/var/log/nix/drvs %dir %attr(775,root,%{nixbld_group}) /nix/var/nix -%dir %attr(775,root,%{nixbld_group}) /nix/var/nix/builds -%dir %attr(775,root,%{nixbld_group}) /nix/var/nix/db -%attr(664,root,%{nixbld_group}) /nix/var/nix/gc.lock -%dir %attr(775,root,%{nixbld_group}) /nix/var/nix/gcroots -%dir %attr(755,root,%{nixbld_group}) /nix/var/nix/gcroots/per-user -%dir %attr(775,root,%{nixbld_group}) /nix/var/nix/profiles -%dir %attr(755,root,%{nixbld_group}) /nix/var/nix/profiles/per-user -%attr(775,root,%{nixbld_group}) /nix/var/nix/temproots %changelog From 80d23ca87ab38480213cc39bb24fe347b8aac8ed Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Fri, 28 Nov 2025 10:54:35 +0800 Subject: [PATCH 20/29] nix-daemon requires systemd --- nix.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/nix.spec b/nix.spec index f74f87f..c9eff2f 100644 --- a/nix.spec +++ b/nix.spec @@ -119,6 +119,7 @@ Summary: The nix daemon for multiuser mode BuildArch: noarch Requires: nix-core = %{version}-%{release} Requires: nix-system = %{version}-%{release} +Requires: systemd %description daemon This package provides nix-daemon and associated files. From 1115ba96017ae3ae888204016bda3bba252ddb2a Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Fri, 28 Nov 2025 10:55:40 +0800 Subject: [PATCH 21/29] trivial spec changes --- nix.spec | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nix.spec b/nix.spec index c9eff2f..9ff6161 100644 --- a/nix.spec +++ b/nix.spec @@ -244,7 +244,7 @@ install -p -D -m 0644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/nix-filesystem.conf # filter out relative doc links # https://bugzilla.redhat.com/show_bug.cgi?id=2415126 # https://github.com/kristapsdz/lowdown/issues/170 -# (sed expression generated by Gemini Pro: removes .UR and .UE lines) +# (sed expression generated by Gemini Pro: removes pairs of .UR and .UE lines) sed -i -e '/^\.UR [@#.]/,/^\.UE/{ /^\.UR [@#.]/d; /^\.UE/d}' %{buildroot}%{_mandir}/man*/* @@ -370,12 +370,6 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %{_libdir}/libnixutilc.so.%{version} -%if %{with tests} -%files test -%{_bindir}/nix*-test -%endif - - %files system %{_sysusersdir}/nix.conf %dir %attr(1775,root,%{nixbld_group}) /nix/store @@ -383,5 +377,11 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %dir %attr(775,root,%{nixbld_group}) /nix/var/nix +%if %{with tests} +%files test +%{_bindir}/nix*-test +%endif + + %changelog %autochangelog From 6aed6c629daba40b410562381519435447fa8044 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Fri, 28 Nov 2025 10:56:00 +0800 Subject: [PATCH 22/29] reformat description --- nix.spec | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/nix.spec b/nix.spec index 9ff6161..6098deb 100644 --- a/nix.spec +++ b/nix.spec @@ -90,12 +90,13 @@ Recommends: (nix-daemon = %{version}-%{release} if systemd) Recommends: nix-legacy = %{version}-%{release} %description -Nix is a purely functional package manager. It allows multiple -versions of a package to be installed side-by-side, ensures that -dependency specifications are complete, supports atomic upgrades and -rollbacks, allows non-root users to install software, and has many -other features. It is the basis of the NixOS Linux distribution, but -it can be used equally well under other Unix systems. +Nix is a purely functional package manager. +It allows multiple versions of a package to be installed side-by-side, +ensures that dependency specifications are complete, +supports atomic upgrades and rollbacks, +allows non-root users to install software, and has many other features. +It is the basis of the NixOS Linux distribution, +but it can be used equally well under other Unix systems. See the README.fedora.md file for setup instructions. @@ -110,8 +111,10 @@ Recommends: busybox %description core This package provides the core nix tool for modern flake-based commands. -Most users should probably install the main nix package instead, -or also nix-legacy if you need the older pre-flake nix-* commands. +Most users should probably install nix-legacy as well, +or the main nix package for a complete default setup. + +See the README.fedora.md file for setup instructions. %package daemon From 3de48dcfc0ffeadb40a3efe363268c2a4a509736 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Fri, 28 Nov 2025 11:16:55 +0800 Subject: [PATCH 23/29] readme: mention channel setup --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 3d8b4e4..8e5d212 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,13 @@ The user nix store is: `~/.local/share/nix/root/nix/store`. This also allows sharing one's nix store with toolboxes, etc. However then nix profiles can only be used inside nix shells. +## Nixpkgs +You may want to setup a default nix channel. +``` +$ nix-channel add https://nixos.org/channels/nixos-25.11 nixpkgs +``` +for legacy commands, if you don't want to use rolling nixos-unstable. + # Testing A simple way to check nix is working is to run e.g. `nix-shell -p hello`. From eef01d8c8e6f0a63e9f04a49a22b8d78ea51af90 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Fri, 28 Nov 2025 12:28:25 +0800 Subject: [PATCH 24/29] devel description: note that API is unstable --- nix.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nix.spec b/nix.spec index 6098deb..f4dc5f0 100644 --- a/nix.spec +++ b/nix.spec @@ -133,9 +133,11 @@ Summary: Development files for nix Requires: nix-libs%{?_isa} = %{version}-%{release} %description devel -This package contains libraries and header files for +This package contains library and header files for developing applications that use nix. +Note the API is considered unstable and upstream does not recommend its usage. + %if %{with docs} %package doc From 98df99f77c361f6b2351b1b53dc07e65ea7fe973 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Fri, 28 Nov 2025 12:29:05 +0800 Subject: [PATCH 25/29] readme: for singleuser setup check id output --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8e5d212..ca73bac 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,8 @@ Run: $ sudo dnf install nix --exclude nix-daemon $ sudo usermod -aG nixbld $USER ``` -and restart your login session. +and restart your login session: +make sure the `nixbld` group appears in `id` output. This avoids the need to run nix-daemon. From 5fe7386873cabd39fc72224f69c221abb6352c9a Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Fri, 28 Nov 2025 15:01:08 +0800 Subject: [PATCH 26/29] ghost /nix/var/nix/* and sockets - add builds/ ghost back to daemon (since it creates it) - db/ and gcroots/auto/ remain after uninstalling --- nix.spec | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/nix.spec b/nix.spec index f4dc5f0..0be06a0 100644 --- a/nix.spec +++ b/nix.spec @@ -301,7 +301,9 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %{_sysconfdir}/profile.d/nix-daemon.*sh %{_unitdir}/nix-daemon.* %{_tmpfilesdir}/nix-daemon.conf -%ghost /nix/var/nix/daemon-socket +%ghost %dir /nix/var/nix/builds +%ghost %dir /nix/var/nix/daemon-socket +%ghost /nix/var/nix/daemon-socket/socket %if %{with docs} %{_mandir}/man8/nix-daemon.8* %endif @@ -380,6 +382,15 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %dir %attr(1775,root,%{nixbld_group}) /nix/store %dir %attr(775,root,%{nixbld_group}) /nix/var/log/nix/drvs %dir %attr(775,root,%{nixbld_group}) /nix/var/nix +%ghost %dir /nix/var/nix/db +%ghost /nix/var/nix/gc.lock +%ghost %dir /nix/var/nix/gcroots +%ghost %dir /nix/var/nix/gcroots/per-user +%ghost %dir /nix/var/nix/gc-socket +%ghost /nix/var/nix/gc-socket/socket +%ghost %dir /nix/var/nix/profiles +%ghost %dir /nix/var/nix/profiles/per-user +%ghost %dir /nix/var/nix/temproots %if %{with tests} From 95978a9369559aa2beda75111d9f9814b1069912 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Fri, 28 Nov 2025 18:08:29 +0800 Subject: [PATCH 27/29] sync with fedora nix-2.31.2-33 - nix requires system - daemon requires core and systemd - ghost runtime /nix/var directories --- README.md | 44 +++++++++++++++++++++----------- nix.spec | 76 ++++++++++++++++++++++++++++++------------------------- 2 files changed, 70 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index 7776ecb..ca73bac 100644 --- a/README.md +++ b/README.md @@ -5,38 +5,52 @@ Nix has two different modes of operation: ## Daemon mode for multi-user setup This is recommended by upstream and more seamless. +The `nix-daemon` requires functioning systemd. -Just install the `nix` or `nix-daemon` package -(the latter is recommended by the `nix` package) and run: +Just install the `nix` package, which pulls in `nix-daemon`, +by running: ``` -$ sudo dnf install nix-daemon +$ sudo dnf install nix nix-daemon $ sudo systemctl enable --now nix-daemon ``` ## Single-user mode without nix-daemon -This mode works in rootless containers without systemd. +This mode also works in rootless containers and without systemd. Run: ``` -$ sudo dnf install nix nix-system --exclude nix-daemon -$ sudo usermod -G nixbld -a $USER +$ sudo dnf install nix --exclude nix-daemon +$ sudo usermod -aG nixbld $USER ``` +and restart your login session: +make sure the `nixbld` group appears in `id` output. -Alternatively you can try this hack to have the nix store within your homedir: +This avoids the need to run nix-daemon. + +## Rootless nix store under /home + +Alternatively one can run rootless nix (which uses chroots) with just: ``` -$ dnf install nix nix-filesystem --exclude nix-daemon --exclude nix-system -$ sudo ln -s ~/.local/share/nix/root/nix/store /nix/ +$ dnf install nix-core nix-legacy ``` -(the symlink is needed for interactive bash - otherwise one gets error like: -`error: executing shell '/nix/store/2j7r5np0vaz4cnqkymp1mqivmjj1x9xl-bash-interactive-5.3p3/bin/bash': No such file or directory`). -(Note this only works without `/nix/var/nix/`.) +The user nix store is: `~/.local/share/nix/root/nix/store`. + +This also allows sharing one's nix store with toolboxes, etc. +However then nix profiles can only be used inside nix shells. + +## Nixpkgs +You may want to setup a default nix channel. +``` +$ nix-channel add https://nixos.org/channels/nixos-25.11 nixpkgs +``` +for legacy commands, if you don't want to use rolling nixos-unstable. # Testing A simple way to check nix is working is to run e.g. `nix-shell -p hello`. -After a short while of downloading, this should put you in +After a while of downloading, this should put you in a nix shell subprocess where you should be able to run `hello`. -Run `nix help` to learn more about the nix CLI -or read . +Run `nix --help` to learn more about the nix CLI +or read . diff --git a/nix.spec b/nix.spec index b037c72..6ef7c60 100644 --- a/nix.spec +++ b/nix.spec @@ -9,7 +9,7 @@ Name: nix # 2.25 needs libgit2-1.9 Version: 2.24.15 -Release: 1%{?dist} +Release: 0.2%{?dist} Summary: A purely functional package manager License: LGPL-2.1-or-later @@ -76,17 +76,18 @@ BuildRequires: systemd-rpm-macros BuildRequires: toml11-devel BuildRequires: xz-devel Requires: nix-core = %{version}-%{release} +Requires: nix-system = %{version}-%{release} Recommends: (nix-daemon = %{version}-%{release} if systemd) Recommends: nix-legacy = %{version}-%{release} -Recommends: nix-system = %{version}-%{release} %description -Nix is a purely functional package manager. It allows multiple -versions of a package to be installed side-by-side, ensures that -dependency specifications are complete, supports atomic upgrades and -rollbacks, allows non-root users to install software, and has many -other features. It is the basis of the NixOS Linux distribution, but -it can be used equally well under other Unix systems. +Nix is a purely functional package manager. +It allows multiple versions of a package to be installed side-by-side, +ensures that dependency specifications are complete, +supports atomic upgrades and rollbacks, +allows non-root users to install software, and has many other features. +It is the basis of the NixOS Linux distribution, +but it can be used equally well under other Unix systems. See the README.fedora.md file for setup instructions. @@ -101,15 +102,18 @@ Recommends: busybox %description core This package provides the core nix tool for modern flake-based commands. -Most users should probably install the main nix package instead, -or also nix-legacy if you need the older pre-flake nix-* commands. +Most users should probably install nix-legacy as well, +or the main nix package for a complete default setup. + +See the README.fedora.md file for setup instructions. %package daemon Summary: The nix daemon for multiuser mode BuildArch: noarch -Requires: nix = %{version}-%{release} +Requires: nix-core = %{version}-%{release} Requires: nix-system = %{version}-%{release} +Requires: systemd %description daemon This package provides nix-daemon and associated files. @@ -120,9 +124,11 @@ Summary: Development files for nix Requires: nix-libs%{?_isa} = %{version}-%{release} %description devel -This package contains libraries and header files for +This package contains library and header files for developing applications that use nix. +Note the API is considered unstable and upstream does not recommend its usage. + %if %{with docs} %package doc @@ -216,10 +222,7 @@ cp %{SOURCE2} %{buildroot}/etc/nix/ mkdir -p %{buildroot}/nix/store mkdir -p %{buildroot}/nix/var/log/nix/drvs -# make per-user directories -mkdir -p %{buildroot}/nix/var/nix/{gcroots,profiles}/per-user -mkdir %{buildroot}/nix/var/nix/{builds,db,temproots} -touch %{buildroot}/nix/var/nix/gc.lock +mkdir -p %{buildroot}/nix/var/nix install -p -D -m 0644 %{SOURCE4} %{buildroot}%{_sysusersdir}/nix.conf install -p -D -m 0644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/nix-filesystem.conf @@ -307,8 +310,9 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %{_sysconfdir}/profile.d/nix-daemon.*sh %{_unitdir}/nix-daemon.* %{_tmpfilesdir}/nix-daemon.conf -%ghost /nix/var/nix/daemon-socket -%ghost /nix/var/nix/builds +%ghost %dir /nix/var/nix/builds +%ghost %dir /nix/var/nix/daemon-socket +%ghost /nix/var/nix/daemon-socket/socket %if %{with docs} %{_mandir}/man8/nix-daemon.8* %endif @@ -340,6 +344,9 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help # FHS Exception: https://pagure.io/fesco/issue/3473 %{_tmpfilesdir}/nix-filesystem.conf %ghost %dir /nix +%ghost %dir /nix/var +%ghost %dir /nix/var/log +%ghost %dir /nix/var/log/nix %files legacy @@ -373,29 +380,28 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %{_libdir}/libnixutilc.so.%{version} +%files system +%{_sysusersdir}/nix.conf +%dir %attr(1775,root,%{nixbld_group}) /nix/store +%dir %attr(775,root,%{nixbld_group}) /nix/var/log/nix/drvs +%dir %attr(775,root,%{nixbld_group}) /nix/var/nix +%ghost %dir /nix/var/nix/db +%ghost /nix/var/nix/gc.lock +%ghost %dir /nix/var/nix/gcroots +%ghost %dir /nix/var/nix/gcroots/per-user +%ghost %dir /nix/var/nix/gc-socket +%ghost /nix/var/nix/gc-socket/socket +%ghost %dir /nix/var/nix/profiles +%ghost %dir /nix/var/nix/profiles/per-user +%ghost %dir /nix/var/nix/temproots + + %if %{with tests} %files test %{_bindir}/nix*-test %endif -%files system -%{_sysusersdir}/nix.conf -%dir %attr(1775,root,%{nixbld_group}) /nix/store -%dir /nix/var -%dir /nix/var/log -%dir /nix/var/log/nix -%dir %attr(1775,root,%{nixbld_group}) /nix/var/log/nix/drvs -%dir %attr(775,root,%{nixbld_group}) /nix/var/nix -%dir %attr(775,root,%{nixbld_group}) /nix/var/nix/db -%attr(664,root,%{nixbld_group}) /nix/var/nix/gc.lock -%dir %attr(775,root,%{nixbld_group}) /nix/var/nix/gcroots -%dir %attr(1755,root,%{nixbld_group}) /nix/var/nix/gcroots/per-user -%dir %attr(775,root,%{nixbld_group}) /nix/var/nix/profiles -%dir %attr(1755,root,%{nixbld_group}) /nix/var/nix/profiles/per-user -%attr(775,root,%{nixbld_group}) /nix/var/nix/temproots - - %changelog * Wed Nov 26 2025 Jens Petersen - 2.24.15-1 - initial epel10 package From 10c05493cd8c9d512136d01108f2022dc6f0175e Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Sat, 29 Nov 2025 01:11:00 +0800 Subject: [PATCH 28/29] build with make rather than partial meson - this gains manpages - but loses soversion --- 13995.patch | 218 --------------------------- 14001.patch | 246 ------------------------------- 14005.patch | 23 --- 14018.patch | 24 --- nix-2.24-meson-soversion.patch | 131 ---------------- nix-2.24-meson-subprojects.patch | 46 ------ nix-manual-disable.patch | 11 ++ nix.spec | 152 ++++++------------- 8 files changed, 52 insertions(+), 799 deletions(-) delete mode 100644 13995.patch delete mode 100644 14001.patch delete mode 100644 14005.patch delete mode 100644 14018.patch delete mode 100644 nix-2.24-meson-soversion.patch delete mode 100644 nix-2.24-meson-subprojects.patch create mode 100644 nix-manual-disable.patch diff --git a/13995.patch b/13995.patch deleted file mode 100644 index 354ba10..0000000 --- a/13995.patch +++ /dev/null @@ -1,218 +0,0 @@ -From dd1a554aba720c5f23a529ddc32f1c7127b62af9 Mon Sep 17 00:00:00 2001 -From: Jens Petersen -Date: Mon, 15 Sep 2025 14:38:08 +0800 -Subject: [PATCH] meson: add soversion with nix version to give SONAME to libs - (#13960, #13979) - -remove 'pre' version suffix for non-releases (chokes Darwin ld) ---- - src/libcmd/meson.build | 1 + - src/libexpr-c/meson.build | 1 + - src/libexpr-test-support/meson.build | 1 + - src/libexpr/meson.build | 1 + - src/libfetchers-c/meson.build | 1 + - src/libfetchers/meson.build | 1 + - src/libflake-c/meson.build | 1 + - src/libflake/meson.build | 1 + - src/libmain-c/meson.build | 1 + - src/libmain/meson.build | 1 + - src/libstore-c/meson.build | 1 + - src/libstore-test-support/meson.build | 1 + - src/libstore/meson.build | 1 + - src/libutil-c/meson.build | 1 + - src/libutil-test-support/meson.build | 1 + - src/libutil/meson.build | 1 + - 16 files changed, 16 insertions(+) - -diff --git a/src/libcmd/meson.build b/src/libcmd/meson.build -index 24e0752462c..b259182c266 100644 ---- a/src/libcmd/meson.build -+++ b/src/libcmd/meson.build -@@ -95,6 +95,7 @@ this_library = library( - 'nixcmd', - sources, - config_priv_h, -+ soversion : meson.project_version().replace('pre', ''), - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libexpr-c/meson.build b/src/libexpr-c/meson.build -index 7c014d61d37..95c2c8ac92c 100644 ---- a/src/libexpr-c/meson.build -+++ b/src/libexpr-c/meson.build -@@ -50,6 +50,7 @@ subdir('nix-meson-build-support/windows-version') - this_library = library( - 'nixexprc', - sources, -+ soversion : meson.project_version().replace('pre', ''), - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libexpr-test-support/meson.build b/src/libexpr-test-support/meson.build -index d762eb85e32..1d874320a51 100644 ---- a/src/libexpr-test-support/meson.build -+++ b/src/libexpr-test-support/meson.build -@@ -44,6 +44,7 @@ subdir('nix-meson-build-support/windows-version') - this_library = library( - 'nix-expr-test-support', - sources, -+ soversion : meson.project_version().replace('pre', ''), - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - # TODO: Remove `-lrapidcheck` when https://github.com/emil-e/rapidcheck/pull/326 -diff --git a/src/libexpr/meson.build b/src/libexpr/meson.build -index 40d3f390b4b..dc43a97420d 100644 ---- a/src/libexpr/meson.build -+++ b/src/libexpr/meson.build -@@ -181,6 +181,7 @@ this_library = library( - parser_tab, - lexer_tab, - generated_headers, -+ soversion : meson.project_version().replace('pre', ''), - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libfetchers-c/meson.build b/src/libfetchers-c/meson.build -index 8542744b4da..a381c792af9 100644 ---- a/src/libfetchers-c/meson.build -+++ b/src/libfetchers-c/meson.build -@@ -53,6 +53,7 @@ subdir('nix-meson-build-support/windows-version') - this_library = library( - 'nixfetchersc', - sources, -+ soversion : meson.project_version().replace('pre', ''), - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libfetchers/meson.build b/src/libfetchers/meson.build -index 922a2c49199..e5f5bd19210 100644 ---- a/src/libfetchers/meson.build -+++ b/src/libfetchers/meson.build -@@ -61,6 +61,7 @@ subdir('nix-meson-build-support/windows-version') - this_library = library( - 'nixfetchers', - sources, -+ soversion : meson.project_version().replace('pre', ''), - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libflake-c/meson.build b/src/libflake-c/meson.build -index 933e06d9037..83729178693 100644 ---- a/src/libflake-c/meson.build -+++ b/src/libflake-c/meson.build -@@ -53,6 +53,7 @@ subdir('nix-meson-build-support/windows-version') - this_library = library( - 'nixflakec', - sources, -+ soversion : meson.project_version().replace('pre', ''), - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libflake/meson.build b/src/libflake/meson.build -index 191d8f0680c..a962258e723 100644 ---- a/src/libflake/meson.build -+++ b/src/libflake/meson.build -@@ -58,6 +58,7 @@ this_library = library( - 'nixflake', - sources, - generated_headers, -+ soversion : meson.project_version().replace('pre', ''), - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libmain-c/meson.build b/src/libmain-c/meson.build -index 9e26ad8adf3..61ec4d54b53 100644 ---- a/src/libmain-c/meson.build -+++ b/src/libmain-c/meson.build -@@ -45,6 +45,7 @@ subdir('nix-meson-build-support/windows-version') - this_library = library( - 'nixmainc', - sources, -+ soversion : meson.project_version().replace('pre', ''), - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libmain/meson.build b/src/libmain/meson.build -index 4a90d2d83b6..d465dd6a40f 100644 ---- a/src/libmain/meson.build -+++ b/src/libmain/meson.build -@@ -77,6 +77,7 @@ this_library = library( - 'nixmain', - sources, - config_priv_h, -+ soversion : meson.project_version().replace('pre', ''), - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libstore-c/meson.build b/src/libstore-c/meson.build -index f8eaef80395..b73822b0cb7 100644 ---- a/src/libstore-c/meson.build -+++ b/src/libstore-c/meson.build -@@ -46,6 +46,7 @@ subdir('nix-meson-build-support/windows-version') - this_library = library( - 'nixstorec', - sources, -+ soversion : meson.project_version().replace('pre', ''), - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libstore-test-support/meson.build b/src/libstore-test-support/meson.build -index b2977941f86..90fef8489ad 100644 ---- a/src/libstore-test-support/meson.build -+++ b/src/libstore-test-support/meson.build -@@ -44,6 +44,7 @@ subdir('nix-meson-build-support/windows-version') - this_library = library( - 'nix-store-test-support', - sources, -+ soversion : meson.project_version().replace('pre', ''), - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - # TODO: Remove `-lrapidcheck` when https://github.com/emil-e/rapidcheck/pull/326 -diff --git a/src/libstore/meson.build b/src/libstore/meson.build -index 7aeacbab79b..95dcf08bd0d 100644 ---- a/src/libstore/meson.build -+++ b/src/libstore/meson.build -@@ -363,6 +363,7 @@ this_library = library( - generated_headers, - sources, - config_priv_h, -+ soversion : meson.project_version().replace('pre', ''), - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libutil-c/meson.build b/src/libutil-c/meson.build -index 8131c517cd8..b214266a13a 100644 ---- a/src/libutil-c/meson.build -+++ b/src/libutil-c/meson.build -@@ -53,6 +53,7 @@ this_library = library( - 'nixutilc', - sources, - config_priv_h, -+ soversion : meson.project_version().replace('pre', ''), - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libutil-test-support/meson.build b/src/libutil-test-support/meson.build -index 910f1d88164..da2b443ec54 100644 ---- a/src/libutil-test-support/meson.build -+++ b/src/libutil-test-support/meson.build -@@ -41,6 +41,7 @@ subdir('nix-meson-build-support/windows-version') - this_library = library( - 'nix-util-test-support', - sources, -+ soversion : meson.project_version().replace('pre', ''), - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - # TODO: Remove `-lrapidcheck` when https://github.com/emil-e/rapidcheck/pull/326 -diff --git a/src/libutil/meson.build b/src/libutil/meson.build -index cdffc892ae7..ff8b042c7ec 100644 ---- a/src/libutil/meson.build -+++ b/src/libutil/meson.build -@@ -197,6 +197,7 @@ subdir('nix-meson-build-support/windows-version') - this_library = library( - 'nixutil', - sources, -+ soversion : meson.project_version().replace('pre', ''), - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, diff --git a/14001.patch b/14001.patch deleted file mode 100644 index 456aff4..0000000 --- a/14001.patch +++ /dev/null @@ -1,246 +0,0 @@ -From 86bb7c958a4ed46411da74a4498581a0cdc454a0 Mon Sep 17 00:00:00 2001 -From: Jens Petersen -Date: Tue, 16 Sep 2025 12:54:30 +0800 -Subject: [PATCH] meson: refactor nix_soversion into - nix-meson-build-support/common - -This is a follow-on to #13995 which added soversion to the libraries ---- - nix-meson-build-support/common/meson.build | 3 +++ - src/libcmd/meson.build | 2 +- - src/libexpr-c/meson.build | 2 +- - src/libexpr-test-support/meson.build | 2 +- - src/libexpr/meson.build | 2 +- - src/libfetchers-c/meson.build | 2 +- - src/libfetchers/meson.build | 2 +- - src/libflake-c/meson.build | 2 +- - src/libflake/meson.build | 2 +- - src/libmain-c/meson.build | 2 +- - src/libmain/meson.build | 2 +- - src/libstore-c/meson.build | 2 +- - src/libstore-test-support/meson.build | 2 +- - src/libstore/meson.build | 2 +- - src/libutil-c/meson.build | 2 +- - src/libutil-test-support/meson.build | 2 +- - src/libutil/meson.build | 2 +- - 17 files changed, 19 insertions(+), 16 deletions(-) - -diff --git a/nix-meson-build-support/common/meson.build b/nix-meson-build-support/common/meson.build -index fd686f1407f..5a29ff61d94 100644 ---- a/nix-meson-build-support/common/meson.build -+++ b/nix-meson-build-support/common/meson.build -@@ -40,3 +40,6 @@ if cxx.get_id() == 'clang' and ('address' in get_option('b_sanitize') or 'undefi - )) - add_project_link_arguments('-shared-libasan', language : 'cpp') - endif -+ -+# Darwin ld doesn't like "X.Y.Zpre" -+nix_soversion = meson.project_version().strip('pre') -diff --git a/src/libcmd/meson.build b/src/libcmd/meson.build -index b259182c266..f553afa0ba1 100644 ---- a/src/libcmd/meson.build -+++ b/src/libcmd/meson.build -@@ -95,7 +95,7 @@ this_library = library( - 'nixcmd', - sources, - config_priv_h, -- soversion : meson.project_version().replace('pre', ''), -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libexpr-c/meson.build b/src/libexpr-c/meson.build -index 95c2c8ac92c..c47704ce411 100644 ---- a/src/libexpr-c/meson.build -+++ b/src/libexpr-c/meson.build -@@ -50,7 +50,7 @@ subdir('nix-meson-build-support/windows-version') - this_library = library( - 'nixexprc', - sources, -- soversion : meson.project_version().replace('pre', ''), -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libexpr-test-support/meson.build b/src/libexpr-test-support/meson.build -index 1d874320a51..df28661b7e7 100644 ---- a/src/libexpr-test-support/meson.build -+++ b/src/libexpr-test-support/meson.build -@@ -44,7 +44,7 @@ subdir('nix-meson-build-support/windows-version') - this_library = library( - 'nix-expr-test-support', - sources, -- soversion : meson.project_version().replace('pre', ''), -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - # TODO: Remove `-lrapidcheck` when https://github.com/emil-e/rapidcheck/pull/326 -diff --git a/src/libexpr/meson.build b/src/libexpr/meson.build -index dc43a97420d..55a36c1bd58 100644 ---- a/src/libexpr/meson.build -+++ b/src/libexpr/meson.build -@@ -181,7 +181,7 @@ this_library = library( - parser_tab, - lexer_tab, - generated_headers, -- soversion : meson.project_version().replace('pre', ''), -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libfetchers-c/meson.build b/src/libfetchers-c/meson.build -index a381c792af9..db415d9173e 100644 ---- a/src/libfetchers-c/meson.build -+++ b/src/libfetchers-c/meson.build -@@ -53,7 +53,7 @@ subdir('nix-meson-build-support/windows-version') - this_library = library( - 'nixfetchersc', - sources, -- soversion : meson.project_version().replace('pre', ''), -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libfetchers/meson.build b/src/libfetchers/meson.build -index e5f5bd19210..792a0fdbf41 100644 ---- a/src/libfetchers/meson.build -+++ b/src/libfetchers/meson.build -@@ -61,7 +61,7 @@ subdir('nix-meson-build-support/windows-version') - this_library = library( - 'nixfetchers', - sources, -- soversion : meson.project_version().replace('pre', ''), -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libflake-c/meson.build b/src/libflake-c/meson.build -index 83729178693..fddb39bdf96 100644 ---- a/src/libflake-c/meson.build -+++ b/src/libflake-c/meson.build -@@ -53,7 +53,7 @@ subdir('nix-meson-build-support/windows-version') - this_library = library( - 'nixflakec', - sources, -- soversion : meson.project_version().replace('pre', ''), -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libflake/meson.build b/src/libflake/meson.build -index a962258e723..58916ecd9ab 100644 ---- a/src/libflake/meson.build -+++ b/src/libflake/meson.build -@@ -58,7 +58,7 @@ this_library = library( - 'nixflake', - sources, - generated_headers, -- soversion : meson.project_version().replace('pre', ''), -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libmain-c/meson.build b/src/libmain-c/meson.build -index 61ec4d54b53..36332fdb70a 100644 ---- a/src/libmain-c/meson.build -+++ b/src/libmain-c/meson.build -@@ -45,7 +45,7 @@ subdir('nix-meson-build-support/windows-version') - this_library = library( - 'nixmainc', - sources, -- soversion : meson.project_version().replace('pre', ''), -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libmain/meson.build b/src/libmain/meson.build -index d465dd6a40f..2ac59924e59 100644 ---- a/src/libmain/meson.build -+++ b/src/libmain/meson.build -@@ -77,7 +77,7 @@ this_library = library( - 'nixmain', - sources, - config_priv_h, -- soversion : meson.project_version().replace('pre', ''), -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libstore-c/meson.build b/src/libstore-c/meson.build -index b73822b0cb7..c6b6174c775 100644 ---- a/src/libstore-c/meson.build -+++ b/src/libstore-c/meson.build -@@ -46,7 +46,7 @@ subdir('nix-meson-build-support/windows-version') - this_library = library( - 'nixstorec', - sources, -- soversion : meson.project_version().replace('pre', ''), -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libstore-test-support/meson.build b/src/libstore-test-support/meson.build -index 90fef8489ad..5873680eae2 100644 ---- a/src/libstore-test-support/meson.build -+++ b/src/libstore-test-support/meson.build -@@ -44,7 +44,7 @@ subdir('nix-meson-build-support/windows-version') - this_library = library( - 'nix-store-test-support', - sources, -- soversion : meson.project_version().replace('pre', ''), -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - # TODO: Remove `-lrapidcheck` when https://github.com/emil-e/rapidcheck/pull/326 -diff --git a/src/libstore/meson.build b/src/libstore/meson.build -index 95dcf08bd0d..556616181ae 100644 ---- a/src/libstore/meson.build -+++ b/src/libstore/meson.build -@@ -363,7 +363,7 @@ this_library = library( - generated_headers, - sources, - config_priv_h, -- soversion : meson.project_version().replace('pre', ''), -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libutil-c/meson.build b/src/libutil-c/meson.build -index b214266a13a..1806dbb6f9a 100644 ---- a/src/libutil-c/meson.build -+++ b/src/libutil-c/meson.build -@@ -53,7 +53,7 @@ this_library = library( - 'nixutilc', - sources, - config_priv_h, -- soversion : meson.project_version().replace('pre', ''), -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, -diff --git a/src/libutil-test-support/meson.build b/src/libutil-test-support/meson.build -index da2b443ec54..64231107eb6 100644 ---- a/src/libutil-test-support/meson.build -+++ b/src/libutil-test-support/meson.build -@@ -41,7 +41,7 @@ subdir('nix-meson-build-support/windows-version') - this_library = library( - 'nix-util-test-support', - sources, -- soversion : meson.project_version().replace('pre', ''), -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - # TODO: Remove `-lrapidcheck` when https://github.com/emil-e/rapidcheck/pull/326 -diff --git a/src/libutil/meson.build b/src/libutil/meson.build -index ff8b042c7ec..f4b8dbb613b 100644 ---- a/src/libutil/meson.build -+++ b/src/libutil/meson.build -@@ -197,7 +197,7 @@ subdir('nix-meson-build-support/windows-version') - this_library = library( - 'nixutil', - sources, -- soversion : meson.project_version().replace('pre', ''), -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args : linker_export_flags, diff --git a/14005.patch b/14005.patch deleted file mode 100644 index 768a732..0000000 --- a/14005.patch +++ /dev/null @@ -1,23 +0,0 @@ -From ca23c819e0492272a695f3f87467a05c152ac77d Mon Sep 17 00:00:00 2001 -From: Jens Petersen -Date: Tue, 16 Sep 2025 18:31:40 +0800 -Subject: [PATCH] nix-meson-build-support/common nix_soversion: fixup removal - of 'pre' - -.strip() removes individual chars whereas .replace() affects whole substring - -Thanks @keszybz ---- - nix-meson-build-support/common/meson.build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/nix-meson-build-support/common/meson.build b/nix-meson-build-support/common/meson.build -index 5a29ff61d94..a46715193c6 100644 ---- a/nix-meson-build-support/common/meson.build -+++ b/nix-meson-build-support/common/meson.build -@@ -42,4 +42,4 @@ if cxx.get_id() == 'clang' and ('address' in get_option('b_sanitize') or 'undefi - endif - - # Darwin ld doesn't like "X.Y.Zpre" --nix_soversion = meson.project_version().strip('pre') -+nix_soversion = meson.project_version().replace('pre', '') diff --git a/14018.patch b/14018.patch deleted file mode 100644 index 8ae9278..0000000 --- a/14018.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 7dbfe9f5761662efdd7de8c00d940749af276240 Mon Sep 17 00:00:00 2001 -From: Sergei Zimmerman -Date: Thu, 18 Sep 2025 23:34:27 +0300 -Subject: [PATCH] meson: Fix SONAME for unstable versions - -Replacing the string is not enough [^] for e.g. nixpkgs precise versions: - -`2.31pre20250712_b1245123` - -[^]: https://github.com/NixOS/nixpkgs/pull/444089 ---- - nix-meson-build-support/common/meson.build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/nix-meson-build-support/common/meson.build b/nix-meson-build-support/common/meson.build -index a46715193c6..f08fb3d8439 100644 ---- a/nix-meson-build-support/common/meson.build -+++ b/nix-meson-build-support/common/meson.build -@@ -42,4 +42,4 @@ if cxx.get_id() == 'clang' and ('address' in get_option('b_sanitize') or 'undefi - endif - - # Darwin ld doesn't like "X.Y.Zpre" --nix_soversion = meson.project_version().replace('pre', '') -+nix_soversion = meson.project_version().split('pre')[0] diff --git a/nix-2.24-meson-soversion.patch b/nix-2.24-meson-soversion.patch deleted file mode 100644 index f8745de..0000000 --- a/nix-2.24-meson-soversion.patch +++ /dev/null @@ -1,131 +0,0 @@ -diff -up nix-2.24.15/build-utils-meson/deps-lists/meson.build~ nix-2.24.15/build-utils-meson/deps-lists/meson.build ---- nix-2.24.15/build-utils-meson/deps-lists/meson.build~ 2025-06-24 22:08:50.000000000 +0800 -+++ nix-2.24.15/build-utils-meson/deps-lists/meson.build 2025-10-28 14:08:08.310546077 +0800 -@@ -34,3 +34,6 @@ deps_public_subproject = [ ] - # These are dependencencies without pkg-config files. Ideally they are - # just private, but they may also be public (e.g. boost). - deps_other = [ ] -+ -+# backport from 2.32 -+nix_soversion = meson.project_version().split('pre')[0] -diff -up nix-2.24.15/src/libcmd/meson.build~ nix-2.24.15/src/libcmd/meson.build ---- nix-2.24.15/src/libcmd/meson.build~ 2025-06-24 22:08:50.000000000 +0800 -+++ nix-2.24.15/src/libcmd/meson.build 2025-10-28 14:11:15.897054822 +0800 -@@ -120,6 +120,7 @@ headers = [config_h] + files( - this_library = library( - 'nixcmd', - sources, -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - prelink : true, # For C++ static initializers - install : true, -diff -up nix-2.24.15/src/libexpr-c/meson.build~ nix-2.24.15/src/libexpr-c/meson.build ---- nix-2.24.15/src/libexpr-c/meson.build~ 2025-06-24 22:08:50.000000000 +0800 -+++ nix-2.24.15/src/libexpr-c/meson.build 2025-10-28 14:11:44.075833247 +0800 -@@ -79,6 +79,7 @@ subdir('build-utils-meson/export-all-sym - this_library = library( - 'nixexprc', - sources, -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args: linker_export_flags, -diff -up nix-2.24.15/src/libexpr/meson.build~ nix-2.24.15/src/libexpr/meson.build ---- nix-2.24.15/src/libexpr/meson.build~ 2025-06-24 22:08:50.000000000 +0800 -+++ nix-2.24.15/src/libexpr/meson.build 2025-10-28 14:17:42.434477907 +0800 -@@ -196,6 +196,7 @@ - parser_tab, - lexer_tab, - generated_headers, -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - prelink : true, # For C++ static initializers - install : true, -diff -up nix-2.24.15/src/libfetchers/meson.build~ nix-2.24.15/src/libfetchers/meson.build ---- nix-2.24.15/src/libfetchers/meson.build~ 2025-06-24 22:08:50.000000000 +0800 -+++ nix-2.24.15/src/libfetchers/meson.build 2025-10-28 14:12:33.066448037 +0800 -@@ -83,6 +83,7 @@ headers = files( - this_library = library( - 'nixfetchers', - sources, -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - prelink : true, # For C++ static initializers - install : true, -diff -up nix-2.24.15/src/libflake/meson.build~ nix-2.24.15/src/libflake/meson.build ---- nix-2.24.15/src/libflake/meson.build~ 2025-06-24 22:08:50.000000000 +0800 -+++ nix-2.24.15/src/libflake/meson.build 2025-10-28 14:12:55.184274120 +0800 -@@ -65,6 +65,7 @@ headers = files( - this_library = library( - 'nixflake', - sources, -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - prelink : true, # For C++ static initializers - install : true, -diff -up nix-2.24.15/src/libmain-c/meson.build~ nix-2.24.15/src/libmain-c/meson.build ---- nix-2.24.15/src/libmain-c/meson.build~ 2025-06-24 22:08:50.000000000 +0800 -+++ nix-2.24.15/src/libmain-c/meson.build 2025-10-28 14:13:37.008945244 +0800 -@@ -72,6 +72,7 @@ subdir('build-utils-meson/export-all-sym - this_library = library( - 'nixmainc', - sources, -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args: linker_export_flags, -diff -up nix-2.24.15/src/libmain/meson.build~ nix-2.24.15/src/libmain/meson.build ---- nix-2.24.15/src/libmain/meson.build~ 2025-06-24 22:08:50.000000000 +0800 -+++ nix-2.24.15/src/libmain/meson.build 2025-10-28 14:13:17.906095454 +0800 -@@ -89,6 +89,7 @@ headers = [config_h] + files( - this_library = library( - 'nixmain', - sources, -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - prelink : true, # For C++ static initializers - install : true, -diff -up nix-2.24.15/src/libstore-c/meson.build~ nix-2.24.15/src/libstore-c/meson.build ---- nix-2.24.15/src/libstore-c/meson.build~ 2025-06-24 22:08:50.000000000 +0800 -+++ nix-2.24.15/src/libstore-c/meson.build 2025-10-28 14:14:19.875608176 +0800 -@@ -71,6 +71,7 @@ subdir('build-utils-meson/export-all-sym - this_library = library( - 'nixstorec', - sources, -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args: linker_export_flags, -diff -up nix-2.24.15/src/libstore/meson.build~ nix-2.24.15/src/libstore/meson.build ---- nix-2.24.15/src/libstore/meson.build~ 2025-06-24 22:08:50.000000000 +0800 -+++ nix-2.24.15/src/libstore/meson.build 2025-10-28 14:14:07.585704814 +0800 -@@ -416,6 +416,7 @@ this_library = library( - 'nixstore', - generated_headers, - sources, -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - cpp_args : cpp_args, -diff -up nix-2.24.15/src/libutil-c/meson.build~ nix-2.24.15/src/libutil-c/meson.build ---- nix-2.24.15/src/libutil-c/meson.build~ 2025-06-24 22:08:50.000000000 +0800 -+++ nix-2.24.15/src/libutil-c/meson.build 2025-10-28 14:14:38.424462323 +0800 -@@ -67,6 +67,7 @@ subdir('build-utils-meson/export-all-sym - this_library = library( - 'nixutilc', - sources, -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args: linker_export_flags, -diff -up nix-2.24.15/src/libutil/meson.build~ nix-2.24.15/src/libutil/meson.build ---- nix-2.24.15/src/libutil/meson.build~ 2025-06-24 22:08:50.000000000 +0800 -+++ nix-2.24.15/src/libutil/meson.build 2025-10-28 14:03:41.692680809 +0800 -@@ -258,6 +258,7 @@ subdir('build-utils-meson/export-all-sym - this_library = library( - 'nixutil', - sources, -+ soversion : nix_soversion, - dependencies : deps_public + deps_private + deps_other, - include_directories : include_dirs, - link_args: linker_export_flags, diff --git a/nix-2.24-meson-subprojects.patch b/nix-2.24-meson-subprojects.patch deleted file mode 100644 index f904472..0000000 --- a/nix-2.24-meson-subprojects.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- nix-2.24.15/meson.build~ 2025-06-24 22:08:50.000000000 +0800 -+++ nix-2.24.15/meson.build 2025-10-27 20:16:46.076734050 +0800 -@@ -18,9 +18,9 @@ - # Executables - subproject('nix') - --# Docs --subproject('internal-api-docs') --subproject('external-api-docs') -+# # Docs -+# subproject('internal-api-docs') -+# subproject('external-api-docs') - - # External C wrapper libraries - subproject('libutil-c') -@@ -28,17 +28,17 @@ - subproject('libexpr-c') - subproject('libmain-c') - --# Language Bindings --if not meson.is_cross_build() -- subproject('perl') --endif -+# # Language Bindings -+# if not meson.is_cross_build() -+# subproject('perl') -+# endif - --# Testing --subproject('nix-util-test-support') --subproject('nix-util-tests') --subproject('nix-store-test-support') --subproject('nix-store-tests') --subproject('nix-fetchers-tests') --subproject('nix-expr-test-support') --subproject('nix-expr-tests') --subproject('nix-flake-tests') -+# # Testing -+# subproject('nix-util-test-support') -+# subproject('nix-util-tests') -+# subproject('nix-store-test-support') -+# subproject('nix-store-tests') -+# subproject('nix-fetchers-tests') -+# subproject('nix-expr-test-support') -+# subproject('nix-expr-tests') -+# subproject('nix-flake-tests') diff --git a/nix-manual-disable.patch b/nix-manual-disable.patch new file mode 100644 index 0000000..f18b17d --- /dev/null +++ b/nix-manual-disable.patch @@ -0,0 +1,11 @@ +--- nix-2.24.15/doc/manual/local.mk~ 2025-06-24 22:08:50.000000000 +0800 ++++ nix-2.24.15/doc/manual/local.mk 2025-11-28 23:39:25.782547420 +0800 +@@ -179,7 +179,7 @@ + echo "Could not open the manual in a browser. Please open '$<'" >&2; \ + false; \ + } +-install: $(docdir)/manual/index.html ++# install: $(docdir)/manual/index.html + + # Generate 'nix' manpages. + .PHONY: manpages diff --git a/nix.spec b/nix.spec index 6ef7c60..f8afdea 100644 --- a/nix.spec +++ b/nix.spec @@ -1,7 +1,7 @@ %global nixbld_group nixbld -# needs mdbook: https://bugzilla.redhat.com/show_bug.cgi?id=2332609 -%bcond docs 0 +# we patch out manual below (needs mdbook) +%bcond docs 1 # test failures complain NIX_STORE undefined # and missing rapidcheck %bcond tests 0 @@ -9,7 +9,7 @@ Name: nix # 2.25 needs libgit2-1.9 Version: 2.24.15 -Release: 0.2%{?dist} +Release: 1%{?dist} Summary: A purely functional package manager License: LGPL-2.1-or-later @@ -20,31 +20,24 @@ Source2: registry.json Source3: README.md Source4: nix.sysusers Source5: nix-filesystem.conf - -Patch10: nix-2.24-meson-subprojects.patch -# backport 2.32 soversion patches: -# https://github.com/NixOS/nix/pull/13995 -# https://github.com/NixOS/nix/pull/14001 -# https://github.com/NixOS/nix/pull/14005 -# https://github.com/NixOS/nix/pull/14018 -Patch11: nix-2.24-meson-soversion.patch +Patch0: nix-manual-disable.patch # https://nixos.org/manual/nix/unstable/installation/prerequisites-source # missing aws-cpp-sdk-s3 aws-c-auth aws-c-s3 #BuildRequires: aws-c-common +BuildRequires: autoconf-archive +BuildRequires: automake BuildRequires: bison BuildRequires: blake3-devel BuildRequires: bzip2-devel BuildRequires: boost-devel BuildRequires: brotli-devel -%ifarch x86_64 aarch64 ppc64le -BuildRequires: busybox -%endif +# %%ifarch x86_64 aarch64 ppc64le +# BuildRequires: busybox +# %%endif # needed for toml11 +BuildRequires: chrpath BuildRequires: cmake -%if %{with docs} -BuildRequires: doxygen -%endif BuildRequires: flex BuildRequires: gc-devel BuildRequires: gcc-c++ @@ -65,7 +58,8 @@ BuildRequires: libseccomp-devel BuildRequires: libsodium-devel BuildRequires: lowdown BuildRequires: lowdown-devel -BuildRequires: meson +BuildRequires: make +BuildRequires: man-db BuildRequires: openssl-devel %if %{with tests} #BuildRequires: rapidcheck-devel @@ -94,9 +88,8 @@ See the README.fedora.md file for setup instructions. %package core Summary: Core nix tool -Requires: nix-libs%{?_isa} = %{version}-%{release} %ifarch x86_64 aarch64 ppc64le -Recommends: busybox +#Recommends: busybox %endif %description core @@ -121,7 +114,7 @@ This package provides nix-daemon and associated files. %package devel Summary: Development files for nix -Requires: nix-libs%{?_isa} = %{version}-%{release} +Requires: nix%{?_isa} = %{version}-%{release} %description devel This package contains library and header files for @@ -130,28 +123,16 @@ developing applications that use nix. Note the API is considered unstable and upstream does not recommend its usage. -%if %{with docs} -%package doc -Summary: Documentation files for nix -BuildArch: noarch - -%description doc -This package contains documentation files for nix. -%endif - - %package filesystem Summary: Filesystem for nix BuildArch: noarch -# added at f43 -Obsoletes: nix-singleuser < %{version}-%{release} %description filesystem The package provides the /nix root directory for the nix package manager. %package legacy -Summary: nix classical commands +Summary: Nix classical commands BuildArch: noarch Requires: nix-core = %{version}-%{release} @@ -159,13 +140,6 @@ Requires: nix-core = %{version}-%{release} This package provides the symlinks for the older nix-* commands. -%package libs -Summary: Runtime libraries for nix - -%description libs -The package provides the the runtime libraries for nix. - - %if %{with tests} %package test Summary: Nix test programs @@ -192,23 +166,16 @@ install -p -m 0644 %{SOURCE3} README.fedora.md %build -MESON_OPTS=( - --sysconfdir=%{_sysconfdir} - --localstatedir=/nix/var - --libexecdir=%{_libexecdir} - -Dlibcmd:readline-flavor=readline - -Dlibstore:sandbox-shell=%{_bindir}/busybox - # -Dnix:profile-dir=%%{_sysconfdir}/profile.d - # [x86_64] missing from epel10: https://bugzilla.redhat.com/show_bug.cgi?id=2368495 - -Dlibutil:cpuid=disabled - ) - -%meson "${MESON_OPTS[@]}" -%meson_build +autoreconf -i +# epel10 does not have libcpuid: https://bugzilla.redhat.com/show_bug.cgi?id=2368495 +%configure --localstatedir=/nix/var --docdir=%{_defaultdocdir}/%{name}-doc-%{version} --disable-unit-tests --with-readline-flavor=readline --disable-cpuid %{!?with_docs:--disable-doc-gen} +make %{?_smp_mflags} %install -%meson_install +make DESTDIR=%{buildroot} install + +find %{buildroot} -name '*.la' -exec rm -f {} ';' # nix config mkdir -p %{buildroot}/etc/nix @@ -227,31 +194,15 @@ mkdir -p %{buildroot}/nix/var/nix install -p -D -m 0644 %{SOURCE4} %{buildroot}%{_sysusersdir}/nix.conf install -p -D -m 0644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/nix-filesystem.conf -( cd %{buildroot}%{_bindir} - for i in build channel collect-garbage copy-closure daemon env hash instantiate prefetch-url shell store; do - ln -s nix nix-$i - done +# replace absolute symlink +ln -sf ../../bin/nix %{buildroot}%{_libexecdir}/nix/build-remote + +rm %{buildroot}%{_sysconfdir}/init/nix-daemon.conf +rm %{buildroot}%{_mandir}/man1/nix3-manpages + +( cd %{buildroot}%{_libdir} + chrpath --delete ../bin/nix libnixcmd.so libnixexpr.so libnixexprc.so libnixfetchers.so libnixflake.so libnixmain.so libnixstore.so libnixstorec.so libnixutilc.so ) -mkdir -p %{buildroot}%{_libexecdir}/nix -ln -s ../../bin/nix %{buildroot}%{_libexecdir}/nix/build-remote - -mkdir -p %{buildroot}%{_sysconfdir}/profile.d -for i in sh fish; do - cat scripts/nix-daemon.$i.in | sed -e 's!@localstatedir@!/nix/var!' > %{buildroot}%{_sysconfdir}/profile.d/nix.$i - cat scripts/nix-profile-daemon.$i.in | sed -e 's!@localstatedir@!/nix/var!' > %{buildroot}%{_sysconfdir}/profile.d/nix-daemon.$i -done - -install -m 644 -D misc/bash/completion.sh %{buildroot}%{bash_completions_dir}/nix -install -m 644 -D misc/fish/completion.fish %{buildroot}%{fish_completions_dir}/nix.fish -install -m 644 -D misc/zsh/completion.zsh %{buildroot}%{zsh_completions_dir}/_nix -install -m 644 -D misc/zsh/run-help-nix %{buildroot}%{zsh_completions_dir}/run-help-nix - -mkdir -p %{buildroot}%{_unitdir} -for i in service socket; do - cat misc/systemd/nix-daemon.$i.in | sed -e 's!@localstatedir@!/nix/var!' -e 's!@storedir@!/nix/store!' -e 's!@@bindir@!%{_bindir}!' > %{buildroot}%{_unitdir}/nix-daemon.$i -done -mkdir -p %{buildroot}%{_tmpfilesdir} -cat misc/systemd/nix-daemon.conf.in | sed -e 's!@localstatedir@!/nix/var!' > %{buildroot}%{_tmpfilesdir}/nix-daemon.conf %check @@ -288,6 +239,17 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %files core %doc README.md README.fedora.md %{_bindir}/nix +%{_libdir}/libnixcmd.so +%{_libdir}/libnixexpr.so +%{_libdir}/libnixexprc.so +%{_libdir}/libnixfetchers.so +%{_libdir}/libnixflake.so +%{_libdir}/libnixmain.so +# %%{_libdir}/libnixmainc.so +%{_libdir}/libnixstore.so +%{_libdir}/libnixstorec.so +%{_libdir}/libnixutil.so +%{_libdir}/libnixutilc.so %{_libexecdir}/nix %config(noreplace) %{_sysconfdir}/nix/nix.conf %config(noreplace) %{_sysconfdir}/nix/registry.json @@ -320,26 +282,9 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %files devel %{_includedir}/nix -%{_libdir}/libnixcmd.so -%{_libdir}/libnixexpr.so -%{_libdir}/libnixexprc.so -%{_libdir}/libnixfetchers.so -%{_libdir}/libnixflake.so -%{_libdir}/libnixmain.so -%{_libdir}/libnixmainc.so -%{_libdir}/libnixstore.so -%{_libdir}/libnixstorec.so -%{_libdir}/libnixutil.so -%{_libdir}/libnixutilc.so %{_libdir}/pkgconfig/*.pc -%if %{with docs} -%files doc -%{_defaultdocdir}/nix -%endif - - %files filesystem # FHS Exception: https://pagure.io/fesco/issue/3473 %{_tmpfilesdir}/nix-filesystem.conf @@ -365,21 +310,6 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %endif -%files libs -%license COPYING -%{_libdir}/libnixcmd.so.%{version} -%{_libdir}/libnixexpr.so.%{version} -%{_libdir}/libnixexprc.so.%{version} -%{_libdir}/libnixfetchers.so.%{version} -%{_libdir}/libnixflake.so.%{version} -%{_libdir}/libnixmain.so.%{version} -%{_libdir}/libnixmainc.so.%{version} -%{_libdir}/libnixstore.so.%{version} -%{_libdir}/libnixstorec.so.%{version} -%{_libdir}/libnixutil.so.%{version} -%{_libdir}/libnixutilc.so.%{version} - - %files system %{_sysusersdir}/nix.conf %dir %attr(1775,root,%{nixbld_group}) /nix/store From c6ba971f4abb43e42f6b9668914cb87390783da1 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Wed, 14 Jan 2026 22:58:18 +0800 Subject: [PATCH 29/29] rebuild for https://fedoraproject.org/wiki/Changes/F44_Boost_1_90