Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop nix 2.18 #359215

Merged
merged 3 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkgs/by-name/ni/nix-web/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
, pkg-config
, openssl
, nixVersions
, nixPackage ? nixVersions.nix_2_18
, nixPackage ? nixVersions.stable
, darwin
}:

Expand Down
6 changes: 0 additions & 6 deletions pkgs/development/haskell-modules/configuration-common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2900,12 +2900,6 @@ self: super: {
# 2024-03-17: broken
vaultenv = dontDistribute super.vaultenv;

# Support base16 1.0
nix-serve-ng = appendPatch (fetchpatch {
url = "https://github.com/aristanetworks/nix-serve-ng/commit/4d9eacfcf753acbcfa0f513bec725e9017076270.patch";
hash = "sha256-zugyUpEq/iVkxghrvguL95+lJDEpE8MLvZivken0p24=";
}) super.nix-serve-ng;

# 2024-01-24: support optparse-applicative 0.18
niv = appendPatches [
(fetchpatch {
Expand Down
20 changes: 13 additions & 7 deletions pkgs/development/haskell-modules/configuration-nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -350,17 +350,23 @@ self: super: builtins.intersectAttrs super {
# Add necessary reference to gtk3 package
gi-dbusmenugtk3 = addPkgconfigDepend pkgs.gtk3 super.gi-dbusmenugtk3;

# Doesn't declare boost dependency
nix-serve-ng = (overrideSrc {
version = "1.0.0-unstable-2023-12-18";
nix-serve-ng = (overrideCabal (old: {
src = pkgs.fetchFromGitHub {
repo = "nix-serve-ng";
owner = "aristanetworks";
rev = "21e65cb4c62b5c9e3acc11c3c5e8197248fa46a4";
hash = "sha256-qseX+/8drgwxOb1I3LKqBYMkmyeI5d5gmHqbZccR660=";
rev = "578ad85b3096d99b25cae0a73c03df4e82f587c7";
hash = "sha256-2LPx4iRJonX4gtd3r73DBM/ZhN/hKu1lb/MHOav8c5s=";
};
} (addPkgconfigDepend pkgs.boost.dev super.nix-serve-ng)).override {
nix = pkgs.nixVersions.nix_2_18;
version = "1.0.0-unstable-2024-10-01";
#editedCabalFile = null;
# Doesn't declare boost dependency
pkg-configDepends = (old.pkg-configDepends or []) ++ [ pkgs.boost.dev ];
patches = (old.patches or []) ++ [
# Part of https://github.com/aristanetworks/nix-serve-ng/pull/40
./patches/nix-serve-ng-nix.2.24.patch
];
}) super.nix-serve-ng).override {
nix = pkgs.nixVersions.nix_2_24;
};

# These packages try to access the network.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
From 97cb18bee646a23bd08e3959d6544e703e0bb862 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <[email protected]>
Date: Tue, 26 Nov 2024 08:39:30 +0100
Subject: [PATCH] fix build against nix 2.24

---
cbits/nix.cpp | 6 +++---
nix-serve-ng.cabal | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/cbits/nix.cpp b/cbits/nix.cpp
index 8872af1..6305001 100644
--- a/cbits/nix.cpp
+++ b/cbits/nix.cpp
@@ -1,6 +1,7 @@
#include <cstddef>
#include <cstdlib>
#include <nix/store-api.hh>
+#include <nix/shared.hh>
#include <nix/log-store.hh>
#include "nix.hh"

@@ -14,8 +15,7 @@ static ref<Store> getStore()
static std::shared_ptr<Store> _store;

if (!_store) {
- initLibStore();
- loadConfFile();
+ initLibStore(true);

_store = openStore();
}
@@ -120,7 +120,7 @@ void queryPathInfo
output->deriver = emptyString;
};

- copyString(validPathInfo->narHash.to_string(Base32, true), &output->narHash);
+ copyString(validPathInfo->narHash.to_string(nix::HashFormat::Nix32, true), &output->narHash);

output->narSize = validPathInfo->narSize;

diff --git a/nix-serve-ng.cabal b/nix-serve-ng.cabal
index 9298f9a..8443b04 100644
--- a/nix-serve-ng.cabal
+++ b/nix-serve-ng.cabal
@@ -36,7 +36,7 @@ executable nix-serve
cxx-sources: cbits/nix.cpp
, cbits/nix.hh

- cxx-options: -std=c++17
+ cxx-options: -std=c++20

build-depends: base < 5
, base16 >= 1.0

8 changes: 1 addition & 7 deletions pkgs/tools/package-management/nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,6 @@ in lib.makeExtensible (self: ({
enableParallelChecking = false;
};

nix_2_18 = common {
version = "2.18.9";
hash = "sha256-RrOFlDGmRXcVRV2p2HqHGqvzGNyWoD0Dado/BNlJ1SI=";
self_attribute_name = "nix_2_18";
};

nix_2_24 = common {
version = "2.24.10";
hash = "sha256-XdeVy1/d6DEIYb3nOA6JIYF4fwMKNxtwJMgT3pHi+ko=";
Expand Down Expand Up @@ -230,7 +224,7 @@ in lib.makeExtensible (self: ({
attr = "nix_2_${toString minor}";
in
lib.nameValuePair attr (throw "${attr} has been removed")
) (lib.range 4 17))
) (lib.range 4 23))
// {
unstable = throw "nixVersions.unstable has been removed. For bleeding edge (Nix master, roughly weekly updated) use nixVersions.git, otherwise use nixVersions.latest.";
}
Expand Down