2022-12-21 20:53:39 +03:00
|
|
|
{ stdenvNoCC
|
|
|
|
, makeWrapper
|
|
|
|
, lib
|
|
|
|
, openssh
|
|
|
|
, gitMinimal
|
|
|
|
, nix
|
|
|
|
, coreutils
|
|
|
|
, shellcheck
|
|
|
|
}:
|
2022-12-09 17:03:50 +03:00
|
|
|
let
|
|
|
|
runtimeDeps = [
|
|
|
|
openssh
|
2022-12-21 20:52:03 +03:00
|
|
|
gitMinimal # for git flakes
|
2022-12-09 17:03:50 +03:00
|
|
|
nix
|
|
|
|
coreutils
|
|
|
|
];
|
|
|
|
in
|
2022-12-09 16:56:06 +03:00
|
|
|
stdenvNoCC.mkDerivation {
|
|
|
|
name = "nixos-remote";
|
|
|
|
src = ./.;
|
2022-12-09 17:03:50 +03:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
2022-12-21 20:53:39 +03:00
|
|
|
shellcheck
|
2022-12-09 17:03:50 +03:00
|
|
|
];
|
2022-12-09 16:56:06 +03:00
|
|
|
installPhase = ''
|
|
|
|
install -D -m755 nixos-remote $out/bin/nixos-remote
|
2022-12-09 17:03:50 +03:00
|
|
|
wrapProgram "$out/bin/nixos-remote" \
|
|
|
|
--prefix PATH : "${lib.makeBinPath runtimeDeps}"
|
2022-12-09 16:56:06 +03:00
|
|
|
'';
|
2022-12-21 20:53:39 +03:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
|
|
|
shellcheck ./nixos-remote
|
|
|
|
'';
|
2022-12-09 16:56:06 +03:00
|
|
|
}
|