diff --git a/default.nix b/default.nix index b22e926..12efe75 100644 --- a/default.nix +++ b/default.nix @@ -1,3 +1,3 @@ -(import (fetchTarball https://github.com/edolstra/flake-compat/archive/master.tar.gz) { +(import (fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz") { src = builtins.fetchGit ./.; }).defaultNix diff --git a/flake.lock b/flake.lock index 8016a76..086475b 100644 --- a/flake.lock +++ b/flake.lock @@ -2,16 +2,16 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1717667611, - "narHash": "sha256-MA50QcNTCV3AUc+0RtyhHcYMAZ81ZkVypm/lHUq5BP0=", + "lastModified": 1744173197, + "narHash": "sha256-osrVG4lppyifM05QazFTDUmZryoXY0kWQHr3ct0wHIc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d1930fa7524da1d320d00eecba84e81810477f3a", + "rev": "b5d863ceb305e26422ee3a4b65ae47e304c38aac", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-24.05-small", + "ref": "master", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 381ec58..6e5a22b 100644 --- a/flake.nix +++ b/flake.nix @@ -1,55 +1,60 @@ { description = "Script for generating Nixpkgs/NixOS channels"; - inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05-small"; + # Temporary until (a) Hydra catches up (b) 25.05 is branched + inputs.nixpkgs.url = "github:NixOS/nixpkgs/master"; - outputs = { self, nixpkgs }: + outputs = + { self, nixpkgs }: { overlays.default = final: prev: { - nixos-channel-native-programs = with final; stdenv.mkDerivation { + nixos-channel-native-programs = final.stdenv.mkDerivation { name = "nixos-channel-native-programs"; - buildInputs = [ - nix - pkg-config - boehmgc - nlohmann_json - boost - sqlite + + strictDeps = true; + + nativeBuildInputs = with final.buildPackages; [ + pkg-config ]; - buildCommand = let - nixHasSignalsHh = nixpkgs.lib.strings.versionAtLeast nix.version "2.19"; - in '' + buildInputs = with final; [ + nix + nlohmann_json + boost + ]; + + buildCommand = '' mkdir -p $out/bin - g++ -Os -g ${./index-debuginfo.cc} -Wall -std=c++14 -o $out/bin/index-debuginfo -I . \ - $(pkg-config --cflags nix-main) \ - $(pkg-config --libs nix-main) \ - $(pkg-config --libs nix-store) \ - -lsqlite3 \ - ${nixpkgs.lib.optionalString nixHasSignalsHh "-DHAS_SIGNALS_HH"} + $CXX \ + -Os -g -Wall \ + -std=c++14 \ + $(pkg-config --libs --cflags nix-store) \ + $(pkg-config --libs --cflags nix-main) \ + -I . \ + ${./index-debuginfo.cc} \ + -o $out/bin/index-debuginfo ''; }; - nixos-channel-scripts = with final; stdenv.mkDerivation { + nixos-channel-scripts = final.stdenv.mkDerivation { name = "nixos-channel-scripts"; - buildInputs = with perlPackages; - [ nix - sqlite - makeWrapper - perl - FileSlurp - LWP - LWPProtocolHttps - ListMoreUtils - DBDSQLite - NetAmazonS3 - brotli - jq - nixos-channel-native-programs - nix-index - ]; + strictDeps = true; + + nativeBuildInputs = with final.buildPackages; [ + makeWrapper + ]; + + buildInputs = with final.perlPackages; [ + final.perl + FileSlurp + LWP + LWPProtocolHttps + ListMoreUtils + DBDSQLite + NetAmazonS3 + ]; buildCommand = '' mkdir -p $out/bin @@ -58,7 +63,22 @@ wrapProgram $out/bin/mirror-nixos-branch \ --set PERL5LIB $PERL5LIB \ --set XZ_OPT "-T0" \ - --prefix PATH : ${lib.makeBinPath [ wget git nix gnutar xz rsync openssh nix-index nixos-channel-native-programs ]} + --prefix PATH : ${ + final.lib.makeBinPath ( + with final; + [ + wget + git + nix + gnutar + xz + rsync + openssh + nix-index + nixos-channel-native-programs + ] + ) + } patchShebangs $out/bin ''; @@ -66,9 +86,10 @@ }; - defaultPackage.x86_64-linux = (import nixpkgs { - system = "x86_64-linux"; - overlays = [ self.overlays.default ]; - }).nixos-channel-scripts; + packages.x86_64-linux.default = + (import nixpkgs { + system = "x86_64-linux"; + overlays = [ self.overlays.default ]; + }).nixos-channel-scripts; }; } diff --git a/index-debuginfo.cc b/index-debuginfo.cc index e320ccb..1b22c3d 100644 --- a/index-debuginfo.cc +++ b/index-debuginfo.cc @@ -1,19 +1,15 @@ -#include - #include -#include "shared.hh" -#include "sqlite.hh" -#include "s3-binary-cache-store.hh" -#include "thread-pool.hh" -#include "nar-info.hh" +#include + +#include +#include -// https://github.com/NixOS/nix/commit/ac89bb064aeea85a62b82a6daf0ecca7190a28b7 -#ifdef HAS_SIGNALS_HH -#include "signals.hh" -#endif +#include +#include +#include -#include +#include // cache.nixos.org/debuginfo/ // => redirect to NAR diff --git a/shell.nix b/shell.nix index db84e3d..ff89556 100644 --- a/shell.nix +++ b/shell.nix @@ -1,3 +1,3 @@ -(import (fetchTarball https://github.com/edolstra/flake-compat/archive/master.tar.gz) { +(import (fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz") { src = builtins.fetchGit ./.; }).shellNix