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
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,13 @@
# url = "https://gitlab.schukai.com/oss/utilities/version/-/archive/0.5.0/version-0.5.0.tar.gz";
# # You'll need to provide the correct hash here.
# 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
{
......@@ -40,11 +46,19 @@
packages = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
version = "${versionTool}/bin/version print --git"; # assuming this gives you version
build = "${versionTool}/bin/version build"; # assuming this gives you build
version = builtins.readFile "${versionAndBuild}.version";
build = builtins.readFile "${versionAndBuild}.build";
in
{
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";
# In 'nix develop', we don't need a copy of the source tree
# in the Nix store.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment