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

fix: versions number

parent b445dda3
No related branches found
No related tags found
No related merge requests found
{ {
description = "docman is a document management tool"; description = "docman is a document management tool";
inputs = { inputs = {
nixpkgs.url = "nixpkgs/nixos-23.05"; nixpkgs.url = "nixpkgs/nixos-23.05";
}; };
outputs = { self, nixpkgs, ... }: outputs = { self, nixpkgs, ... }:
let let
# Extract the version from version.json
versionData = builtins.fromJSON (builtins.readFile ./version.json);
version = versionData.version;
# Convert the last modified date to ISO format
lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101"; lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101";
isoDate = builtins.concatStringsSep "" [
(builtins.substring 0 4 lastModifiedDate)
(builtins.substring 4 2 lastModifiedDate)
(builtins.substring 6 2 lastModifiedDate)
];
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems; forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
pkgs = import nixpkgs { system = "x86_64-linux"; }; pkgs = import nixpkgs { system = "x86_64-linux"; };
in {
in
{
packages = forAllSystems (system: packages = forAllSystems (system:
let let
pkgs = nixpkgsFor.${system}; pkgs = nixpkgsFor.${system};
in
in { {
docman = pkgs.buildGoModule { docman = pkgs.buildGoModule {
name = "docman"; name = "docman";
version = "${self.ref}"; version = version;
src = ././source; src = ././source;
vendorSha256 = "sha256-81IBG8H1jsYKD+tmFeCpAWFdz6cuQDt9r+FV56xboBU="; vendorSha256 = "sha256-81IBG8H1jsYKD+tmFeCpAWFdz6cuQDt9r+FV56xboBU=";
ldflags = [ ldflags = [
"-X 'gitlab.schukai.com/oss/utilities/documentation-manager/release.version=${self.ref}' -X 'gitlab.schukai.com/oss/utilities/documentation-manager/release.build=${self.lastModified}'" "-X 'gitlab.schukai.com/oss/utilities/documentation-manager/release.version=${version}' -X 'gitlab.schukai.com/oss/utilities/documentation-manager/release.build=${isoDate}'"
]; ];
meta = with nixpkgs.legacyPackages.${system}.lib; { meta = with nixpkgs.legacyPackages.${system}.lib; {
description = "docman is a document management tool"; description = "docman is a document management tool";
homepage = "https://gitlab.schukai.com/oss/utilities/documentation-manager"; homepage = "https://gitlab.schukai.com/oss/utilities/documentation-manager";
license = licenses.mit; license = licenses.mit;
maintainers = with maintainers; [ "schukai GmbH" ]; maintainers = with maintainers; [ "schukai GmbH" ];
}; };
}; };
}); });
devShells = forAllSystems (system: devShells = forAllSystems (system:
let let
pkgs = nixpkgsFor.${system}; pkgs = nixpkgsFor.${system};
in in
{ {
...@@ -57,7 +65,6 @@ ...@@ -57,7 +65,6 @@
}; };
}); });
defaultPackage = forAllSystems (system: self.packages.${system}.docman); defaultPackage = forAllSystems (system: self.packages.${system}.docman);
}; };
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment