2022-04-22 06:39:48 +00:00
|
|
|
{ buildGoModule, fetchFromGitHub, lib, makeWrapper, openssh }:
|
2018-11-18 20:58:03 +00:00
|
|
|
|
2021-05-28 06:00:08 +00:00
|
|
|
buildGoModule rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "morph";
|
2022-04-22 06:39:48 +00:00
|
|
|
version = "1.7.0";
|
2018-11-18 20:58:03 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dbcdk";
|
|
|
|
repo = "morph";
|
|
|
|
rev = "v${version}";
|
2022-04-22 06:39:48 +00:00
|
|
|
sha256 = "sha256-0CHmjqPxBgALGZYjfJFLoLBnoI0U7oZ8WyCtu1bkzZg=";
|
2018-11-18 20:58:03 +00:00
|
|
|
};
|
|
|
|
|
2021-05-28 06:00:08 +00:00
|
|
|
vendorSha256 = "08zzp0h4c4i5hk4whz06a3da7qjms6lr36596vxz0d8q0n7rspr9";
|
2018-11-18 20:58:03 +00:00
|
|
|
|
2022-04-22 06:39:48 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2018-11-18 20:58:03 +00:00
|
|
|
|
2021-08-26 06:45:51 +00:00
|
|
|
ldflags = [
|
|
|
|
"-X main.version=${version}"
|
2022-04-22 06:39:48 +00:00
|
|
|
"-X main.assetRoot=${placeholder "lib"}"
|
2021-08-26 06:45:51 +00:00
|
|
|
];
|
2019-02-21 12:55:46 +00:00
|
|
|
|
2018-11-18 20:58:03 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $lib
|
2021-05-28 06:00:08 +00:00
|
|
|
cp -v ./data/*.nix $lib
|
2020-04-28 01:50:57 +00:00
|
|
|
wrapProgram $out/bin/morph --prefix PATH : ${lib.makeBinPath [ openssh ]};
|
2018-11-18 20:58:03 +00:00
|
|
|
'';
|
|
|
|
|
2020-04-28 01:50:57 +00:00
|
|
|
outputs = [ "out" "lib" ];
|
2018-11-18 20:58:03 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2020-10-26 04:08:40 +00:00
|
|
|
description = "A NixOS host manager written in Golang";
|
2018-11-18 20:58:03 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
homepage = "https://github.com/dbcdk/morph";
|
|
|
|
maintainers = with maintainers; [adamt johanot];
|
|
|
|
};
|
|
|
|
}
|