2020-01-20 13:49:14 +01:00
|
|
|
{ buildGoPackage, fetchFromGitHub, go-bindata, openssh, makeWrapper, lib }:
|
2018-11-18 21:58:03 +01:00
|
|
|
|
|
|
|
buildGoPackage rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "morph";
|
2020-01-10 11:57:53 +01:00
|
|
|
version = "1.4.0";
|
2018-11-18 21:58:03 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dbcdk";
|
|
|
|
repo = "morph";
|
|
|
|
rev = "v${version}";
|
2020-01-10 11:57:53 +01:00
|
|
|
sha256 = "1y6clzi8sfnrv4an26b44r24nnxds1kj9aw3lmjbgxl9yrxxsj1k";
|
2018-11-18 21:58:03 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
goPackagePath = "github.com/dbcdk/morph";
|
|
|
|
goDeps = ./deps.nix;
|
|
|
|
|
2020-03-18 00:24:07 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper go-bindata ];
|
2018-11-18 21:58:03 +01:00
|
|
|
|
2019-02-21 13:55:46 +01:00
|
|
|
buildFlagsArray = ''
|
|
|
|
-ldflags=
|
|
|
|
-X
|
|
|
|
main.version=${version}
|
|
|
|
'';
|
|
|
|
|
2018-11-18 21:58:03 +01:00
|
|
|
prePatch = ''
|
|
|
|
go-bindata -pkg assets -o assets/assets.go data/
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $lib
|
|
|
|
cp -v $src/data/*.nix $lib
|
2020-01-20 13:49:14 +01:00
|
|
|
wrapProgram $bin/bin/morph --prefix PATH : ${lib.makeBinPath [ openssh ]};
|
2018-11-18 21:58:03 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
outputs = [ "out" "bin" "lib" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Morph is a NixOS host manager written in Golang.";
|
|
|
|
license = licenses.mit;
|
|
|
|
homepage = "https://github.com/dbcdk/morph";
|
|
|
|
maintainers = with maintainers; [adamt johanot];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|