%global nixbld_group nixbld # we patch out manual below (needs mdbook) %bcond docs 1 # test failures complain NIX_STORE undefined # and missing rapidcheck %bcond tests 0 Name: nix # 2.25 needs libgit2-1.9 Version: 2.24.15 Release: 0.3%{?dist} Summary: A purely functional package manager License: LGPL-2.1-or-later URL: https://github.com/NixOS/nix Source0: https://github.com/NixOS/nix/archive/%{version}/nix-%{version}.tar.gz Source1: nix.conf Source2: registry.json Source3: README.md Source4: nix.sysusers Source5: nix-filesystem.conf Patch0: nix-manual-disable.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 #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 # needed for toml11 BuildRequires: chrpath BuildRequires: cmake BuildRequires: flex BuildRequires: gc-devel BuildRequires: gcc-c++ %if %{with tests} BuildRequires: gmock-devel %endif BuildRequires: libgit2-devel BuildRequires: jq BuildRequires: json-devel BuildRequires: libarchive-devel %if %{defined fedora} %ifarch x86_64 BuildRequires: libcpuid-devel %endif %endif BuildRequires: libcurl-devel BuildRequires: libseccomp-devel BuildRequires: libsodium-devel BuildRequires: lowdown BuildRequires: lowdown-devel BuildRequires: make BuildRequires: openssl-devel %if %{with tests} #BuildRequires: rapidcheck-devel %endif BuildRequires: readline-devel BuildRequires: sqlite-devel 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} %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. See the README.fedora.md file for setup instructions. %package core Summary: Core nix tool %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 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-core = %{version}-%{release} Requires: nix-system = %{version}-%{release} Requires: systemd %description daemon This package provides nix-daemon and associated files. %package devel Summary: Development files for nix Requires: nix%{?_isa} = %{version}-%{release} %description devel 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. %package filesystem Summary: Filesystem for nix BuildArch: noarch %description filesystem 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. %if %{with tests} %package test Summary: Nix test programs Requires: nix%{?_isa} = %{version}-%{release} %description test This package provides the nix-test programs. %endif %package system Summary: Nix directories and sysusers setup BuildArch: noarch Requires: nix-filesystem = %{version}-%{release} %description system This package sets up the nix directories and sysusers. %prep %autosetup -p1 install -p -m 0644 %{SOURCE3} README.fedora.md %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} # -Dlibstore:sandbox-shell=%%{_bindir}/busybox %install make DESTDIR=%{buildroot} install find %{buildroot} -name '*.la' -exec rm -f {} ';' # nix config mkdir -p %{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 # https://nix.dev/manual/nix/stable/installation/nix-security.html mkdir -p %{buildroot}/nix/store mkdir -p %{buildroot}/nix/var/log/nix/drvs 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 # replace absolute symlink ln -sf ../../bin/nix %{buildroot}%{_libexecdir}/nix/build-remote ( 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 ) rm %{buildroot}%{_sysconfdir}/init/nix-daemon.conf rm %{buildroot}%{_mandir}/man1/nix3-manpages %check LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/nix --help %if %{with tests} #export TEST_ROOT=/var/home/petersen/tmp/nix-test %meson_test %endif %post daemon %systemd_post nix-daemon.service %preun daemon %systemd_preun nix-daemon.service %postun daemon %systemd_postun_with_restart nix-daemon.service %pre filesystem %tmpfiles_create_package nix-filesystem %SOURCE5 %pre system %sysusers_create_package nix-system %SOURCE4 %files %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 %config(noreplace) %{_sysconfdir}/profile.d/nix.sh %config(noreplace) %{_sysconfdir}/profile.d/nix.fish %{bash_completions_dir}/nix %{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 %{_bindir}/nix-daemon %{_sysconfdir}/profile.d/nix-daemon.*sh %{_unitdir}/nix-daemon.* %{_tmpfilesdir}/nix-daemon.conf %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 %files devel %{_includedir}/nix %{_libdir}/pkgconfig/*.pc %files filesystem # 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 %{_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 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 %changelog * Wed Nov 26 2025 Jens Petersen - 2.24.15-1 - initial epel10 package