nix3-store-cat(1)
π nix3-store-cat(1) π
okay bestie, welcome to the General Commands Manual β yes that's the actual name of the manual collection, we're fancy here. this is the page for nix store cat and it's lowkey one of the most useful lil commands in the whole nix toolkit. let's get into it π«Ά
β οΈ Warning β this program is experimental and its interface is subject to change. so if you build a whole workflow around it and it shifts under you, that's not a bug, that's the vibe. proceed with awareness bestie π
β¨ Name β¨
nix store cat β print the contents of a file in the Nix store on stdout πΈ
that's it. that's the whole job. it reads a file from your Nix store (or from a remote store, or a binary cache, whatever you point it at) and dumps it straight to standard output so you can pipe it into other stuff. main character energy fr fr.
π Synopsis π
nix store cat [optionβ¦] path
short, sweet, and exactly as powerful as it looks. one path, as many options as your heart desires.
π¦ Examples π¦
okay so say you wanna peek at a file that lives in a binary cache β like, not even on your machine yet β and you want to see the very first bytes of it because you're a person who hexdumps things for fun (valid):
# nix store cat --store https://cache.nixos.org/ \
/nix/store/qbhyj3blxpw2i6pb7c6grc9185nbnpvy-hello-2.10/bin/hello | hexdump -C | head -n1
00000000 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 |.ELF............|
look at that π 7f 45 4c 46 β that's \x7fELF, she's an ELF binary your honour. notice the --store https://cache.nixos.org/ pointing at a remote binary cache, and the \ line continuation because we're keeping it cute and readable. obsessed.
π Description π
so what does this actually do? this command prints, on standard output, the contents of the regular file path in a Nix store. π
and here's the slay part: path can be a top-level store path OR any file inside a store path. so you're not stuck pointing at the root of a derivation β you can drill right down into /nix/store/.../bin/whatever and it just works. iykyk β¨
takes a file, puts the bytes on stdout. periodt.
π Options π
so many lil knobs to turn. buckle up, bestie.
πΈ Logging-related options
these control how much the command talks while it's doing its thing. very much "how chatty do you want me to be" energy.
--debugβ set the logging verbosity level to βdebugβ. maximum yapping mode, we love a detailed queen π--log-formatformatβ set the format of log output; one ofraw,internal-json,barorbar-with-logs. you want your logs crunchy, structured, pretty-bar-shaped, or pretty-bar-shaped but with the full logs inside? your call, gorgeous.--print-build-logs,-Lβ print full build logs on standard error. so when something has to get built, you see everything it has to say, and it goes to stderr, not stdout (stdout stays clean for your actual file contents β¨).--quietβ decrease the logging verbosity level. shhh π€« she's being demure.--verbose,-vβ increase the logging verbosity level. more talking, more tea, more details. spill π
π Miscellaneous global options
the universal ones, the ones every nix command has, the ones that just show up everywhere like that one friend who's always at the function.
--helpβ show usage information. when in doubt, ask for help, that's growth bestie π«Ά--offlineβ disable substituters and consider all previously downloaded files up-to-date. no network, no fetching, we're working with what we already have π--optionnamevalueβ set the Nix configuration settingnametovalue(overridingnix.conf). inline config override, right there on the command line. iconique.--refreshβ consider all previously downloaded files out-of-date. like hitting "clear cache" but emotionally π--versionβ show version information. who am i? what am i? what version of me are you running? β
π Note β see man nix.conf for overriding configuration settings with command line flags. the config lore runs deep, and this is your gateway, bestie.
and that's the whole page!! no cap, you now know everything the manpage knows about nix store cat. go forth and read bytes out of your store like the legend you are πβ¨
okay bye, this has been nix3-store-cat(1) from the General Commands Manual β see you in the next one, ilysm ππ¦
π¦ 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