feat: adds nix flake for reproducible builds

This commit is contained in:
ShyProton 2024-01-22 00:32:52 -05:00
parent 786a6cd523
commit 95a47d346e
4 changed files with 85 additions and 0 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
use flake

1
.gitignore vendored
View File

@ -1 +1,2 @@
.direnv
build/

27
flake.lock generated Normal file
View File

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1705697961,
"narHash": "sha256-XepT3WS516evSFYkme3GrcI3+7uwXHqtHbip+t24J7E=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e5d1c87f5813afde2dda384ac807c57a105721cc",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

56
flake.nix Normal file
View File

@ -0,0 +1,56 @@
{
description = "Library Manager";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs = {
self,
nixpkgs,
}: let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
};
crow = pkgs.stdenv.mkDerivation rec {
pname = "crow";
version = "1.0+5";
src = pkgs.fetchFromGitHub {
owner = "CrowCpp";
repo = "Crow";
rev = "v${version}";
hash = "sha256-rxA4HgdyY+Pi0M5cGtci6DRR9F947GPD25ut4gvSIP0=";
};
cmakeFlags = [
"-DCROW_BUILD_EXAMPLES=OFF"
"-DCROW_BUILD_TESTS=OFF"
];
nativeBuildInputs = with pkgs; [
cmake
boost
openssl
zlib
];
doCheck = false;
};
in {
devShells.${system}.default = pkgs.mkShell {
buildInputs = with pkgs; [
nodejs
cargo
rustc
pkg-config
gtk3
webkitgtk
gnumake
boost
crow
];
};
};
}