nixos-anywhere/nixos-remote.nix
2022-12-21 19:36:39 +01:00

36 lines
566 B
Nix

{ stdenvNoCC
, makeWrapper
, lib
, openssh
, gitMinimal
, nix
, coreutils
, shellcheck
}:
let
runtimeDeps = [
openssh
gitMinimal # for git flakes
nix
coreutils
];
in
stdenvNoCC.mkDerivation {
name = "nixos-remote";
src = ./.;
nativeBuildInputs = [
makeWrapper
shellcheck
];
installPhase = ''
install -D -m755 nixos-remote $out/bin/nixos-remote
wrapProgram "$out/bin/nixos-remote" \
--prefix PATH : "${lib.makeBinPath runtimeDeps}"
'';
doCheck = true;
checkPhase = ''
shellcheck ./nixos-remote
'';
}