this repo has no description

add commit to footer

0xda157 2df4010a 7d5a963e

+30 -4
+6 -2
flake.nix
··· 5 5 }; 6 6 7 7 outputs = 8 - { nixpkgs, systems, ... }: 8 + { 9 + self, 10 + nixpkgs, 11 + systems, 12 + }: 9 13 let 10 14 inherit (nixpkgs) lib; 11 15 forEachPkgs = f: lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system}); 12 16 in 13 17 { 14 18 packages = forEachPkgs (pkgs: { 15 - default = pkgs.callPackage ./package.nix { }; 19 + default = pkgs.callPackage ./package.nix { inherit self; }; 16 20 }); 17 21 18 22 devShells = forEachPkgs (pkgs: {
+22 -1
package.nix
··· 1 - { stdenv, zola }: 1 + { 2 + self, 3 + lib, 4 + stdenv, 5 + zola, 6 + }: 2 7 stdenv.mkDerivation { 3 8 pname = "da157dotid"; 4 9 version = "0"; ··· 6 11 src = ./.; 7 12 8 13 nativeBuildInputs = [ zola ]; 14 + 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 + ''; 9 30 10 31 buildPhase = '' 11 32 zola build -o $out
+2 -1
templates/partials/footer.html
··· 3 3 &copy; 0xda157 2024-{{ now(utc=true) | date(format="%Y") }} 4 4 | CC BY-SA 4.0 5 5 | <a href="https://codeberg.org/da157/website">source code</a> 6 - | built at {{ now(timestamp=true, utc=true) | date(format="%F %RZ") }} 6 + | built at {{ now(timestamp=true, utc=true) | date(format="%F %RZ") }}, 7 + commit <a href="https://codeberg.org/da157/website/commit/%COMMIT%">%REV%</a> 7 8 </div> 8 9 <div id="footer-webrings"> 9 10 webrings: