MCPcopy Index your code
hub / github.com/jetify-com/devbox / IsNixpkgs

Method IsNixpkgs

nix/flake/flakeref.go:473–482  ·  view source on GitHub ↗

IsNixpkgs reports whether the flake reference looks like a nixpkgs flake. While there are many ways to specify this input, devbox always uses github:NixOS/nixpkgs/ as the URL. If the user wishes to reference nixpkgs themselves, this function may not return true.

()

Source from the content-addressed store, hash-verified

471// github:NixOS/nixpkgs/<hash> as the URL. If the user wishes to reference nixpkgs
472// themselves, this function may not return true.
473func (r Ref) IsNixpkgs() bool {
474 switch r.Type {
475 case TypeGitHub:
476 return r.Owner == "NixOS" && r.Repo == "nixpkgs"
477 case TypeIndirect:
478 return r.ID == "nixpkgs"
479 default:
480 return false
481 }
482}
483
484func isGitHash(s string) bool {
485 if len(s) != 40 {

Callers 4

URLWithCachingMethod · 0.80
BuildInputsMethod · 0.80
lockFlakeFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected