From 9e887cf268e07521eb8d2bbbaa0fa08fac146c3f Mon Sep 17 00:00:00 2001 From: Ruud van Asseldonk Date: Thu, 18 Jun 2020 20:03:39 +0200 Subject: [PATCH 1/2] fedora-coreos-config-transpiler: init at 0.6.0 Fedora CoreOS Config Transpiler (FCCT) is to Fedora CoreOS what Container Linux Config Transpiler (CT) was to CoreOS Container Linux. --- .../default.nix | 34 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 pkgs/development/tools/fedora-coreos-config-transpiler/default.nix diff --git a/pkgs/development/tools/fedora-coreos-config-transpiler/default.nix b/pkgs/development/tools/fedora-coreos-config-transpiler/default.nix new file mode 100644 index 000000000000..44e9571aa2b0 --- /dev/null +++ b/pkgs/development/tools/fedora-coreos-config-transpiler/default.nix @@ -0,0 +1,34 @@ +{ lib, fetchFromGitHub, buildGoPackage }: + +with lib; + +buildGoPackage rec { + pname = "fcct"; + version = "0.6.0"; + + goPackagePath = "github.com/coreos/fcct"; + + src = fetchFromGitHub { + owner = "coreos"; + repo = "fcct"; + rev = "v${version}"; + sha256 = "18hmnip1s0smp58q500p8dfbrmi4i3nsyq22ri5cs53wbvz3ih1l"; + }; + + buildFlagsArray = '' + -ldflags=-X ${goPackagePath}/internal/version.Raw=v${version} + ''; + + postInstall = '' + mv $out/bin/{internal,fcct} + ''; + + meta = { + description = "Translates Fedora CoreOS configs into Ignition configs"; + license = licenses.asl20; + homepage = "https://github.com/coreos/fcct"; + maintainers = with maintainers; [ elijahcaine ruuda ]; + platforms = platforms.unix; + }; +} + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0a0bb8018efe..c6cf356b7caf 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -882,6 +882,8 @@ in container-linux-config-transpiler = callPackage ../development/tools/container-linux-config-transpiler { }; + fedora-coreos-config-transpiler = callPackage ../development/tools/fedora-coreos-config-transpiler { }; + ccextractor = callPackage ../applications/video/ccextractor { }; cconv = callPackage ../tools/text/cconv { }; From 05c559cbc9b8f63ab4286c1b3a83b00ccbfeec90 Mon Sep 17 00:00:00 2001 From: Ruud van Asseldonk Date: Fri, 19 Jun 2020 08:57:40 +0200 Subject: [PATCH 2/2] fedora-coreos-config-transpiler: use buildGoModule --- .../fedora-coreos-config-transpiler/default.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pkgs/development/tools/fedora-coreos-config-transpiler/default.nix b/pkgs/development/tools/fedora-coreos-config-transpiler/default.nix index 44e9571aa2b0..787ca7957914 100644 --- a/pkgs/development/tools/fedora-coreos-config-transpiler/default.nix +++ b/pkgs/development/tools/fedora-coreos-config-transpiler/default.nix @@ -1,13 +1,11 @@ -{ lib, fetchFromGitHub, buildGoPackage }: +{ lib, fetchFromGitHub, buildGoModule }: with lib; -buildGoPackage rec { +buildGoModule rec { pname = "fcct"; version = "0.6.0"; - goPackagePath = "github.com/coreos/fcct"; - src = fetchFromGitHub { owner = "coreos"; repo = "fcct"; @@ -15,8 +13,13 @@ buildGoPackage rec { sha256 = "18hmnip1s0smp58q500p8dfbrmi4i3nsyq22ri5cs53wbvz3ih1l"; }; + deleteVendor = true; + vendorSha256 = "0qqkaskmyxgwv9qg3y5lckqf6nchn3bxp69fyqdbvki65p445608"; + + subPackages = [ "internal" ]; + buildFlagsArray = '' - -ldflags=-X ${goPackagePath}/internal/version.Raw=v${version} + -ldflags=-X github.com/coreos/fcct/internal/version.Raw=v${version} ''; postInstall = ''