this repo has no description

add commit to version

0xda157 d0878c31 452cce23

+15 -16
+15 -16
package.nix
··· 4 4 stdenv, 5 5 zola, 6 6 }: 7 + let 8 + commit = self.rev or (lib.removeSuffix "-dirty" self.dirtyRev); 9 + rev = lib.pipe (self.rev or self.dirtyRev) [ 10 + lib.stringToCharacters 11 + (lib.take 5) 12 + lib.concatStrings 13 + (str: if self ? rev then str else "${str}-dirty") 14 + ]; 15 + in 7 16 stdenv.mkDerivation { 8 17 pname = "da157dotid"; 9 - version = "0"; 18 + version = "0+commit=${rev}"; 10 19 11 20 src = ./.; 12 21 13 22 nativeBuildInputs = [ zola ]; 14 23 15 - postPatch = 16 - let 17 - commit = self.rev or (lib.removeSuffix "-dirty" self.dirtyRev); 18 - rev = lib.pipe (self.rev or self.dirtyRev) [ 19 - lib.stringToCharacters 20 - (lib.take 5) 21 - lib.concatStrings 22 - (str: if self ? rev then str else "${str}-dirty") 23 - ]; 24 - in 25 - '' 26 - substituteInPlace templates/partials/footer.html \ 27 - --replace %COMMIT% ${commit} \ 28 - --replace %REV% ${rev} 29 - ''; 24 + postPatch = '' 25 + substituteInPlace templates/partials/footer.html \ 26 + --replace %COMMIT% ${commit} \ 27 + --replace %REV% ${rev} 28 + ''; 30 29 31 30 buildPhase = '' 32 31 zola build -o $out