DNADD(1)

πŸ“¦ version 1.0.0, in nixos 26.05, nixpkgs unstable

🌸 DNADD(1) β€” dnadd, but make it bestie-coded 🌸

Okay so this is DNADD(1), from the General Commands Manual, and it's all about dnadd β€” the little command-line bestie that adds Nix packages declaratively. Yes, command-line energy and declarative principles. We love a duality. πŸ’…

✨ NAME ✨

dnadd β€” Add nix packages declaratively on the command line.

πŸŽ€ SYNPOSIS πŸŽ€

Quick note, bestie: the original page spells it SYNPOSIS, and we are keeping it exactly like that. Periodt.

dnadd [OPTION] ... [PACKAGE] ...

πŸ’– DESCRIPTION πŸ’–

dnadd is a utility that lets you add packages to your NixOS system in a classic command-line style while adhering to the declarative principles of NixOS. It does this by inserting the package name into your nominated .nix file and then (optionally) calling the nixos-rebuild switch command. Iconic behavior, honestly.

πŸ’… OPTIONS πŸ’…

  • -c PATH β€” Specify the path to the .nix file to edit.
  • -C PATH β€” Set the persistent path to the .nix file.
  • -t β€” Text only mode. Do not call nixos-rebuild.
  • -q β€” Only print the output of nixos-rebuild if it fails.
  • -h β€” Displays a help message.

πŸ› οΈ SETUP AND USAGE πŸ› οΈ

  1. Before first run, set the location of your .nix file that contains your packages with dnadd -C
  2. Within your .nix file inside your packages array you should write the comment #DNA# immediately above the first package. dnadd will use this to find where to place the packages and use the proper indentation.

The location of the persistent file used by dnadd and set with -C is located at ~/.config/.dna. Cute little config file, doing its thing. πŸŽ€

πŸ“ NOTES πŸ“

  1. dnadd updates your .nix file by creating a backup and swapping their names. A residual file with a .dna suffix will always be left as a backup.
  2. The path to your .nix file is resolved with realpath(3) which expands symbolic links. If, for example, your /etc/nixos/configuration.nix is a symlink for /home/alice/configuration.nix your backup file will be made in /home/alice
  3. dnadd reads the file at $(HOME)/.config/.dna. As you will likely be using dnadd with sudo or as root, you should make sure you set your location with dnadd -C as root user or sudo or manually in /root/.config/.dna

🚦 EXIT STATUS 🚦

  • 0 β€” If ok
  • Non-zero β€” dnadd exits with 1 (EXIT_FAILURE) if any error occurs or exits with nixos-rebuild's status code if nixos-rebuild does not exit successfully.

πŸ‘‘ AUTHOR πŸ‘‘

  • Edward d'Albon β€” edward.dalbon@gmail.com
  • Joe Lancaster β€” joe.a.lancas@gmail.com

That's the whole vibe, bestie. This was DNADD(1) from the General Commands Manual, and the footer is just DNADD(1) again β€” no extra version or date line listed down there. 🫢✨

πŸ“¦ where this page comes from