Skip to content
Snippets Groups Projects
Verified Commit 28d40c3a authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

build: Refactor `flake.nix` file and `docman` package definition

- Updated `flake.nix` file with various modifications and additions
- Added build phase and updated version variables in `docman` package definition
- Updated `ldflags` and `vendorSha256` variables in `docman` package definition
- Added a new dependency in `buildInputs` and metadata for `docman` package
parent b07d224a
Branches
Tags
No related merge requests found
...@@ -33,6 +33,12 @@ ...@@ -33,6 +33,12 @@
# sha256 = "sha256-jzixQKFFW4oxO0S4GYqbkFCXzhBd6com6Z9+MtVKakU="; # sha256 = "sha256-jzixQKFFW4oxO0S4GYqbkFCXzhBd6com6Z9+MtVKakU=";
# }; # };
versionAndBuild = pkgs.runCommand "get-version-and-build" {} ''
${versionTool}/bin/version print --git > $out.version
${versionTool}/bin/version build > $out.build
'';
in in
{ {
...@@ -40,11 +46,19 @@ ...@@ -40,11 +46,19 @@
packages = forAllSystems (system: packages = forAllSystems (system:
let let
pkgs = nixpkgsFor.${system}; pkgs = nixpkgsFor.${system};
version = "${versionTool}/bin/version print --git"; # assuming this gives you version version = builtins.readFile "${versionAndBuild}.version";
build = "${versionTool}/bin/version build"; # assuming this gives you build build = builtins.readFile "${versionAndBuild}.build";
in in
{ {
docman = pkgs.buildGoModule { docman = pkgs.buildGoModule {
buildPhase = ''
version=$(${versionTool}/bin/version print --git)
build=$(${versionTool}/bin/version build)
go build -ldflags "-X 'gitlab.schukai.com/oss/utilities/documentation-manager/release.version=$version' -X 'gitlab.schukai.com/oss/utilities/documentation-manager/release.build=$build'"
'';
name = "docman"; name = "docman";
# In 'nix develop', we don't need a copy of the source tree # In 'nix develop', we don't need a copy of the source tree
# in the Nix store. # in the Nix store.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment