push
This commit is contained in:
commit
28e4f80acf
2 changed files with 243 additions and 0 deletions
30
flake.nix
Normal file
30
flake.nix
Normal 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 ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue