-
-
Save LnL7/74a29376b93026876f40db99a457a691 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ ... }@args: | |
let | |
mapConfig = defaults: attrs: builtins.mapAttrs (getDefault defaults) (builtins.mapAttrs (n: builtins.getEnv) attrs); | |
getDefault = defaults: n: v: if v != "" then v else defaults."${n}" or ""; | |
traceInputs = message: x: if builtins.getEnv "NIX_TRACE_INPUTS" == "0" then x else builtins.trace message x; | |
defaults = { | |
url = "ssh://git@gitlab.example.org/upstream/nixpkgs.git"; | |
ref = "foo"; | |
}; | |
cfg = mapConfig defaults { | |
url = "FOO_NIXPKGS_URL"; | |
ref = "FOO_NIXPKGS_BRANCH"; | |
rev = "FOO_NIXPKGS_REVISION"; | |
}; | |
nixpkgs = builtins.fetchGit cfg; | |
in | |
traceInputs '' | |
fetched dynamic inputs | |
Use these variables to reproduce the current build. | |
FOO_NIXPKGS_URL=${cfg.url} | |
FOO_NIXPKGS_BRANCH=${cfg.ref} | |
FOO_NIXPKGS_REVISION=${nixpkgs.rev} | |
'' | |
import nixpkgs args |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment