From 996da6cf8bee2fa751d8b48e1ec9540f29e92a5e Mon Sep 17 00:00:00 2001 From: lew Date: Thu, 9 Apr 2026 13:12:13 +0100 Subject: [PATCH] feat: nix flake for building guestbook --- flake.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 flake.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..529f489 --- /dev/null +++ b/flake.nix @@ -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 ]; + }; + }); +}