From cd6966f1b447e8c45d499bd8b385a57fbfe70e60 Mon Sep 17 00:00:00 2001 From: Michele Guerini Rocco Date: Wed, 4 May 2022 10:17:17 +0200 Subject: [PATCH] default.nix: prevent nixpkgs tarball GC When adding a GC root with `nix-build -A inputDerivation` the Nixpkgs tarball wasn't being saved because it's technically not a build input. --- default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/default.nix b/default.nix index 9a17a88..cd39407 100644 --- a/default.nix +++ b/default.nix @@ -2,11 +2,11 @@ let # Pinned Nixpkgs for reproducibility - nixpkgs = import (builtins.fetchTarball + nixpkgs = builtins.fetchTarball { name = "nixpkgs-21.05-ee90403e147"; url = "https://github.com/nixos/nixpkgs/archive/ee90403e147.tar.gz"; sha256 = "1mk3s4ncfa8z8mr6vrgjh74s8dci12yam7plpc1bqgz12wld73ax"; - }) {}; + }; # Needed for HTML manual katex = builtins.fetchTarball { @@ -20,7 +20,7 @@ let !builtins.elem path [ "configure.mk" "default.nix" "result" ] && baseNameOf path != "build") ./.; - inherit (nixpkgs) lib pkgs; + inherit (import nixpkgs {}) lib pkgs; in pkgs.stdenv.mkDerivation rec { @@ -41,6 +41,9 @@ in (texlive.combine { inherit (texlive) scheme-small xetex fontspec; }) + + # save nixpkgs tarball from gc + nixpkgs ]; buildInputs = lib.optional static pkgs.glibc.static;