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

Function profileSourced

nix/nix.go:388–394  ·  view source on GitHub ↗

profileSourced checks if the Nix profile shell scripts (such as nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh) have already been successfully sourced.

()

Source from the content-addressed store, hash-verified

386// /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh) have already been
387// successfully sourced.
388func profileSourced() bool {
389 // Check if we're already in a Nix environment. Use NIX_PROFILES instead
390 // of __ETC_PROFILE_NIX_SOURCED because it's set for single-user
391 // installs and on NixOS (whereas __ETC_PROFILE_NIX_SOURCED is not).
392 _, ok := os.LookupEnv("NIX_PROFILES")
393 return ok
394}
395
396// profilePaths returns the paths where the Nix profile shell scripts might be.
397// None of the paths are guaranteed to be readable or even exist.

Callers 1

SourceProfileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected