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

fix: version

parent 8b598396
No related branches found
No related tags found
No related merge requests found
/nix/store/4bvalx54rgxmryi1jx7k70aq4ccr7phq-Taskfile.yaml
\ No newline at end of file
/nix/store/hp4y487ym0n2nvcqmhix6irzffnhdx4a-Taskfile.yaml
\ No newline at end of file
......@@ -74,11 +74,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1703992652,
"narHash": "sha256-C0o8AUyu8xYgJ36kOxJfXIroy9if/G6aJbNOpA5W0+M=",
"lastModified": 1704145853,
"narHash": "sha256-G/1AMt9ibpeMlcxvD1vNaC8imGaK+g7zZ99e29BLgWw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "32f63574c85fbc80e4ba1fbb932cde9619bad25e",
"rev": "2d2ea8eab9e400618748ab1a6a108255233b602c",
"type": "github"
},
"original": {
......@@ -171,11 +171,11 @@
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1704188267,
"narHash": "sha256-9Wrl8w8jQxhz8uuuojZX5a6EPqqlNY6/HzKa1RuKNfc=",
"lastModified": 1704308484,
"narHash": "sha256-aclQ3GUoElRa5OlVZgtxzP1iM6Lus8ffDLRfV+0R9gQ=",
"ref": "refs/heads/master",
"rev": "ca971c11a1600679e981f28c5433581355033b9b",
"revCount": 42,
"rev": "8b59839682aafe4285c333a943046dc101d94a0d",
"revCount": 76,
"type": "git",
"url": "https://gitlab.schukai.com/oss/utilities/version.git"
},
......
......@@ -20,10 +20,11 @@
aliases:
- b
cmds:
- devenv shell build-app
- build-app
sources:
- source/*.go
- source/**/*.go
- source/**/*.mod
- source/go.mod
- dist/**
commit:
......@@ -52,7 +53,7 @@
command = "${pkgs.alejandra}/bin/alejandra"
options = []
includes = [ "*.nix" ]
excludes = []
excludes = [ "devenv.nix" ]
[formatter.go]
command = "${pkgs.go}/bin/gofmt"
......
......@@ -13,7 +13,17 @@
rootPath = ./.;
project = import "${rootPath}/project.nix";
goPkgReleaseData = import "${rootPath}/project.nix";
goPkgName = goPkgReleaseData.name or "goPkg";
goPkgMnemonic = goPkgReleaseData.mnemonic or "go-pkg";
goPkgDescription = goPkgReleaseData.description or "this is a goPkg";
goPkgVersion = goPkgReleaseData.version or "0.1.0";
goPkgHash =
if (self ? shortRev)
then self.shortRev
else "dirty-not-for-production";
goPkgVendorHash = goPkgReleaseData.vendorHash or null;
# System types to support.
supportedSystems = ["x86_64-linux" "x86_64-windows" "x86_64-darwin"];
......@@ -28,18 +38,26 @@
pkgs = nixpkgsFor.${system};
in {
version = pkgs.buildGoModule {
name = "version";
name = goPkgName;
# In 'nix develop', we don't need a copy of the source tree
# in the Nix store.
src = ././source;
tags = []; # add your tags here (eq "netgo" "osusergo" "static_build")
ldflags = [
"-X 'main.version=${goPkgVersion}'"
"-X 'main.commit=${goPkgHash}'"
"-X 'main.build=${lastModifiedDate}'"
"-X 'main.name=${goPkgName}'"
"-X 'main.mnemonic=${goPkgMnemonic}'"
];
#vendorHash = pkgs.lib.fakeHash;
vendorHash = project.vendorHash;
vendorHash = goPkgVendorHash;
meta = with nixpkgs.legacyPackages.${system}.lib; {
description = "Version is a program that automates and simplifies the process of incrementing version numbers for software projects.";
description = goPkgDescription;
homepage = "https://gitlab.schukai.com/oss/utilities/version";
license = licenses.mit;
maintainers = with maintainers; ["schukai GmbH"];
......
{
name = "Version";
mnemonic = "version";
description = "Manage version information";
description = "Version is a program that automates and simplifies the process of incrementing version numbers for software projects.";
supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
compileForSystems = ["linux/arm64" "linux/amd64" "darwin/amd64" "windows/amd64"];
modulePath = "gitlab.schukai.com/oss/utilities/version";
......
......@@ -3,11 +3,11 @@ package main
// Used when building per
// -ldflags "-X main.version=$version -X main.build=$(due --iso-8601 | tr -d "-" )"
var (
version = "dev"
build = "n/a"
mnemonic = "version"
name = "Version"
commit = "n/a"
version = "-/-"
build = "-/-"
mnemonic = "-/-"
name = "-/-"
commit = "-/-"
)
type Accessor interface {
......
/nix/store/7fz761spzs45g2kdvpa6fk9j21slwmdv-Taskfile.yaml
\ No newline at end of file
/nix/store/smqjqjy0wa39nvk52jq6x8w1i4bs65g9-Taskfile.yaml
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment