ctrlz.es/flake.nix
2024-01-06 01:20:26 +01:00

53 lines
1.2 KiB
Nix

{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = {
self,
nixpkgs,
}: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
rev =
if (self ? rev)
then self.rev
else "dirty";
in {
formatter.${system} = pkgs.alejandra;
devShells.${system}.default = pkgs.mkShell {
buildInputs = with pkgs; [
gnumake
go
hugo
];
shellHook = ''
echo '
'
'';
};
packages.${system}.default = pkgs.stdenv.mkDerivation {
pname = "ctrlz.es";
version = "v" + builtins.substring 0 7 rev;
src = ./.;
buildInputs = with pkgs; [hugo];
unpackPhase = false;
buildPhase = "hugo";
installPhase = ''
mkdir -p $out/var/lib/ctrlz.es
cp -r public/* $out/var/lib/ctrlz.es/
'';
};
overlays.default = final: prev: {ctrlz = self.packages.${system}.default;};
};
}