nixos-anywhere/nixos-remote.nix

36 lines
566 B
Nix
Raw Normal View History

2022-12-21 20:53:39 +03:00
{ stdenvNoCC
, makeWrapper
, lib
, openssh
, gitMinimal
, nix
, coreutils
, shellcheck
}:
let
runtimeDeps = [
openssh
gitMinimal # for git flakes
nix
coreutils
];
in
2022-12-09 16:56:06 +03:00
stdenvNoCC.mkDerivation {
name = "nixos-remote";
src = ./.;
nativeBuildInputs = [
makeWrapper
2022-12-21 20:53:39 +03:00
shellcheck
];
2022-12-09 16:56:06 +03:00
installPhase = ''
install -D -m755 nixos-remote $out/bin/nixos-remote
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
}