refactor: move version to Go source, extract in flake.nix
Define version once in cmd/oubliette/main.go and use builtins.match in flake.nix to extract it. Add versioning guidelines to CLAUDE.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,11 +14,13 @@
|
||||
packages = forAllSystems (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
mainGo = builtins.readFile ./cmd/oubliette/main.go;
|
||||
version = builtins.head (builtins.match ''.*const Version = "([^"]+)".*'' mainGo);
|
||||
in
|
||||
{
|
||||
default = pkgs.buildGoModule {
|
||||
pname = "oubliette";
|
||||
version = "0.1.0";
|
||||
inherit version;
|
||||
src = ./.;
|
||||
vendorHash = "sha256-z/E1ZDfedOxI8CSUfcpFGYX0SrdcnAYuu2p0ATozDaA=";
|
||||
subPackages = [ "cmd/oubliette" ];
|
||||
|
||||
Reference in New Issue
Block a user