nix3-store-add(1)

🌸 nix3-store-add(1) 🌸

okay bestie, welcome to the nix3-store-add(1) page from the General Commands Manual β€” yes, the whole manual, and yes this one's a lil ✨experimental✨

⚠️ Warning ⚠️ This program is experimental and its interface is subject to change. like, no cap, the whole vibe could shift on you. πŸ™ˆ

✨ Name ✨

nix store add β€” add a file or directory to the Nix store πŸ’–


πŸ¦‹ Synopsis πŸ¦‹

nix store add [option…] path

πŸŽ€ Description πŸŽ€

so basically, nix store add copies path into the Nix store, and then prints the resulting store path on standard output. that's it. that's the whole serve. slay. πŸ’…

⚠️ Warning β€” big one, bestie, don't skip this The resulting store path is not registered as a garbage collector root, so it could get deleted before you even have a chance to register it. literally could vanish. keep that in mind. 😭

🌈 Examples 🌈

adding a directory to the store, the iconic way:

# mkdir dir
# echo foo > dir/bar

# nix store add ./dir
/nix/store/6pmjx56pm94n66n4qw1nff0y1crm8nqg-dir

# cat /nix/store/6pmjx56pm94n66n4qw1nff0y1crm8nqg-dir/bar
foo

look at that. it went in, it came out, foo is right there. obsessed. 🫢


πŸ’œ Options πŸ’œ

  • --dry-run β€” show what this command would do, without actually doing it. window shopping energy. πŸ›οΈ
  • --hash-algo hash-algo β€” the hash algorithm. one of blake3, md5, sha1, sha256, or sha512.
  • --mode content-address-method β€” how to compute the content-address of the store object. it's one of these three:
    • nar (the default) β€” serialises the input as a Nix Archive and passes that to the hash function.
    • flat β€” assumes the input is a single file and passes it directly to the hash function.
    • text β€” like flat, but used for derivations serialized in store object and builtins.toFile. for advanced use-cases only; for regular usage, prefer nar and flat. like, stay in your lane unless you know what you're doing, iykyk. πŸ’…
  • --name / -n name β€” override the name component of the store path. it defaults to the base name of path. main character gets to pick her own name. πŸ‘‘
  • --debug β€” set the logging verbosity level to debug. maximum yappability. πŸ—£οΈ
  • --log-format format β€” set the format of log output; one of raw, internal-json, bar or bar-with-logs.
  • --print-build-logs / -L β€” print full build logs on standard error.
  • --quiet β€” decrease the logging verbosity level. shhh. 🀫
  • --verbose / -v β€” increase the logging verbosity level. tell me everything. ✨

⭐ Miscellaneous global options ⭐

  • --help β€” show usage information.
  • --offline β€” disable substituters and consider all previously downloaded files up-to-date.
  • --option name value β€” set the Nix configuration setting name to value (overriding nix.conf).
  • --refresh β€” consider all previously downloaded files out-of-date. πŸ”„
  • --version β€” show version information.
πŸ“ Note See man nix.conf for overriding configuration settings with command line flags.

and that's the whole page, bestie β€” signed off as nix3-store-add(1), straight out of the General Commands Manual. go add something to the store, you absolute icon. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from