better versioning

This commit is contained in:
ari committed 2026-11-01 13:59:26 -05:00
1 parent 7f58254dbc
commit 092ef6185f
3 files changed
+18 -1

No files matched your search

+4 -1
View File
@@ -8,13 +8,16 @@
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
agent = self.nixosConfigurations.agent.config.system.build.toplevel;
date = self.lastModifiedDate;
version = "${builtins.substring 0 4 date}.${builtins.substring 4 2 date}.${builtins.substring 6 2 date}-${self.shortRev or self.dirtyShortRev or "dirty"}";
in
{
packages.${system} = {
slackerbot = pkgs.buildGoModule {
pname = "slackerbot";
version = "0.1.0";
inherit version;
src = ./slackerbot;
ldflags = [ "-X main.version=${version}" ];
vendorHash = "sha256-DFNUnPMsfcUHDlIxcxsDvuqjoHcp9EDTXWVy5t/oxEk=";
# tests need network ports and ../config.example.toml
doCheck = false;