add nix conf files

This commit is contained in:
Pratham Patel 2024-02-25 18:26:26 +05:30
parent e1efd48783
commit 2888da4aa6
Signed by: thefossguy
SSH Key Fingerprint: SHA256:/B3wAg7jnMEBQ2JwkebbS/eXVZANDmqRfnd9QkIhxMI
3 changed files with 30 additions and 2 deletions

8
nix.conf Normal file
View File

@ -0,0 +1,8 @@
# this file is provided by the 'nix' package
auto-optimise-store = true
bash-prompt-prefix = (nix:$name)\040
build-users-group = nixbld
experimental-features = nix-command flakes repl-flake
extra-nix-path = nixpkgs=flake:nixpkgs
max-jobs = auto

View File

@ -2,7 +2,7 @@
## (rpmautospec version 0.3.5)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 5;
release_number = 6;
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
@ -16,6 +16,8 @@ Summary: Package manager for NixOS
License: LGPL-2.1
URL: https://github.com/NixOS/nix
Source0: https://github.com/NixOS/nix/archive/%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz
Source1: nix.conf
Source2: registry.json
BuildRequires: autoconf
BuildRequires: autoconf-archive
@ -33,7 +35,6 @@ BuildRequires: gtest-devel
BuildRequires: jq
BuildRequires: json-devel
BuildRequires: libarchive-devel
BuildRequires: libcpuid-devel
BuildRequires: libgit2-devel
BuildRequires: libseccomp-devel
BuildRequires: libsodium-devel
@ -43,6 +44,10 @@ BuildRequires: rapidcheck-devel
BuildRequires: sqlite-devel
BuildRequires: systemd-rpm-macros
%ifarch x86_64
BuildRequires: libcpuid-devel
%endif
# For documentation, not yet used:
# BuildRequires: graphviz
@ -66,6 +71,11 @@ OPTIONS=(
# Documentation is available online
--disable-doc-gen
# cpuid is used only on x86, even then, it is optional
%ifnarch
--disable-cpuid
%endif
# Those libraries are unversioned, and we don't install the headers,
# so let's move them out of the public dir.
--libdir=%{_libdir}/nix
@ -78,6 +88,10 @@ OPTIONS=(
%install
%make_install
# nix config
mkdir -p %{buildroot}/etc/nix
cp %{SOURCE1} %{SOURCE2} %{buildroot}/etc/nix/
# Devel files that we don't want to use
rm -r %{buildroot}%{_includedir}/nix \
%{buildroot}%{_libdir}/nix/pkgconfig
@ -162,6 +176,8 @@ set +x
%systemd_postun_with_restart nix-daemon.socket nix-daemon.service
%files
/etc/nix/nix.conf
/etc/nix/registry.json
%{_bindir}/nix
%{_bindir}/nix-*
%dir %{_libdir}/nix

4
registry.json Normal file
View File

@ -0,0 +1,4 @@
{
"version":2,
"flakes": []
}