main: more detailed --version output

This commit is contained in:
2026-07-27 06:09:54 +09:00
parent b9d00eae33
commit dd36eff986
4 changed files with 21 additions and 15 deletions
+9 -2
View File
@@ -105,20 +105,27 @@
default = self.packages.${system}.worblehat;
worblehat = let
inherit (pkgs) python3Packages;
inherit (self) sourceInfo;
pyproject = lib.pipe ./pyproject.toml [
builtins.readFile
builtins.fromTOML
];
in python3Packages.buildPythonApplication {
pname = pyproject.project.name;
version = pyproject.project.version;
version = "0.1";
src = lib.cleanSource ./.;
format = "pyproject";
build-system = with python3Packages; [ hatchling ];
build-system = with python3Packages; [ setuptools setuptools-scm ];
dependencies = deps pkgs.python3Packages;
env.SETUPTOOLS_SCM_PRETEND_METADATA = (x: "{${x}}") (lib.concatStringsSep ", " [
"node=\"${sourceInfo.rev or (lib.substring 0 64 sourceInfo.dirtyRev)}\""
"node_date=${lib.substring 0 4 sourceInfo.lastModifiedDate}-${lib.substring 4 2 sourceInfo.lastModifiedDate}-${lib.substring 6 2 sourceInfo.lastModifiedDate}"
"dirty=${if sourceInfo ? dirtyRev then "true" else "false"}"
]);
meta.mainProgram = "worblehat";
};
});