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.

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-format format β€” set the format of log output; one of raw, internal-json, bar or bar-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 πŸ’€
  • --option name value β€” set the Nix configuration setting name to value (overriding nix.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