Skip to content

Commit

Permalink
nix-flake: Add shell definition (#954)
Browse files Browse the repository at this point in the history
Initialized flake file and added development shell definition.
Exporting of default compiler flags is moved to makefile.

Referenced issue: #940

Signed-off-by: markoburcul <[email protected]>
  • Loading branch information
markoburcul authored Nov 4, 2024
1 parent 8625705 commit 2151e02
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -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
];
};
});
};
}

0 comments on commit 2151e02

Please sign in to comment.