diff --git a/Makefile b/Makefile index 5e6054c1..3340fd10 100644 --- a/Makefile +++ b/Makefile @@ -40,6 +40,9 @@ DOCKER_IMAGE_NIM_PARAMS ?= -d:chronicles_colors:none -d:insecure LINK_PCRE := 0 +CXXFLAGS ?= -std=c++17 -mssse3 +export CXXFLAGS + # we don't want an error here, so we can handle things later, in the ".DEFAULT" target -include $(BUILD_SYSTEM_DIR)/makefiles/variables.mk diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..2ea7b7ee --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1729449015, + "narHash": "sha256-Gf04dXB0n4q0A9G5nTGH3zuMGr6jtJppqdeljxua1fo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "89172919243df199fe237ba0f776c3e3e3d72367", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..8778ca4a --- /dev/null +++ b/flake.nix @@ -0,0 +1,35 @@ +{ + description = "Codex build flake"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; + }; + + outputs = { self, nixpkgs }: + let + supportedSystems = [ + "x86_64-linux" "aarch64-linux" + "x86_64-darwin" "aarch64-darwin" + ]; + forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system); + pkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); + in rec { + devShells = forAllSystems (system: let + pkgs = pkgsFor.${system}; + inherit (pkgs) lib stdenv mkShell; + in { + default = mkShell.override { stdenv = pkgs.gcc11Stdenv; } { + buildInputs = with pkgs; [ + # General + git pkg-config openssl lsb-release + # Build + rustc cargo nimble gcc11 cmake nim-unwrapped-1 + # Libraries + gmp llvmPackages.openmp + # Tests + nodejs_18 + ]; + }; + }); + }; +} \ No newline at end of file