2020-01-20 12:49:14 +00:00
|
|
|
{ buildGoPackage, fetchFromGitHub, go-bindata, openssh, makeWrapper, lib }:
|
2018-11-18 20:58:03 +00:00
|
|
|
|
|
|
|
buildGoPackage rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "morph";
|
2020-05-27 13:49:33 +01:00
|
|
|
version = "1.5.0";
|
2018-11-18 20:58:03 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dbcdk";
|
|
|
|
repo = "morph";
|
|
|
|
rev = "v${version}";
|
2020-05-27 13:49:33 +01:00
|
|
|
sha256 = "064ccvvq4yk17jy5jvi1nxfp5ajvnvn2k4zvh9v0n3ragcl3rd20";
|
2018-11-18 20:58:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
goPackagePath = "github.com/dbcdk/morph";
|
|
|
|
goDeps = ./deps.nix;
|
|
|
|
|
2020-03-17 23:24:07 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper go-bindata ];
|
2018-11-18 20:58:03 +00:00
|
|
|
|
2019-02-21 12:55:46 +00:00
|
|
|
buildFlagsArray = ''
|
|
|
|
-ldflags=
|
|
|
|
-X
|
|
|
|
main.version=${version}
|
|
|
|
'';
|
|
|
|
|
2020-05-27 13:49:33 +01:00
|
|
|
postPatch = ''
|
2018-11-18 20:58:03 +00:00
|
|
|
go-bindata -pkg assets -o assets/assets.go data/
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $lib
|
2020-05-27 13:49:33 +01:00
|
|
|
cp -v go/src/$goPackagePath/data/*.nix $lib
|
2020-04-28 02:50:57 +01:00
|
|
|
wrapProgram $out/bin/morph --prefix PATH : ${lib.makeBinPath [ openssh ]};
|
2018-11-18 20:58:03 +00:00
|
|
|
'';
|
|
|
|
|
2020-04-28 02:50:57 +01: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];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|