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.
()
| 471 | // github:NixOS/nixpkgs/<hash> as the URL. If the user wishes to reference nixpkgs |
| 472 | // themselves, this function may not return true. |
| 473 | func (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 | |
| 484 | func isGitHash(s string) bool { |
| 485 | if len(s) != 40 { |
no outgoing calls
no test coverage detected