mirror of
https://github.com/ziglang/zig.git
synced 2024-11-21 19:42:56 +00:00
Updated Development with nix (markdown)
parent
216d6b88f0
commit
93f2f2dff2
@ -1,3 +1,5 @@
|
||||
## Traditional approach
|
||||
|
||||
Here is a sample `shell.nix` for building/developing zig.
|
||||
```nix
|
||||
let
|
||||
@ -10,7 +12,6 @@ in
|
||||
{ pkgs ? import nixpkgs { } }:
|
||||
|
||||
pkgs.mkShell {
|
||||
hardeningDisable = [ "all" ];
|
||||
nativeBuildInputs = with pkgs; [
|
||||
cmake
|
||||
gdb
|
||||
@ -22,10 +23,14 @@ pkgs.mkShell {
|
||||
lld
|
||||
llvm
|
||||
]);
|
||||
|
||||
hardeningDisable = [ "all" ];
|
||||
}
|
||||
```
|
||||
The `hardeningDisable` part is crucial, otherwise you will get compile errors.
|
||||
|
||||
## Flake
|
||||
|
||||
Alternatively, you can use this sample `flake.nix`:
|
||||
|
||||
```nix
|
||||
@ -48,7 +53,6 @@ Alternatively, you can use this sample `flake.nix`:
|
||||
in
|
||||
{
|
||||
devShell.${system} = pkgs.mkShell {
|
||||
hardeningDisable = [ "all" ];
|
||||
nativeBuildInputs = with pkgs; [
|
||||
cmake
|
||||
gdb
|
||||
@ -60,6 +64,8 @@ Alternatively, you can use this sample `flake.nix`:
|
||||
lld
|
||||
llvm
|
||||
]);
|
||||
|
||||
hardeningDisable = [ "all" ];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user