This commit is contained in:
itamar 2026-04-10 00:17:00 +02:00
commit 28e4f80acf
Signed by: itamar
SSH key fingerprint: SHA256:Dv6UzB9hN8q8FUgMR/7X3DTFpE/vSB2m05+KNnxM4B0
2 changed files with 243 additions and 0 deletions

30
flake.nix Normal file
View file

@ -0,0 +1,30 @@
{
description = "Lucy prime counting sieve";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }: let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
packages.${system}.default = pkgs.stdenv.mkDerivation {
pname = "lucy";
version = "1.0";
src = ./.;
buildInputs = [ pkgs.glibc ];
buildPhase = ''
gcc -O2 -o lucy main.c -lm
'';
installPhase = ''
mkdir -p $out/bin
cp lucy $out/bin/lucy
'';
};
devShells.${system}.default = pkgs.mkShell {
packages = [ pkgs.gcc pkgs.gdb pkgs.valgrind ];
};
};
}