ctrlz.es/flake.nix

54 lines
1.2 KiB
Nix
Raw Normal View History

2024-01-04 22:18:21 +01:00
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = {
self,
nixpkgs,
}: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
2024-01-06 01:16:30 +01:00
rev =
if (self ? rev)
then self.rev
else "dirty";
2024-01-04 22:18:21 +01:00
in {
formatter.${system} = pkgs.alejandra;
devShells.${system}.default = pkgs.mkShell {
2024-01-05 13:01:07 +01:00
buildInputs = with pkgs; [
gnumake
go
hugo
];
2024-01-04 22:18:21 +01:00
shellHook = ''
echo '
'
'';
};
2024-01-06 01:01:01 +01:00
packages.${system}.default = pkgs.stdenv.mkDerivation {
2024-01-06 01:16:30 +01:00
pname = "ctrlz.es";
version = "v" + builtins.substring 0 7 rev;
2024-01-06 01:01:01 +01:00
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;};
2024-01-04 22:18:21 +01:00
};
}