feat: nix flake for building guestbook

This commit is contained in:
Lewis Wynne 2026-04-09 13:12:13 +01:00
parent 66e314810b
commit 996da6cf8b

26
flake.nix Normal file
View file

@ -0,0 +1,26 @@
{
description = "Guestbook";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
crane.url = "github:ipetkov/crane";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, crane, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
craneLib = crane.mkLib pkgs;
guestbook = craneLib.buildPackage {
src = craneLib.cleanCargoSource ./.;
buildInputs = with pkgs; [ openssl ];
nativeBuildInputs = with pkgs; [ pkg-config ];
};
in {
packages.default = guestbook;
devShells.default = craneLib.devShell {
packages = with pkgs; [ cargo rustc rust-analyzer ];
};
});
}