diff --git a/nixos/modules/installer/tools/tools.nix b/nixos/modules/installer/tools/tools.nix index 3d227eebc2d3..3a89b7663385 100644 --- a/nixos/modules/installer/tools/tools.nix +++ b/nixos/modules/installer/tools/tools.nix @@ -64,16 +64,7 @@ let manPage = ./manpages/nixos-version.8; }; - nixos-enter = makeProg { - name = "nixos-enter"; - src = ./nixos-enter.sh; - inherit (pkgs) runtimeShell; - path = makeBinPath [ - pkgs.util-linuxMinimal - ]; - manPage = ./manpages/nixos-enter.8; - }; - + inherit (pkgs) nixos-enter; in { diff --git a/nixos/modules/installer/tools/manpages/nixos-enter.8 b/pkgs/by-name/ni/nixos-enter/nixos-enter.8 similarity index 100% rename from nixos/modules/installer/tools/manpages/nixos-enter.8 rename to pkgs/by-name/ni/nixos-enter/nixos-enter.8 diff --git a/nixos/modules/installer/tools/nixos-enter.sh b/pkgs/by-name/ni/nixos-enter/nixos-enter.sh similarity index 100% rename from nixos/modules/installer/tools/nixos-enter.sh rename to pkgs/by-name/ni/nixos-enter/nixos-enter.sh diff --git a/pkgs/by-name/ni/nixos-enter/package.nix b/pkgs/by-name/ni/nixos-enter/package.nix new file mode 100644 index 000000000000..a548eed4092e --- /dev/null +++ b/pkgs/by-name/ni/nixos-enter/package.nix @@ -0,0 +1,28 @@ +{ + lib, + substituteAll, + runtimeShell, + installShellFiles, + util-linuxMinimal, +}: +substituteAll { + name = "nixos-enter"; + src = ./nixos-enter.sh; + + inherit runtimeShell; + + path = lib.makeBinPath [ + util-linuxMinimal + ]; + + dir = "bin"; + isExecutable = true; + + nativeBuildInputs = [ installShellFiles ]; + + postInstall = '' + installManPage ${./nixos-enter.8} + ''; + + meta.mainProgram = "nixos-enter"; +}