DNADD(1)
πΈ 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.nixfile to edit.-C PATHβ Set the persistent path to the.nixfile.-tβ Text only mode. Do not callnixos-rebuild.-qβ Only print the output ofnixos-rebuildif it fails.-hβ Displays a help message.
π οΈ SETUP AND USAGE π οΈ
- Before first run, set the location of your
.nixfile that contains your packages withdnadd -C - Within your
.nixfile inside your packages array you should write the comment#DNA#immediately above the first package.dnaddwill 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 π
dnaddupdates your.nixfile by creating a backup and swapping their names. A residual file with a.dnasuffix will always be left as a backup.- The path to your
.nixfile is resolved withrealpath(3)which expands symbolic links. If, for example, your/etc/nixos/configuration.nixis a symlink for/home/alice/configuration.nixyour backup file will be made in/home/alice dnaddreads the file at$(HOME)/.config/.dna. As you will likely be usingdnaddwithsudoor as root, you should make sure you set your location withdnadd -Cas root user orsudoor manually in/root/.config/.dna
π¦ EXIT STATUS π¦
0β If ok- Non-zero β
dnaddexits with1(EXIT_FAILURE) if any error occurs or exits withnixos-rebuild's status code ifnixos-rebuilddoes 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
- nixos 26.05: dnadd 1.0.0
- nixpkgs unstable: dnadd 1.0.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms