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-algohash-algo β the hash algorithm. one ofblake3,md5,sha1,sha256, orsha512.--modecontent-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β likeflat, but used for derivations serialized in store object andbuiltins.toFile. for advanced use-cases only; for regular usage, prefernarandflat. like, stay in your lane unless you know what you're doing, iykyk. π
--name/-nname β override the name component of the store path. it defaults to the base name of path. main character gets to pick her own name. π
π§ Logging-related options π§
--debugβ set the logging verbosity level todebug. maximum yappability. π£οΈ--log-formatformat β set the format of log output; one ofraw,internal-json,barorbar-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.--optionname value β set the Nix configuration setting name to value (overridingnix.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
- fedora 44: nix-core 2.35.3-2.fc44 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms