nix-flake: Add shell definition (#954)
Initialized flake file and added development shell definition. Exporting of default compiler flags is moved to makefile. Referenced issue: https://github.com/codex-storage/nim-codex/issues/940 Signed-off-by: markoburcul <marko@status.im>
This commit is contained in:
parent
86257054ee
commit
2151e02838
3
Makefile
3
Makefile
|
@ -40,6 +40,9 @@ DOCKER_IMAGE_NIM_PARAMS ?= -d:chronicles_colors:none -d:insecure
|
||||||
|
|
||||||
LINK_PCRE := 0
|
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
|
# we don't want an error here, so we can handle things later, in the ".DEFAULT" target
|
||||||
-include $(BUILD_SYSTEM_DIR)/makefiles/variables.mk
|
-include $(BUILD_SYSTEM_DIR)/makefiles/variables.mk
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
}
|
|
@ -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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue