6 # TODO: replace indirect self-reference by proper self-reference
7 # https://github.com/NixOS/nixpkgs/pull/119942
16 inherit (nixos {}) config;
17 version = config.system.nixos.version;
20 name = "nixos-install-tools-${version}";
21 paths = lib.attrValues {
22 # See nixos/modules/installer/tools/tools.nix
23 inherit (config.system.build) nixos-generate-config;
24 inherit nixos-install nixos-enter;
25 inherit (config.system.build.manual) nixos-configuration-reference-manpage;
28 extraOutputsToInstall = ["man"];
31 description = "The essential commands from the NixOS installer as a package";
33 With this package, you get the commands like nixos-generate-config and
34 nixos-install that you would otherwise only find on a NixOS system, such
35 as an installer image.
37 This way, you can install NixOS using a machine that only has Nix.
39 license = lib.licenses.mit;
40 homepage = "https://nixos.org";
41 platforms = lib.platforms.linux;
45 nixos-tests = lib.recurseIntoAttrs nixosTests.installer;
46 nixos-install-help = runCommand "test-nixos-install-help" {
52 Make sure that --help works. It's somewhat non-trivial because it
56 nixos-install --help | grep -F 'NixOS Reference Pages'
57 nixos-install --help | grep -F 'configuration.nix'
58 nixos-generate-config --help | grep -F 'NixOS Reference Pages'
59 nixos-generate-config --help | grep -F 'hardware-configuration.nix'
61 # FIXME: Tries to call unshare, which it must not do for --help
62 # nixos-enter --help | grep -F 'NixOS Reference Pages'
68 # no documented flags show signs of exec; skim of source suggests
69 # it's just --help execing man
70 passthru.binlore.out = binlore.synthesize nixos-install-tools ''
71 execer cannot bin/nixos-generate-config
75 pname = "nixos-install-tools";