Wolfgang Walther 4ce241c882
replaceVarsWith: init
Takes the extended features of nix substituteAll to a replaceVars
variant to get rid of those cases that use substituteAll to build a full
package with meta information etc.
2024-12-14 20:16:10 +01:00

37 lines
697 B
Nix

{
lib,
replaceVarsWith,
runtimeShell,
installShellFiles,
util-linuxMinimal,
}:
replaceVarsWith {
name = "nixos-enter";
src = ./nixos-enter.sh;
replacements = {
inherit runtimeShell;
path = lib.makeBinPath [
util-linuxMinimal
];
};
dir = "bin";
isExecutable = true;
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installManPage ${./nixos-enter.8}
'';
meta = {
description = "Run a command in a NixOS chroot environment";
homepage = "https://github.com/NixOS/nixpkgs/tree/master/pkgs/by-name/ni/nixos-install";
license = lib.licenses.mit;
platforms = lib.platforms.linux;
mainProgram = "nixos-enter";
};
}