2021-05-28 08:00:08 +02:00
|
|
|
{ buildGoModule, fetchFromGitHub, go-bindata, openssh, makeWrapper, lib }:
|
2018-11-18 21:58:03 +01:00
|
|
|
|
2021-05-28 08:00:08 +02:00
|
|
|
buildGoModule rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "morph";
|
2021-05-28 08:00:08 +02:00
|
|
|
version = "1.6.0";
|
2018-11-18 21:58:03 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dbcdk";
|
|
|
|
repo = "morph";
|
|
|
|
rev = "v${version}";
|
2021-05-28 08:00:08 +02:00
|
|
|
sha256 = "0aibs4gsb9pl21nd93bf963kdzf0661qn0liaw8v8ak2xbz7nbs8";
|
2018-11-18 21:58:03 +01:00
|
|
|
};
|
|
|
|
|
2021-05-28 08:00:08 +02:00
|
|
|
vendorSha256 = "08zzp0h4c4i5hk4whz06a3da7qjms6lr36596vxz0d8q0n7rspr9";
|
2018-11-18 21:58:03 +01:00
|
|
|
|
2020-03-18 00:24:07 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper go-bindata ];
|
2018-11-18 21:58:03 +01:00
|
|
|
|
2021-08-26 08:45:51 +02:00
|
|
|
ldflags = [
|
|
|
|
"-X main.version=${version}"
|
|
|
|
];
|
2019-02-21 13:55:46 +01:00
|
|
|
|
2020-05-27 14:49:33 +02:00
|
|
|
postPatch = ''
|
2018-11-18 21:58:03 +01:00
|
|
|
go-bindata -pkg assets -o assets/assets.go data/
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $lib
|
2021-05-28 08:00:08 +02:00
|
|
|
cp -v ./data/*.nix $lib
|
2020-04-28 03:50:57 +02:00
|
|
|
wrapProgram $out/bin/morph --prefix PATH : ${lib.makeBinPath [ openssh ]};
|
2018-11-18 21:58:03 +01:00
|
|
|
'';
|
|
|
|
|
2020-04-28 03:50:57 +02:00
|
|
|
outputs = [ "out" "lib" ];
|
2018-11-18 21:58:03 +01:00
|
|
|
|
|
|
|
meta = with lib; {
|
2020-10-26 05:08:40 +01:00
|
|
|
description = "A NixOS host manager written in Golang";
|
2018-11-18 21:58:03 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
homepage = "https://github.com/dbcdk/morph";
|
|
|
|
maintainers = with maintainers; [adamt johanot];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|