initial flake setup
This commit is contained in:
29
flake.nix
Normal file
29
flake.nix
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
description = "Development environment for Zig using Nix flakes";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs }: let
|
||||||
|
system = "x86_64-linux"; # or "aarch64-linux", "aarch64-darwin", etc.
|
||||||
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
in {
|
||||||
|
devShells.${system}.default = pkgs.mkShell {
|
||||||
|
name = "zig-dev-shell";
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
pkgs.zig
|
||||||
|
pkgs.zls # Zig Language Server (optional)
|
||||||
|
pkgs.gdb # Debugger (optional)
|
||||||
|
pkgs.pkg-config
|
||||||
|
];
|
||||||
|
|
||||||
|
shellHook = ''
|
||||||
|
echo "Zig development environment activated."
|
||||||
|
zig version
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user